﻿var MAXVALIP = "http://maxval-ip.com";
function myprofile(refno) {
    var str = "";
    str = str + "<br><br><table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='UserWelcome.aspx'><img src='images/myhome1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='UserWelcome.aspx'><img src='images/myapp.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='user_fullview.aspx'><img src='images/RecentUpdates1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='http://portal.uspto.gov/external/portal/pair'><img src='images/LinkToUSPTO1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='my_profile.aspx'><img src='images/myprof2.gif' width='188' height='20' border='0'/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='Logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='https://maxval-ip.com/support/support_boundary.asp?pro=PA&crefno=" + refno + "' target='_blank'><img src='images/support1.gif' width='188' height='20' border='0'/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0'/></a></div></td></tr></table>";
    document.write(str);
}

function app(refno) {
    var str = "";
    str = str + "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='UserWelcome.aspx'><img src='images/myhome1.gif' width='188' height='20' border='0'></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><img src='images/myapp2.gif' width='188' height='20'></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='user_fullview.aspx'><img src='images/RecentUpdates1.gif' width='188' height='20' border='0'></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='http://portal.uspto.gov/external/portal/pair'><img src='images/LinkToUSPTO1.gif' width='188' height='20' border='0'></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='my_profile.aspx'><img src='images/myprof1.gif' width='188' height='20' border='0'></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='https://maxval-ip.com/support/support_boundary.asp?pro=PA&crefno=" + refno + "' target='_blank'><img src='images/support1.gif' width='188' height='20' border='0'/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0'></a></div></td></tr></table>";
    document.write(str);
}

function app1(refno) {
    var str = "";
    str = str + "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='UserWelcome.aspx'><img src='images/" + hv + "' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/mypahome2.gif');\" onMouseOut=\"mousemove(this,'images/" + hv + "');\"></a></div></td></tr>";
    //str=str+"<tr><td height='20' valign='top'><div align='right'><a href='UserWelcome.aspx'> <img src='images/"+av+"' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/myapp2.gif');\" onMouseOut=\"mousemove(this,'images/"+av+"');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='user_fullview.aspx'><img src='images/" + ruv + "' border='0' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/RecentUpdates2.gif');\" onMouseOut=\"mousemove(this,'images/" + ruv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='http://portal.uspto.gov/external/portal/pair'><img src='images/" + uv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/LinkToUSPTO2.gif');\" onMouseOut=\"mousemove(this,'images/" + uv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='my_profile.aspx'> <img src='images/" + pv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/myprof2.gif');\" onMouseOut=\"mousemove(this,'images/" + pv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Logout.aspx'> <img src='images/" + lv + "' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/logout2.gif');\" onMouseOut=\"mousemove(this,'images/" + lv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='https://maxval-ip.com/support/support_boundary.asp?pro=PA&crefno=" + refno + "' target='_blank'> <img src='images/" + sv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/Support2.gif');\" onMouseOut=\"mousemove(this,'images/" + sv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='help/final.htm'> <img src='images/" + hlv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/help2.gif');\" onMouseOut=\"mousemove(this,'images/" + hlv + "');\"></a></div></td></tr></table>";
    document.write(str);
}


function emailval(btn) {//alphabetics without special symbols
if ((event.keyCode>96 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || (event.keyCode>47 && event.keyCode<59)  || event.keyCode==13 || event.keyCode==32 || event.keyCode==64 || event.keyCode==46 ) {
return EnterKeyMonitor(btn);
}
else {
alert("Invalid Character")
return false;
}
}

function EnterKeyMonitor(ids)
{
var buttonToClick=document.getElementById(ids);
if (event.keyCode == 13)
{
event.cancelBubble = true;
event.returnValue = false;
buttonToClick.click();
}
}


function valalpha(btn) {
if ((event.keyCode>96 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || event.keyCode==13|| event.keyCode==32|| event.keyCode==46) {

return EnterKeyMonitor(btn);
}
else {
alert("Invalid Character")
return false;
}
}

function valcity(btn) {
if ((event.keyCode>96 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || event.keyCode==13|| event.keyCode==32) {

return EnterKeyMonitor(btn);
}
else {
alert("Invalid character")
return false;
}
}

function valnumber(btn) 
{
if ((event.keyCode>96 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || event.keyCode==13|| event.keyCode==32|| event.keyCode==46) {
return EnterKeyMonitor(btn);
}
else {
alert("Invalid Number")
return false;
}
}


function usernameval(btn)
{
if ((event.keyCode>95 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || (event.keyCode>47 && event.keyCode<59)  || event.keyCode==13 || event.keyCode==32 || event.keyCode==64 || event.keyCode==46 ||event.keyCode==45) {
return EnterKeyMonitor(btn);
}
else {
alert("Invalid Character")
return false;
}
}

function numval(btn)
 {
     if((event.keyCode>47 && event.keyCode<59 && event.keyCode!=17)) 		
		{
		return EnterKeyMonitor(btn);
		}
		else
		{
		alert("Please enter a valid number");
		return false;
	}
 }
 
 function numspace(btn)
 {
     if((event.keyCode!=32)) 		
		{
		return EnterKeyMonitor(btn);
		}
		else
		{
		alert("Invalid character");
		return false;
	}
 }		

function valstate(btn) {
if ((event.keyCode>96 && event.keyCode<123) || (event.keyCode>64 && event.keyCode<91) || event.keyCode==13|| event.keyCode==32) 
{
return EnterKeyMonitor(btn);
}
else {
alert("Invalid character")
return false;
}
}


function valnum(btn)
 {
if (event.keyCode !=32) 
{
return EnterKeyMonitor(btn);
}
else 
{
alert("Invalid Character")
return false;
}
}

      function vldapp_no(btn)
          {
          //0-9,delkey,refresh,-
        if ((event.keyCode>95 && event.keyCode<106) || (event.keyCode>47 && event.keyCode<58) || event.keyCode==46 || event.keyCode==116 || event.keyCode==189 || event.keyCode==9 || event.keyCode==35 || event.keyCode==36 || event.keyCode==37 || event.keyCode==39|| event.keyCode==8|| event.keyCode==16|| event.keyCode==40|| event.keyCode==13|| event.keyCode==38 || event.keyCode==188 || event.keyCode==191 || event.keyCode==111 || event.keyCode==20 || event.keyCode==220 || event.keyCode==86 || event.keyCode==17 || event.keyCode==67)
	        {

return EnterKeyMonitor(btn);
	        }
          else
            {	        
		        alert("Invalid character not allowed \r\r\r Note: use pipe symbol \"|\" as a sperator \r for multiple application numbers.\r(Example: 11/234563 | 07/657296)");		      
		        return false;
	        }	
        }
        

function menubig(val, refno, viewprof) {
    var filename = window.location.href;
    var index = filename.lastIndexOf("/");
    switch (val) {
        case 'h':
            hv = "mypahome2.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;

        case 'ru':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates2.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'u':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO2.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'p':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof2.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'l':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout2.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 's':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support2.gif";
            hlv = "help1.gif";
            break;
        case 'hl':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help2.gif";
            break;
        default:
            hv = "mypahome2.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
    }

    var str = "";

    str = str + "<table id='menubig' width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='UserWelcomeIFrameValue.aspx' target='frame1' ><img id='h' name='mypahome' onclick='imgChange(this)' src='images/mypahome1-1.gif' width='188' height='20' border='0' onMouseOver=\"mousemoveMenu(this,'images/mypahome2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/mypahome1-1.gif');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='user_fullview.aspx' target='frame1'><img id='ru' name='RecentUpdates' onclick='imgChange(this)' src='images/RecentUpdates1.gif' border='0' width='188' height='20' border='0' onMouseOver=\"mousemoveMenu(this,'images/RecentUpdates2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/RecentUpdates1.gif');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='http://portal.uspto.gov/external/portal/pair' target='_blank'><img id='u' name='LinkToUSPTO' onclick='imgChange(this)' src='images/LinkToUSPTO1.gif' border='0' width='188' height='20' onMouseOver=\"mousemoveMenu(this,'images/LinkToUSPTO2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/LinkToUSPTO1.gif');\"></a></div></td></tr>";
    if (viewprof == 'Y') {
        str = str + "<tr><td height='20' valign='top'><div align='right'><a href='MyProfile.aspx' target='frame1'><img id='p' name='myprof' onclick='imgChange(this)' src='images/myprof1.gif' border='0' width='188' height='20' onMouseOver=\"mousemoveMenu(this,'images/myprof2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/myprof1.gif');\"></a></div></td></tr>";
    }
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Logout.aspx'> <img id='l' name='logout' onclick='imgChange(this)' src='images/logout1.gif' width='188' height='20' border='0' onMouseOver=\"mousemoveMenu(this,'images/logout2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/logout1.gif');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='https://maxval-ip.com/support/support_boundary.asp?pro=PA&crefno=" + refno + "' target='_blank'> <img id='s' name='Support' src='images/Support1.gif' border='0' width='188' height='20' onMouseOver=\"mousemoveMenu(this,'images/Support2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/Support1.gif');\"/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='help/final.htm' target='_blank'> <img id='hl' name='help' src='images/help1.gif' border='0' width='188' height='20' onMouseOver=\"mousemoveMenu(this,'images/help2.gif');\" onMouseOut=\"mousemoveMenu(this,'images/help1.gif');\"></a></div></td></tr></table>";

    document.write(str);
}

function greymenu() {

    var ele = document.all ? document.all : document.getElementsByTagName("*");
    ele["h"].src = "images/mypahome1-1.gif";   
    ele["ru"].src = "images/RecentUpdates1.gif";
    ele["u"].src = "images/LinkToUSPTO1.gif";
    ele["p"].src = "images/myprof1.gif";
    ele["l"].src = "images/logout1.gif";
    ele["s"].src = "images/Support1.gif";
    ele["hl"].src = "images/help1.gif";
    
}

function imgChange(val) {
    greymenu();

    val.src = "images/" + val.name + "21.gif";
}

function imgChangeRefresh(val) {
 
    greymenu();
    var ele = document.all ? document.all : document.getElementsByTagName("*");
 
    switch (val) {
        case 'UserWelcomeIFrameValue.aspx':
            ele["h"].src = "images/mypahome21.gif";
            break;
        case 'user_fullview.aspx':
            ele["ru"].src = "images/RecentUpdates21.gif";
            break;
        case 'MyProfile.aspx':
            ele["p"].src = "images/myprof21.gif";
            break;
        default:
            ele["h"].src = "images/mypahome21.gif";
            break;
    }

}


function imgChange1(val) {
    alert(val.id);
  
   
    if (val.id == 'h') {

    }
    if (val.id == 'ru') {
        var x = document.getElementById('menubig').rows[1].cells;
        var imgValue = x[0].innerHTML;
        alert(x[0].innerHTML);
        if (imgValue.indexOf('RecentUpdates1.gif') != -1) {
            x[0].innerHTML = "<div align='right'><a href='user_fullview.aspx' target='frame1'><img src='images/RecentUpdates2.gif' border='0' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/RecentUpdates2.gif');\" onMouseOut=\"mousemove(this,'images/RecentUpdates2.gif');\"></a></div>";
        }
        var x = document.getElementById('menubig').rows[1].cells;
        alert(x[0].innerHTML);
    }
    if (val.id == 'p') {
        var x = document.getElementById('menubig').rows[3].cells;
        var imgValue = x[0].innerHTML;
        alert(x[0].innerHTML);
        if (imgValue.indexOf('myprof1.gif') != -1) {
            x[0].innerHTML = "<div align='right'><a href='MyProfile.aspx' target='frame1'><img src='images/myprof2.gif' border='0' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/myprof2.gif');\" onMouseOut=\"mousemove(this,'images/myprof2.gif');\"></a></div>";
        }
        var x = document.getElementById('menubig').rows[3].cells;
        alert(x[0].innerHTML);
    }
    if (val.id == 'l') {

    }
    if (val.id == 'hl') {
    } 
}
function menubig1(val, refno, viewprof) {

    var filename = window.location.href;
    var index = filename.lastIndexOf("/");
    filename = filename.substring(index + 1);
    if (filename == "UserWelcome.aspx")
        val = "h";
    else if (filename == "user_fullview.aspx")
        val = "ru";
    else if (filename == "MyProfile.aspx")
        val = "p";
    else if (filename == "Logout.aspx")
        val = "l";
    else if (filename == "final.htm")
        val = "hl";
    switch (val) {
        case 'h':
            hv = "mypahome2.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;

        case 'ru':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates2.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'u':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO2.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'p':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof2.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 'l':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout2.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
        case 's':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support2.gif";
            hlv = "help1.gif";
            break;
        case 'hl':
            hv = "mypahome1-1.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help2.gif";
            break;
        default:
            hv = "mypahome2.gif";
            ruv = "RecentUpdates1.gif";
            uv = "LinkToUSPTO1.gif";
            pv = "myprof1.gif";
            lv = "logout1.gif";
            sv = "Support1.gif";
            hlv = "help1.gif";
            break;
    }


    var str = "";
    str = str + "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Default.aspx?UserWelcomeIFrameValue' target='_self'><img src='images/" + hv + "' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/mypahome2.gif');\" onMouseOut=\"mousemove(this,'images/" + hv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Default.aspx?user_fullview' target='_self'><img src='images/" + ruv + "' border='0' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/RecentUpdates2.gif');\" onMouseOut=\"mousemove(this,'images/" + ruv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='http://portal.uspto.gov/external/portal/pair' target='_blank'><img src='images/" + uv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/LinkToUSPTO2.gif');\" onMouseOut=\"mousemove(this,'images/" + uv + "');\"></a></div></td></tr>";
    if (viewprof == "Y") {
        str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Default.aspx?MyProfile' target='_self'> <img src='images/" + pv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/myprof2.gif');\" onMouseOut=\"mousemove(this,'images/" + pv + "');\"></a></div></td></tr>";
    }
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='Logout.aspx'> <img src='images/" + lv + "' width='188' height='20' border='0' onMouseOver=\"mousemove(this,'images/logout2.gif');\" onMouseOut=\"mousemove(this,'images/" + lv + "');\"></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top' bgcolor='#DBE3E6'><div align='right'><a href='https://maxval-ip.com/support/support_boundary.asp?pro=PA&crefno=" + refno + "' target='_blank'> <img src='images/" + sv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/Support2.gif');\" onMouseOut=\"mousemove(this,'images/" + sv + "');\"/></a></div></td></tr>";
    str = str + "<tr><td height='20' valign='top'><div align='right'><a href='help/final.htm' target='_blank'> <img src='images/" + hlv + "' border='0' width='188' height='20' onMouseOver=\"mousemove(this,'images/help2.gif');\" onMouseOut=\"mousemove(this,'images/" + hlv + "');\"></a></div></td></tr></table>";

    document.write(str);
}

function admin_index() {
    var str = "";
    str = str + "    <table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_index.asp'><img src='images/adminpanel2.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_4inv.asp'><img src='images/inv1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";

    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='scrap.asp'><img src='images/Bulk-Scraping1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='insertdet.asp'><img src='images/Data-Feeding1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='shootmail.asp'><img src='images/Shoot-Alert-Mails1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='user_details.asp' target='blank'><img src='images/Client-List1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "<tr><td height='21' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "      </table>";
    document.write(str);
}

function admin_inv() {
    var str = "";
    str = str + "    <table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_index.asp'><img src='images/adminpanel1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_4inv.asp'><img src='images/inv2.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";

    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='scrap.asp'><img src='images/Bulk-Scraping1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='insertdet.asp'><img src='images/Data-Feeding1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='shootmail.asp'><img src='images/Shoot-Alert-Mails1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='user_details.asp' target='blank'><img src='images/Client-List1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "<tr><td height='21' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "      </table>";
    document.write(str);
}





function bulk_srp() {
    var str = "";
    str = str + "    <table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_index.asp'><img src='images/adminpanel1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_4inv.asp'><img src='images/inv1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='scrap.asp'><img src='images/Bulk-Scraping2.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='insertdet.asp'><img src='images/Data-Feeding1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='shootmail.asp'><img src='images/Shoot-Alert-Mails1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='user_details.asp' target='blank'><img src='images/Client-List1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "<tr><td height='21' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "      </table>";
    document.write(str);
}

function data_feed() {
    var str = "";
    str = str + "    <table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_index.asp'><img src='images/adminpanel1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_4inv.asp'><img src='images/inv1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";

    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='scrap.asp'><img src='images/Bulk-Scraping1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='insertdet.asp'><img src='images/Data-Feeding2.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='shootmail.asp'><img src='images/Shoot-Alert-Mails1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='user_details.asp' target='blank'><img src='images/Client-List1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "<tr><td height='21' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "      </table>";
    document.write(str);
}

function shoot_mail() {
    var str = "";
    str = str + "    <table width='100%'  border='0' cellspacing='0' cellpadding='0'>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_index.asp'><img src='images/adminpanel1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='admin_4inv.asp'><img src='images/inv1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";

    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='scrap.asp'><img src='images/Bulk-Scraping1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='insertdet.asp'><img src='images/Data-Feeding1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='shootmail.asp'><img src='images/Shoot-Alert-Mails2.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='user_details.asp' target='blank'><img src='images/Client-List1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "        <tr>";
    str = str + "          <td height='21'><div align='right'><a href='logout.aspx'><img src='images/logout1.gif' width='188' height='20' border='0'></a></div></td>";
    str = str + "        </tr>";
    str = str + "<tr><td height='21' bgcolor='#DBE3E6'><div align='right'><a href='help/final.htm'><img src='images/help1.gif' width='188' height='20' border='0' /></a></div></td></tr>";
    str = str + "      </table>";
    document.write(str);
}

function top() {
    var str = "";
    str = str + "<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#FFFFFF'>";
    str = str + "<tr bgcolor=''><td width='51%' height='10' align='left' valign='top' bgcolor=''>";
    str = str + "<img src='../images/p_01.gif' width='996' height='100' valign='top' usemap='#map1' border=0><map name='map1'><area shape='rect' coords='3,32,205,83' href='http://www.maxval-ip.com' target='_blank'></map></td>";
    str = str + "<td width='39%' align='left' valign='top' bgcolor=''><img src='images/p_02 .gif' width='100%' height='100'></td></tr>";
    str = str + "</table>";
    document.write(str);
}


function bot(val) {
    if (val == "" || val == "undefined") val = "3.0.0.0";
    var str = "";
    str = str + "<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#DBE3E6'>";
    str = str + "<tr>";
    str = str + "    <td width='67%' height='24' class='txtBlue'>Copyright &copy; 2006 <a href='http://maxval-ip.com' target='_blank' class='txtBlue'>MaxVal</a> | Version: " + val + "</td>";
    str = str + "    <td width='33%'>";
    str = str + "		<table width='100%' border='0' cellpadding='0' cellspacing='0' bgcolor='#DBE3E6'>";
    str = str + "          <tr>";
    str = str + "              <td height='24' align='right' class='styleW'><span class='txtBlue'><font face='verdana' color='#383838'><font face='verdana' color='#383838'><a href='disclaimer.aspx' target='_blank' class='txtBlue'>Disclaimer</a></font></font>&nbsp;| <a href='http://maxval-ip.com/privacy.htm' target='_blank' class='txtBlue'>Privacy Policy</a> |</span> <span class='txtBlue'><a href='terms_use.aspx' target='_blank' class='txtBlue'>Terms of Use</a> | <a href='http://maxval-ip.com/contactus.htm' target='_blank' class='txtBlue'>Contact Us </a></span>&nbsp;&nbsp;&nbsp;</td>";
    str = str + "          </tr>";
    str = str + "       </table>";
    str = str + "	 </td>";
    str = str + "</tr>";
    str = str + "</table>";
    document.write(str);
}
function mmLoadMenus() {
    if (window.mm_menu_0707155537_0) return;
    window.mm_menu_0707155537_0 = new Menu("root", 162, 18, "Verdana, Arial, Helvetica, sans-serif", 12, "#126CA9", "#FFFFFF", "#DBE3E6", "#A3B5E4", "left", "middle", 3, 0, 100, -5, 7, true, true, true, 0, true, true);
    mm_menu_0707155537_0.addMenuItem("Patent&nbsp;Mapping", "window.open('http://www.maxval-ip.com/patent_mapping.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Prior&nbsp;Art&nbsp;Search", "window.open('http://www.maxval-ip.com/prior_art_search.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Intelligence&nbsp;Reports", "window.open('http://www.maxval-ip.com/intelligence_reports.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Database&nbsp;Services", "window.open('http://www.maxval-ip.com/database_construction.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("PAIR&nbsp;Alert", "window.open('http://maxval-pairalert.com', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Patent&nbsp;Tools", "window.open('http://www.maxvalgroup.com/patent%20tools/home.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Illustrations", "window.open('http://www.maxval-drawings.com', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Custom&nbsp;Projects", "window.open('http://www.maxval-ip.com/custom_projects.htm', '_blank');");
    mm_menu_0707155537_0.addMenuItem("Animations", "window.open('http://www.maxval-ip.com/animation.htm', '_blank');");

    mm_menu_0707155537_0.fontWeight = "bold";
    mm_menu_0707155537_0.hideOnMouseOut = true;
    mm_menu_0707155537_0.bgColor = '#ECECF1';
    mm_menu_0707155537_0.menuBorder = 1;
    mm_menu_0707155537_0.menuLiteBgColor = '#FFFFFF';
    mm_menu_0707155537_0.menuBorderBgColor = '#ECECF1';

    mm_menu_0707155537_0.writeMenus();
}


function homemenu() {

    var str;
    str = "";
    str = str + "<script language='JavaScript'>mmLoadMenus();</script>";
    str = str + "<script language='JavaScript' src='js.js'></script>";
    str = str + "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>";
    str = str + "<td align='left' background='images/Top-Ban3.gif'><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='1000' height='100'>";
    str = str + "<param name='movie' value='Swf/top.swf'>";
    str = str + "<param name='quality' value='high'>";
    str = str + "<embed src='Swf/top.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='1000' height='100'></embed>";
    str = str + "</object></td></tr>";
    str = str + " <tr><td align='center' background='images/menu-bg.gif'><table width='77%' border='0' align='center' cellpadding='0' cellspacing='0'>";
    str = str + "<tr><td width='122' align='right'><a href='" + MAXVALIP + "/home.asp' target='_blank'><img src='images/home.png' width='122' height='26' border='0'onMouseOver=\"mousemove(this,'images/home1.png');\" onMouseOut=\"mousemove(this,'images/home.png')\"></a></td>";
    str = str + "<td width='125' align='right'><a href='" + MAXVALIP + "/aboutus.htm' target='_blank'><img src='images/aboutus.png' onMouseOut=\"mousemove(this,'images/aboutus.png');\" onMouseOver=\"mousemove(this,'images/aboutus1.png');\" width='125' height='26' border='0'></a></td>";
    str = str + "<td width='126' align='left'><a href='" + MAXVALIP + "/services.htm' target='_blank' onMouseOver=\"MM_showMenu(window.mm_menu_0707155537_0,0,22,null,'image1')\" onMouseOut=\"MM_startTimeout();\"><img src='images/services1.png' name='image1'  width='125' height='26' border='0' id='image1'></a><a href='javascript:;' onMouseOver=\"MM_showMenu(window.mm_menu_0707155537_0,0,22,null,'image1')\" onMouseOut=\"MM_startTimeout();\"></a></td>";
    //str = str + "<td width='126' align='left'><a href='"+MAXVALIP+"/services.htm' target='_blank' onMouseOver='MM_showMenu(window.mm_menu_0707155537_0,0,22,null,'image1');' onMouseOut='MM_startTimeout();'><img src='images/services1.png' name='image1'  width='125' height='26' border='0' id='image1'></a><a href='javascript:;' onMouseOver='MM_showMenu(window.mm_menu_0707155537_0,0,22,null,'image1');' onMouseOut='MM_startTimeout();'></a></td>";
    str = str + "<td width='125' align='left'><a href='" + MAXVALIP + "/team.htm' target='_blank'><img src='images/team.png' onMouseOut=\"mousemove(this,'images/team.png');\" onMouseOver=\"mousemove(this,'images/team1.png');\" width='125' height='26' border='0'></a></td>";
    str = str + "<td width='125'><a href='" + MAXVALIP + "/clients.htm' target='_blank'><img src='images/client.png'   onMouseOut=\"mousemove(this,'images/client.png');\" onMouseOver=\"mousemove(this,'images/client1.png');\" width='125' height='26' border='0'></a></td>";
    str = str + "<td width='125'><a href='" + MAXVALIP + "/career.htm' target='_blank'><img src='images/careers.png'   onMouseOut=\"mousemove(this,'images/careers.png');\" onMouseOver=\"mousemove(this,'images/careers1.png');\" width='125' height='26' border='0'></a></td>";
    str = str + "<td width='125'><a href='" + MAXVALIP + "/contactus.htm' target='_blank'><img src='images/contactus.png'  onMouseOut=\"mousemove(this,'images/contactus.png');\" onMouseOver=\"mousemove(this,'images/contactus1.png');\"  width='125' height='26' border='0'></a></td>";
    str = str + "<td width='138'><a href='" + MAXVALIP + "/sitemap.htm' target='_blank'><img src='images/sitemap.png' width='122' height='26' border='0'onMouseOver=\"mousemove(this,'images/sitemap1.png');\" onMouseOut=\"mousemove(this,'images/sitemap.png');\"></a></td>";
    str = str + "</tr></table></td></tr></table>";
    document.write(str);
}

function checkval() {
    alert("testCheck");
    var uname = document.forms[0].txtuname;
    var pswd = document.getElementById('txtpswd').value;

    alert(uname);
    alert(pswd);

    if (document.getElementById('txtuname') == "") {
        alert("Enter the username");
        document.login.uname.focus();
        return false;
    }
    if (document.getElementById('txtpswd') == "")
    //.login.passwd.value=="")
    {
        alert("Enter the password");
        document.login.passwd.focus();
        return false;
    }
    if (document.getElementById('txtuname') == "" && document.getElementById('txtpswd') == "") {

        alert("Enter username and password");
        return false;
    }
}

function chkuser() {
    alert("Invalid username/password");
}

function openmail2(url, wt, ht, wname) {
    if (!(window.chwin && window.chwin.open && !window.chwin.closed)) {
        var iMyWidth;
        var iMyHeight;
        iMyWidth = (window.screen.width / 2) - ((wt / 2) + 10);
        iMyHeight = (window.screen.height / 2) - ((ht / 2) + 50);
        chwin = window.open(url, wname, "status=no,height=" + ht + ",width=" + wt + ",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
        chwin.focus();

        return false;
    }
}

   function delayer()
        {
            parent.location="Login.aspx";
        }



function readCookie(cookies) {

    var txtuname = document.getElementById('txtuname')
    var txtpass = document.getElementById('txtpswd')

    if (document.cookie.length > 0 && document.getElementById('txtuname').value.length > 0) {
        // check the index of the username that is entered by user in Username text box
        var c_start = document.cookie.indexOf(txtuname.value);
        if (c_start != -1) {


            var c_end = document.cookie.indexOf(";", c_start);

            if (c_end == -1) {
                c_end = document.cookie.length;

            }

            var value = unescape(document.cookie.substring(c_start, c_end));

            var arr = new Array(10);
            arr = value.split('=');
            // if only 0ne equal sign is present that is default one
            if (arr[0] == txtuname.value && arr.length == 2) {

                txtpass.value = arr[1];
            }
            // if the password contain =(equal) signs in it
            else if (arr[0] == txtuname.value && arr.length > 2) {
                var pass = arr[1];
                for (i = 2; i < arr.length; i++) {
                    pass += arr[i];
                }

                txtpass.value = pass;
            }
            else {
                txtpass.value = "";
            }
        }

        else {
            txtpass.value = "";
        }
    }
    else {
        txtpass.value = "";
    }

}



function overlay(curobj, subobjstr, opt_position, tp, lt) {
    if (document.getElementById) {
        var subobj = document.getElementById(subobjstr)
        subobj.style.display = (subobj.style.display != "block") ? "block" : "none"
        var xpos = getposOffset(curobj, "left") + ((typeof opt_position != "undefined" && opt_position.indexOf("right") != -1) ? -(subobj.offsetWidth - curobj.offsetWidth) : 0)
        var ypos = getposOffset(curobj, "top") + ((typeof opt_position != "undefined" && opt_position.indexOf("bottom") != -1) ? curobj.offsetHeight : 0)
        subobj.style.left = xpos - lt + "px"
        subobj.style.top = ypos + tp + "px"
        return false
    }
    else
        return true
}

function overlayclose(subobj) {
    document.getElementById(subobj).style.display = "none"
}


function changecolor(something, black) {
    if (something.style.color == "gray") {
        something.value = "";
        something.style.color = black;
    }
}



function clearvalue() {
    document.aspnetForm.reset();
    return false;
}

function openmail1(url, wt, ht, wname) {
    if (!(window.chwin && window.chwin.open && !window.chwin.closed)) {
        var iMyWidth;
        var iMyHeight;
        iMyWidth = (window.screen.width / 2) - ((wt / 2) + 10);
        iMyHeight = (window.screen.height / 2) - ((ht / 2) + 50);
        chwin = window.open(url, wname, "status=no,height=" + ht + ",width=" + wt + ",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=yes,location=no,directories=no");
        chwin.focus();

        return false;
    }
}

// JScript File  tooltip javascript
function mousemove(idd, srcc) 
{
    idd.src = srcc;
}

function mousemoveMenu(idd, srcc) {
    var index = idd.src.lastIndexOf("/");
  
    var strng = idd.src.substring(index + 1);
 
    index = strng.indexOf(".");
    strng = strng.substring(index - 2, index);

    if (strng != "21") {
       
        idd.src = srcc;
    }
}




// Priority.js


var enablepersist = "on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious = "no" //Collapse previously open content when opening present? (yes/no)

var contractsymbol = '<img src=images/minus.gif>' //HTML for contract symbol. For image, use: <img src="whatever.gif">
var expandsymbol = '<img src=images/plus.gif>' //HTML for expand symbol.


if (document.getElementById) {
    document.write('<style type="text/css">')
    document.write('.switchcontent{display:none;}')
    document.write('.switchcontent1{display:block;}')
    document.write('</style>')
}

function getElementbyClass(rootobj, classname) {
    var temparray = new Array()
    var inc = 0
    var rootlength = rootobj.length
    for (i = 0; i < rootlength; i++) {
        if (rootobj[i].className == classname)
            temparray[inc++] = rootobj[i]
    }
    return temparray
}

function sweeptoggle(ec) {
    var thestate = (ec == "expand") ? "block" : "none"
    var inc = 0
    while (ccollect[inc]) {
        ccollect[inc].style.display = thestate
        inc++
    }
    revivestatus()
}


function contractcontent(omit) {
    var inc = 0
    while (ccollect[inc]) {
        if (ccollect[inc].id != omit)
            ccollect[inc].style.display = "none"
        inc++
    }
}

function expandcontent(curobj, cid) {
    var cid1 = cid + "1"
    var spantags = curobj.getElementsByTagName("SPAN")
    var showstateobj = getElementbyClass(spantags, "showstate")
    if (ccollect.length > 0) {
        if (collapseprevious == "yes")
            contractcontent(cid)
        document.getElementById(cid).style.display = (document.getElementById(cid).style.display != "block") ? "block" : "none"
        if (showstateobj.length > 0) { //if "showstate" span exists in header
            if (collapseprevious == "no") {
                showstateobj[0].innerHTML = (document.getElementById(cid).style.display == "block") ? contractsymbol : expandsymbol
                document.getElementById(cid1).style.display = (document.getElementById(cid).style.display == "block") ? "none" : "block"
            }
            else
                revivestatus()
        }
    }
}

function revivecontent() {
    contractcontent("omitnothing")
    selectedItem = getselectedItem()
    selectedComponents = selectedItem.split("|")
    for (i = 0; i < selectedComponents.length - 1; i++)
        document.getElementById(selectedComponents[i]).style.display = "block"
}

function revivestatus() {
    var inc = 0
    while (statecollect[inc]) {
        if (ccollect[inc].style.display == "block")
            statecollect[inc].innerHTML = contractsymbol
        else
            statecollect[inc].innerHTML = expandsymbol
        inc++
    }
}

function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search)
        if (offset != -1) {
            offset += search.length
            end = document.cookie.indexOf(";", offset);
            if (end == -1) end = document.cookie.length;
            returnvalue = unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}

function getselectedItem() {
    if (get_cookie(window.location.pathname) != "") {
        selectedItem = get_cookie(window.location.pathname)
        return selectedItem
    }
    else
        return ""
}

function saveswitchstate() {
    var inc = 0, selectedItem = ""
    while (ccollect[inc]) {
        if (ccollect[inc].style.display == "block")
            selectedItem += ccollect[inc].id + "|"
        inc++
    }

    document.cookie = window.location.pathname + "=" + selectedItem
}

function do_onload() {
    uniqueidn = window.location.pathname + "firsttimeload"
    var alltags = document.all ? document.all : document.getElementsByTagName("*")
    ccollect = getElementbyClass(alltags, "switchcontent")
    statecollect = getElementbyClass(alltags, "showstate")
    if (enablepersist == "on" && ccollect.length > 0) {
        document.cookie = (get_cookie(uniqueidn) == "") ? uniqueidn + "=1" : uniqueidn + "=0"
        firsttimeload = (get_cookie(uniqueidn) == 1) ? 1 : 0 //check if this is 1st page load
        if (!firsttimeload)
            revivecontent()
    }
    if (ccollect.length > 0 && statecollect.length > 0)
        revivestatus()
}

if (window.addEventListener)
    window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
    window.attachEvent("onload", do_onload)
else if (document.getElementById)
    window.onload = do_onload

if (enablepersist == "on" && document.getElementById)
    window.onunload = saveswitchstate

// mm_menu.js

// JScript File

/**
* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright (c) 2000-2002 Macromedia, Inc.
*
* based on menu.js
* by gary smith, July 1997
* Copyright (c) 1997-1999 Netscape Communications Corp.
*
* Netscape grants you a royalty free license to use or modify this
* software provided that this copyright notice appears on all copies.
* This software is provided "AS IS," without a warranty of any kind.
*/
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh, halgn, valgn, pad, space, to, sx, sy, srel, opq, vert, idt, aw, ah) {
    this.version = "020320 [Menu; js.js]";
    this.type = "Menu";
    this.menuWidth = mw;
    this.menuItemHeight = mh;
    this.fontSize = fs;
    this.fontWeight = "plain";
    this.fontFamily = fnt;
    this.fontColor = fclr;
    this.fontColorHilite = fhclr;
    this.bgColor = "#555555";
    this.menuBorder = 1;
    this.menuBgOpaque = opq;
    this.menuItemBorder = 1;
    this.menuItemIndent = idt;
    this.menuItemBgColor = bg;
    this.menuItemVAlign = valgn;
    this.menuItemHAlign = halgn;
    this.menuItemPadding = pad;
    this.menuItemSpacing = space;
    this.menuLiteBgColor = "#ffffff";
    this.menuBorderBgColor = "#777777";
    this.menuHiliteBgColor = bgh;
    this.menuContainerBgColor = "#cccccc";
    this.childMenuIcon = "arrows.gif";
    this.submenuXOffset = sx;
    this.submenuYOffset = sy;
    this.submenuRelativeToItem = srel;
    this.vertical = vert;
    this.items = new Array();
    this.actions = new Array();
    this.childMenus = new Array();
    this.hideOnMouseOut = true;
    this.hideTimeout = to;
    this.addMenuItem = addMenuItem;
    this.writeMenus = writeMenus;
    this.MM_showMenu = MM_showMenu;
    this.onMenuItemOver = onMenuItemOver;
    this.onMenuItemAction = onMenuItemAction;
    this.hideMenu = hideMenu;
    this.hideChildMenu = hideChildMenu;
    if (!window.menus) window.menus = new Array();
    this.label = " " + label;
    window.menus[this.label] = this;
    window.menus[window.menus.length] = this;
    if (!window.activeMenus) window.activeMenus = new Array();
}

function addMenuItem(label, action) {
    this.items[this.items.length] = label;
    this.actions[this.actions.length] = action;
}

function FIND(item) {
    if (window.mmIsOpera) return (document.getElementById(item));
    if (document.all) return (document.all[item]);
    if (document.getElementById) return (document.getElementById(item));
    return (false);
}

function writeMenus(container) {
    if (window.triedToWriteMenus) return;
    var agt = navigator.userAgent.toLowerCase();
    window.mmIsOpera = agt.indexOf("opera") != -1;
    if (!container && document.layers) {
        window.delayWriteMenus = this.writeMenus;
        var timer = setTimeout('delayWriteMenus()', 500);
        container = new Layer(100);
        clearTimeout(timer);
    } else if (document.all || document.hasChildNodes || window.mmIsOpera) {
        document.writeln('<span id="menuContainer"></span>');
        container = FIND("menuContainer");
    }

    window.mmHideMenuTimer = null;
    if (!container) return;
    window.triedToWriteMenus = true;
    container.isContainer = true;
    container.menus = new Array();
    for (var i = 0; i < window.menus.length; i++)
        container.menus[i] = window.menus[i];
    window.menus.length = 0;
    var countMenus = 0;
    var countItems = 0;
    var top = 0;
    var content = '';
    var lrs = false;
    var theStat = "";
    var tsc = 0;
    if (document.layers) lrs = true;
    for (var i = 0; i < container.menus.length; i++, countMenus++) {
        var menu = container.menus[i];
        if (menu.bgImageUp || !menu.menuBgOpaque) {
            menu.menuBorder = 0;
            menu.menuItemBorder = 0;
        }
        if (lrs) {
            var menuLayer = new Layer(100, container);
            var lite = new Layer(100, menuLayer);
            lite.top = menu.menuBorder;
            lite.left = menu.menuBorder;
            var body = new Layer(100, lite);
            body.top = menu.menuBorder;
            body.left = menu.menuBorder;
        } else {
            content += '' +
			'<div id="menuLayer' + countMenus + '" style="position:absolute;z-index:1;left:10px;top:' + (i * 100) + 'px;visibility:hidden;color:' + menu.menuBorderBgColor + ';">\n' +
			'  <div id="menuLite' + countMenus + '" style="position:absolute;z-index:1;left:' + menu.menuBorder + 'px;top:' + menu.menuBorder + 'px;visibility:hide;" onmouseout="mouseoutMenu();">\n' +
			'	 <div id="menuFg' + countMenus + '" style="position:absolute;left:' + menu.menuBorder + 'px;top:' + menu.menuBorder + 'px;visibility:hide;">\n' +
			'';
        }
        var x = i;
        for (var i = 0; i < menu.items.length; i++) {
            var item = menu.items[i];
            var childMenu = false;
            var defaultHeight = menu.fontSize + 2 * menu.menuItemPadding;
            if (item.label) {
                item = item.label;
                childMenu = true;
            }
            menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
            var itemProps = '';
            if (menu.fontFamily != '') itemProps += 'font-family:' + menu.fontFamily + ';';
            itemProps += 'font-weight:' + menu.fontWeight + ';fontSize:' + menu.fontSize + 'px;';
            if (menu.fontStyle) itemProps += 'font-style:' + menu.fontStyle + ';';
            if (document.all || window.mmIsOpera)
                itemProps += 'font-size:' + menu.fontSize + 'px;" onmouseover="onMenuItemOver(null,this);" onclick="onMenuItemAction(null,this);';
            else if (!document.layers) {
                itemProps += 'font-size:' + menu.fontSize + 'px;';
            }
            var l;
            if (lrs) {
                var lw = menu.menuWidth;
                if (menu.menuItemHAlign == 'right') lw -= menu.menuItemPadding;
                l = new Layer(lw, body);
            }
            var itemLeft = 0;
            var itemTop = i * menu.menuItemHeight;
            if (!menu.vertical) {
                itemLeft = i * menu.menuWidth;
                itemTop = 0;
            }
            var dTag = '<div id="menuItem' + countItems + '" style="position:absolute;left:' + itemLeft + 'px;top:' + itemTop + 'px;' + itemProps + '">';
            var dClose = '</div>'
            if (menu.bgImageUp) dTag = '<div id="menuItem' + countItems + '" style="background:url(' + menu.bgImageUp + ');position:absolute;left:' + itemLeft + 'px;top:' + itemTop + 'px;' + itemProps + '">';

            var left = 0, top = 0, right = 0, bottom = 0;
            left = 1 + menu.menuItemPadding + menu.menuItemIndent;
            right = left + menu.menuWidth - 2 * menu.menuItemPadding - menu.menuItemIndent;
            if (menu.menuItemVAlign == 'top') top = menu.menuItemPadding;
            if (menu.menuItemVAlign == 'bottom') top = menu.menuItemHeight - menu.fontSize - 1 - menu.menuItemPadding;
            if (menu.menuItemVAlign == 'middle') top = ((menu.menuItemHeight / 2) - (menu.fontSize / 2) - 1);
            bottom = menu.menuItemHeight - 2 * menu.menuItemPadding;
            var textProps = 'position:absolute;left:' + left + 'px;top:' + top + 'px;';
            if (lrs) {
                textProps += itemProps + 'right:' + right + ';bottom:' + bottom + ';';
                dTag = "";
                dClose = "";
            }

            if (document.all && !window.mmIsOpera) {
                item = '<div align="' + menu.menuItemHAlign + '">' + item + '</div>';
            } else if (lrs) {
                item = '<div style="text-align:' + menu.menuItemHAlign + ';">' + item + '</div>';
            } else {
                var hitem = null;
                if (menu.menuItemHAlign != 'left') {
                    if (window.mmIsOpera) {
                        var operaWidth = menu.menuItemHAlign == 'center' ? -(menu.menuWidth - 2 * menu.menuItemPadding) : (menu.menuWidth - 6 * menu.menuItemPadding);
                        hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:'
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
                        item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:' + menu.menuItemPadding + 'px;width:' + operaWidth + 'px;text-align:'
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
                    } else {
                        hitem = '<div id="menuItemHilite' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left + menu.menuWidth - 3 * menu.menuItemPadding) + 'px;text-align:'
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
                        item = '<div id="menuItemText' + countItems + 'Shim" style="position:absolute;top:1px;left:1px;right:-' + (left + menu.menuWidth - 3 * menu.menuItemPadding) + 'px;text-align:'
							+ menu.menuItemHAlign + ';visibility:visible;">' + item + '</div>';
                    }
                } else hitem = null;
            }
            if (document.all && !window.mmIsOpera) item = '<div id="menuItemShim' + countItems + '" style="position:absolute;left:0px;top:0px;">' + item + '</div>';
            var dText = '<div id="menuItemText' + countItems + '" style="' + textProps + 'color:' + menu.fontColor + ';">' + item + '&nbsp</div>\n'
						+ '<div id="menuItemHilite' + countItems + '" style="' + textProps + 'color:' + menu.fontColorHilite + ';visibility:hidden;">'
						+ (hitem || item) + '&nbsp</div>';
            if (childMenu) content += (dTag + dText + '<div id="childMenu' + countItems + '" style="position:absolute;left:0px;top:3px;"><img src="' + menu.childMenuIcon + '"></div>\n' + dClose);
            else content += (dTag + dText + dClose);
            if (lrs) {
                l.document.open("text/html");
                l.document.writeln(content);
                l.document.close();
                content = '';
                theStat += "-";
                tsc++;
                if (tsc > 50) {
                    tsc = 0;
                    theStat = "";
                }
                status = theStat;
            }
            countItems++;
        }
        if (lrs) {
            var focusItem = new Layer(100, body);
            focusItem.visiblity = "hidden";
            focusItem.document.open("text/html");
            focusItem.document.writeln("&nbsp;");
            focusItem.document.close();
        } else {
            content += '	  <div id="focusItem' + countMenus + '" style="position:absolute;left:0px;top:0px;visibility:hide;" onclick="onMenuItemAction(null,this);">&nbsp;</div>\n';
            content += '   </div>\n  </div>\n</div>\n';
        }
        i = x;
    }
    if (document.layers) {
        container.clip.width = window.innerWidth;
        container.clip.height = window.innerHeight;
        container.onmouseout = mouseoutMenu;
        container.menuContainerBgColor = this.menuContainerBgColor;
        for (var i = 0; i < container.document.layers.length; i++) {
            proto = container.menus[i];
            var menu = container.document.layers[i];
            container.menus[i].menuLayer = menu;
            container.menus[i].menuLayer.Menu = container.menus[i];
            container.menus[i].menuLayer.Menu.container = container;
            var body = menu.document.layers[0].document.layers[0];
            body.clip.width = proto.menuWidth || body.clip.width;
            body.clip.height = proto.menuHeight || body.clip.height;
            for (var n = 0; n < body.document.layers.length - 1; n++) {
                var l = body.document.layers[n];
                l.Menu = container.menus[i];
                l.menuHiliteBgColor = proto.menuHiliteBgColor;
                l.document.bgColor = proto.menuItemBgColor;
                l.saveColor = proto.menuItemBgColor;
                l.onmouseover = proto.onMenuItemOver;
                l.onclick = proto.onMenuItemAction;
                l.mmaction = container.menus[i].actions[n];
                l.focusItem = body.document.layers[body.document.layers.length - 1];
                l.clip.width = proto.menuWidth || body.clip.width;
                l.clip.height = proto.menuItemHeight || l.clip.height;
                if (n > 0) {
                    if (l.Menu.vertical) l.top = body.document.layers[n - 1].top + body.document.layers[n - 1].clip.height + proto.menuItemBorder + proto.menuItemSpacing;
                    else l.left = body.document.layers[n - 1].left + body.document.layers[n - 1].clip.width + proto.menuItemBorder + proto.menuItemSpacing;
                }
                l.hilite = l.document.layers[1];
                if (proto.bgImageUp) l.background.src = proto.bgImageUp;
                l.document.layers[1].isHilite = true;
                if (l.document.layers.length > 2) {
                    l.childMenu = container.menus[i].items[n].menuLayer;
                    l.document.layers[2].left = l.clip.width - 13;
                    l.document.layers[2].top = (l.clip.height / 2) - 4;
                    l.document.layers[2].clip.left += 3;
                    l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
                }
            }
            if (proto.menuBgOpaque) body.document.bgColor = proto.bgColor;
            if (proto.vertical) {
                body.clip.width = l.clip.width + proto.menuBorder;
                body.clip.height = l.top + l.clip.height + proto.menuBorder;
            } else {
                body.clip.height = l.clip.height + proto.menuBorder;
                body.clip.width = l.left + l.clip.width + proto.menuBorder;
                if (body.clip.width > window.innerWidth) body.clip.width = window.innerWidth;
            }
            var focusItem = body.document.layers[n];
            focusItem.clip.width = body.clip.width;
            focusItem.Menu = l.Menu;
            focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onMenuItemDown;
            if (proto.menuBgOpaque) menu.document.bgColor = proto.menuBorderBgColor;
            var lite = menu.document.layers[0];
            if (proto.menuBgOpaque) lite.document.bgColor = proto.menuLiteBgColor;
            lite.clip.width = body.clip.width + 1;
            lite.clip.height = body.clip.height + 1;
            menu.clip.width = body.clip.width + (proto.menuBorder * 3);
            menu.clip.height = body.clip.height + (proto.menuBorder * 3);
        }
    } else {
        if ((!document.all) && (container.hasChildNodes) && !window.mmIsOpera) {
            container.innerHTML = content;
        } else {
            container.document.open("text/html");
            container.document.writeln(content);
            container.document.close();
        }
        if (!FIND("menuLayer0")) return;
        var menuCount = 0;
        for (var x = 0; x < container.menus.length; x++) {
            var menuLayer = FIND("menuLayer" + x);
            container.menus[x].menuLayer = "menuLayer" + x;
            menuLayer.Menu = container.menus[x];
            menuLayer.Menu.container = "menuLayer" + x;
            menuLayer.style.zindex = 1;
            var s = menuLayer.style;
            s.pixeltop = -300;
            s.pixelleft = -300;
            s.top = '-300px';
            s.left = '-300px';

            var menu = container.menus[x];
            menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
            if (menu.menuBgOpaque) menuLayer.style.backgroundColor = menu.menuBorderBgColor;
            var top = 0;
            var left = 0;
            menu.menuItemLayers = new Array();
            for (var i = 0; i < container.menus[x].items.length; i++) {
                var l = FIND("menuItem" + menuCount);
                l.Menu = container.menus[x];
                l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
                if (l.addEventListener || window.mmIsOpera) {
                    l.style.width = menu.menuItemWidth + 'px';
                    l.style.height = menu.menuItemHeight + 'px';
                    l.style.pixelWidth = menu.menuItemWidth;
                    l.style.pixelHeight = menu.menuItemHeight;
                    l.style.top = top + 'px';
                    l.style.left = left + 'px';
                    if (l.addEventListener) {
                        l.addEventListener("mouseover", onMenuItemOver, false);
                        l.addEventListener("click", onMenuItemAction, false);
                        l.addEventListener("mouseout", mouseoutMenu, false);
                    }
                    if (menu.menuItemHAlign != 'left') {
                        l.hiliteShim = FIND("menuItemHilite" + menuCount + "Shim");
                        l.hiliteShim.style.visibility = "inherit";
                        l.textShim = FIND("menuItemText" + menuCount + "Shim");
                        l.hiliteShim.style.pixelWidth = menu.menuItemWidth - 2 * menu.menuItemPadding - menu.menuItemIndent;
                        l.hiliteShim.style.width = l.hiliteShim.style.pixelWidth;
                        l.textShim.style.pixelWidth = menu.menuItemWidth - 2 * menu.menuItemPadding - menu.menuItemIndent;
                        l.textShim.style.width = l.textShim.style.pixelWidth;
                    }
                } else {
                    l.style.pixelWidth = menu.menuItemWidth;
                    l.style.pixelHeight = menu.menuItemHeight;
                    l.style.pixelTop = top;
                    l.style.pixelLeft = left;
                    if (menu.menuItemHAlign != 'left') {
                        var shim = FIND("menuItemShim" + menuCount);
                        shim[0].style.pixelWidth = menu.menuItemWidth - 2 * menu.menuItemPadding - menu.menuItemIndent;
                        shim[1].style.pixelWidth = menu.menuItemWidth - 2 * menu.menuItemPadding - menu.menuItemIndent;
                        shim[0].style.width = shim[0].style.pixelWidth + 'px';
                        shim[1].style.width = shim[1].style.pixelWidth + 'px';
                    }
                }
                if (menu.vertical) top = top + menu.menuItemHeight + menu.menuItemBorder + menu.menuItemSpacing;
                else left = left + menu.menuItemWidth + menu.menuItemBorder + menu.menuItemSpacing;
                l.style.fontSize = menu.fontSize + 'px';
                l.style.backgroundColor = menu.menuItemBgColor;
                l.style.visibility = "inherit";
                l.saveColor = menu.menuItemBgColor;
                l.menuHiliteBgColor = menu.menuHiliteBgColor;
                l.mmaction = container.menus[x].actions[i];
                l.hilite = FIND("menuItemHilite" + menuCount);
                l.focusItem = FIND("focusItem" + x);
                l.focusItem.style.pixelTop = -30;
                l.focusItem.style.top = '-30px';
                var childItem = FIND("childMenu" + menuCount);
                if (childItem) {
                    l.childMenu = container.menus[x].items[i].menuLayer;
                    childItem.style.pixelLeft = menu.menuItemWidth - 11;
                    childItem.style.left = childItem.style.pixelLeft + 'px';
                    childItem.style.pixelTop = (menu.menuItemHeight / 2) - 4;
                    childItem.style.top = childItem.style.pixelTop + 'px';
                    l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
                }
                l.style.cursor = "hand";
                menuCount++;
            }
            if (menu.vertical) {
                menu.menuHeight = top - 1 - menu.menuItemSpacing;
                menu.menuWidth = menu.menuItemWidth;
            } else {
                menu.menuHeight = menu.menuItemHeight;
                menu.menuWidth = left - 1 - menu.menuItemSpacing;
            }

            var lite = FIND("menuLite" + x);
            var s = lite.style;
            s.pixelHeight = menu.menuHeight + (menu.menuBorder * 2);
            s.height = s.pixelHeight + 'px';
            s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2);
            s.width = s.pixelWidth + 'px';
            if (menu.menuBgOpaque) s.backgroundColor = menu.menuLiteBgColor;

            var body = FIND("menuFg" + x);
            s = body.style;
            s.pixelHeight = menu.menuHeight + menu.menuBorder;
            s.height = s.pixelHeight + 'px';
            s.pixelWidth = menu.menuWidth + menu.menuBorder;
            s.width = s.pixelWidth + 'px';
            if (menu.menuBgOpaque) s.backgroundColor = menu.bgColor;

            s = menuLayer.style;
            s.pixelWidth = menu.menuWidth + (menu.menuBorder * 4);
            s.width = s.pixelWidth + 'px';
            s.pixelHeight = menu.menuHeight + (menu.menuBorder * 4);
            s.height = s.pixelHeight + 'px';
        }
    }
    if (document.captureEvents) document.captureEvents(Event.MOUSEUP);
    if (document.addEventListener) document.addEventListener("mouseup", onMenuItemOver, false);
    if (document.layers && window.innerWidth) {
        window.onresize = NS4resize;
        window.NS4sIW = window.innerWidth;
        window.NS4sIH = window.innerHeight;
        setTimeout("NS4resize()", 500);
    }
    document.onmouseup = mouseupMenu;
    window.mmWroteMenu = true;
    status = "";
}

function NS4resize() {
    if (NS4sIW != window.innerWidth || NS4sIH != window.innerHeight) window.location.reload();
}

function onMenuItemOver(e, l) {
    MM_clearTimeout();
    l = l || this;
    var a = window.ActiveMenuItem;
    if (document.layers) {
        if (a) {
            a.document.bgColor = a.saveColor;
            if (a.hilite) a.hilite.visibility = "hidden";
            if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
            a.focusItem.top = -100;
            a.clicked = false;
        }
        if (l.hilite) {
            l.document.bgColor = l.menuHiliteBgColor;
            l.zIndex = 1;
            l.hilite.visibility = "inherit";
            l.hilite.zIndex = 2;
            l.document.layers[1].zIndex = 1;
            l.focusItem.zIndex = this.zIndex + 2;
        }
        if (l.Menu.bgImageOver) l.background.src = l.Menu.bgImageOver;
        l.focusItem.top = this.top;
        l.focusItem.left = this.left;
        l.focusItem.clip.width = l.clip.width;
        l.focusItem.clip.height = l.clip.height;
        l.Menu.hideChildMenu(l);
    } else if (l.style && l.Menu) {
        if (a) {
            a.style.backgroundColor = a.saveColor;
            if (a.hilite) a.hilite.style.visibility = "hidden";
            if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
            if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp + ")"; ;
        }
        l.style.backgroundColor = l.menuHiliteBgColor;
        l.zIndex = 1;
        if (l.Menu.bgImageOver) l.style.background = "url(" + l.Menu.bgImageOver + ")";
        if (l.hilite) {
            l.hilite.style.visibility = "inherit";
            if (l.hiliteShim) l.hiliteShim.style.visibility = "visible";
        }
        l.focusItem.style.pixelTop = l.style.pixelTop;
        l.focusItem.style.top = l.focusItem.style.pixelTop + 'px';
        l.focusItem.style.pixelLeft = l.style.pixelLeft;
        l.focusItem.style.left = l.focusItem.style.pixelLeft + 'px';
        l.focusItem.style.zIndex = l.zIndex + 1;
        l.Menu.hideChildMenu(l);
    } else return;
    window.ActiveMenuItem = l;
}

function onMenuItemAction(e, l) {
    l = window.ActiveMenuItem;
    if (!l) return;
    hideActiveMenus();
    if (l.mmaction) eval("" + l.mmaction);
    window.ActiveMenuItem = 0;
}

function MM_clearTimeout() {
    if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
    mmHideMenuTimer = null;
    mmDHFlag = false;
}

function MM_startTimeout() {
    if (window.ActiveMenu) {
        mmStart = new Date();
        mmDHFlag = true;
        mmHideMenuTimer = setTimeout("mmDoHide()", window.ActiveMenu.Menu.hideTimeout);
    }
}

function mmDoHide() {
    if (!mmDHFlag || !window.ActiveMenu) return;
    var elapsed = new Date() - mmStart;
    var timeout = window.ActiveMenu.Menu.hideTimeout;
    if (elapsed < timeout) {
        mmHideMenuTimer = setTimeout("mmDoHide()", timeout + 100 - elapsed);
        return;
    }
    mmDHFlag = false;
    hideActiveMenus();
    window.ActiveMenuItem = 0;
}

function MM_showMenu(menu, x, y, child, imgname) {
    if (!window.mmWroteMenu) return;
    MM_clearTimeout();
    if (menu) {
        var obj = FIND(imgname) || document.images[imgname] || document.links[imgname] || document.anchors[imgname];
        x = moveXbySlicePos(x, obj);
        y = moveYbySlicePos(y, obj);
    }
    if (document.layers) {
        if (menu) {
            var l = menu.menuLayer || menu;
            l.top = l.left = 1;
            hideActiveMenus();
            if (this.visibility) l = this;
            window.ActiveMenu = l;
        } else {
            var l = child;
        }
        if (!l) return;
        for (var i = 0; i < l.layers.length; i++) {
            if (!l.layers[i].isHilite) l.layers[i].visibility = "inherit";
            if (l.layers[i].document.layers.length > 0) MM_showMenu(null, "relative", "relative", l.layers[i]);
        }
        if (l.parentLayer) {
            if (x != "relative") l.parentLayer.left = x || window.pageX || 0;
            if (l.parentLayer.left + l.clip.width > window.innerWidth) l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
            if (y != "relative") l.parentLayer.top = y || window.pageY || 0;
            if (l.parentLayer.isContainer) {
                l.Menu.xOffset = window.pageXOffset;
                l.Menu.yOffset = window.pageYOffset;
                l.parentLayer.clip.width = window.ActiveMenu.clip.width + 2;
                l.parentLayer.clip.height = window.ActiveMenu.clip.height + 2;
                if (l.parentLayer.menuContainerBgColor && l.Menu.menuBgOpaque) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
            }
        }
        l.visibility = "inherit";
        if (l.Menu) l.Menu.container.visibility = "inherit";
    } else if (FIND("menuItem0")) {
        var l = menu.menuLayer || menu;
        hideActiveMenus();
        if (typeof (l) == "string") l = FIND(l);
        window.ActiveMenu = l;
        var s = l.style;
        s.visibility = "inherit";
        if (x != "relative") {
            s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
            s.left = s.pixelLeft + 'px';
        }
        if (y != "relative") {
            s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
            s.top = s.pixelTop + 'px';
        }
        l.Menu.xOffset = document.body.scrollLeft;
        l.Menu.yOffset = document.body.scrollTop;
    }
    if (menu) window.activeMenus[window.activeMenus.length] = l;
    MM_clearTimeout();
}

function onMenuItemDown(e, l) {
    var a = window.ActiveMenuItem;
    if (document.layers && a) {
        a.eX = e.pageX;
        a.eY = e.pageY;
        a.clicked = true;
    }
}

function mouseupMenu(e) {
    hideMenu(true, e);
    hideActiveMenus();
    return true;
}

function getExplorerVersion() {
    var ieVers = parseFloat(navigator.appVersion);
    if (navigator.appName != 'Microsoft Internet Explorer') return ieVers;
    var tempVers = navigator.appVersion;
    var i = tempVers.indexOf('MSIE ');
    if (i >= 0) {
        tempVers = tempVers.substring(i + 5);
        ieVers = parseFloat(tempVers);
    }
    return ieVers;
}

function mouseoutMenu() {
    if ((navigator.appName == "Microsoft Internet Explorer") && (getExplorerVersion() < 4.5))
        return true;
    hideMenu(false, false);
    return true;
}

function hideMenu(mouseup, e) {
    var a = window.ActiveMenuItem;
    if (a && document.layers) {
        a.document.bgColor = a.saveColor;
        a.focusItem.top = -30;
        if (a.hilite) a.hilite.visibility = "hidden";
        if (mouseup && a.mmaction && a.clicked && window.ActiveMenu) {
            if (a.eX <= e.pageX + 15 && a.eX >= e.pageX - 15 && a.eY <= e.pageY + 10 && a.eY >= e.pageY - 10) {
                setTimeout('window.ActiveMenu.Menu.onMenuItemAction();', 500);
            }
        }
        a.clicked = false;
        if (a.Menu.bgImageOver) a.background.src = a.Menu.bgImageUp;
    } else if (window.ActiveMenu && FIND("menuItem0")) {
        if (a) {
            a.style.backgroundColor = a.saveColor;
            if (a.hilite) a.hilite.style.visibility = "hidden";
            if (a.hiliteShim) a.hiliteShim.style.visibility = "inherit";
            if (a.Menu.bgImageUp) a.style.background = "url(" + a.Menu.bgImageUp + ")";
        }
    }
    if (!mouseup && window.ActiveMenu) {
        if (window.ActiveMenu.Menu) {
            if (window.ActiveMenu.Menu.hideOnMouseOut) MM_startTimeout();
            return (true);
        }
    }
    return (true);
}

function hideChildMenu(hcmLayer) {
    MM_clearTimeout();
    var l = hcmLayer;
    for (var i = 0; i < l.Menu.childMenus.length; i++) {
        var theLayer = l.Menu.childMenus[i];
        if (document.layers) theLayer.visibility = "hidden";
        else {
            theLayer = FIND(theLayer);
            theLayer.style.visibility = "hidden";
            if (theLayer.Menu.menuItemHAlign != 'left') {
                for (var j = 0; j < theLayer.Menu.menuItemLayers.length; j++) {
                    var itemLayer = theLayer.Menu.menuItemLayers[j];
                    if (itemLayer.textShim) itemLayer.textShim.style.visibility = "inherit";
                }
            }
        }
        theLayer.Menu.hideChildMenu(theLayer);
    }
    if (l.childMenu) {
        var childMenu = l.childMenu;
        if (document.layers) {
            l.Menu.MM_showMenu(null, null, null, childMenu.layers[0]);
            childMenu.zIndex = l.parentLayer.zIndex + 1;
            childMenu.top = l.Menu.menuLayer.top + l.Menu.submenuYOffset;
            if (l.Menu.vertical) {
                if (l.Menu.submenuRelativeToItem) childMenu.top += l.top + l.parentLayer.top;
                childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2 * l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
            } else {
                childMenu.top += l.top + l.parentLayer.top;
                if (l.Menu.submenuRelativeToItem) childMenu.left = l.Menu.menuLayer.left + l.left + l.clip.width + (2 * l.Menu.menuBorder) + l.Menu.submenuXOffset;
                else childMenu.left = l.parentLayer.left + l.parentLayer.clip.width - (2 * l.Menu.menuBorder) + l.Menu.menuLayer.left + l.Menu.submenuXOffset;
            }
            if (childMenu.left < l.Menu.container.clip.left) l.Menu.container.clip.left = childMenu.left;
            var w = childMenu.clip.width + childMenu.left - l.Menu.container.clip.left;
            if (w > l.Menu.container.clip.width) l.Menu.container.clip.width = w;
            var h = childMenu.clip.height + childMenu.top - l.Menu.container.clip.top;
            if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
            l.document.layers[1].zIndex = 0;
            childMenu.visibility = "inherit";
        } else if (FIND("menuItem0")) {
            childMenu = FIND(l.childMenu);
            var menuLayer = FIND(l.Menu.menuLayer);
            var s = childMenu.style;
            s.zIndex = menuLayer.style.zIndex + 1;
            if (document.all || window.mmIsOpera) {
                s.pixelTop = menuLayer.style.pixelTop + l.Menu.submenuYOffset;
                if (l.Menu.vertical) {
                    if (l.Menu.submenuRelativeToItem) s.pixelTop += l.style.pixelTop;
                    s.pixelLeft = l.style.pixelWidth + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
                    s.left = s.pixelLeft + 'px';
                } else {
                    s.pixelTop += l.style.pixelTop;
                    if (l.Menu.submenuRelativeToItem) s.pixelLeft = menuLayer.style.pixelLeft + l.style.pixelLeft + l.style.pixelWidth + (2 * l.Menu.menuBorder) + l.Menu.submenuXOffset;
                    else s.pixelLeft = (menuLayer.style.pixelWidth - 4 * l.Menu.menuBorder) + menuLayer.style.pixelLeft + l.Menu.submenuXOffset;
                    s.left = s.pixelLeft + 'px';
                }
            } else {
                var top = parseInt(menuLayer.style.top) + l.Menu.submenuYOffset;
                var left = 0;
                if (l.Menu.vertical) {
                    if (l.Menu.submenuRelativeToItem) top += parseInt(l.style.top);
                    left = (parseInt(menuLayer.style.width) - 4 * l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
                } else {
                    top += parseInt(l.style.top);
                    if (l.Menu.submenuRelativeToItem) left = parseInt(menuLayer.style.left) + parseInt(l.style.left) + parseInt(l.style.width) + (2 * l.Menu.menuBorder) + l.Menu.submenuXOffset;
                    else left = (parseInt(menuLayer.style.width) - 4 * l.Menu.menuBorder) + parseInt(menuLayer.style.left) + l.Menu.submenuXOffset;
                }
                s.top = top + 'px';
                s.left = left + 'px';
            }
            childMenu.style.visibility = "inherit";
        } else return;
        window.activeMenus[window.activeMenus.length] = childMenu;
    }
}

function hideActiveMenus() {
    if (!window.activeMenus) return;
    for (var i = 0; i < window.activeMenus.length; i++) {
        if (!activeMenus[i]) continue;
        if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
            activeMenus[i].visibility = "hidden";
            activeMenus[i].Menu.container.visibility = "hidden";
            activeMenus[i].Menu.container.clip.left = 0;
        } else if (activeMenus[i].style) {
            var s = activeMenus[i].style;
            s.visibility = "hidden";
            s.left = '-200px';
            s.top = '-200px';
        }
    }
    if (window.ActiveMenuItem) hideMenu(false, false);
    window.activeMenus.length = 0;
}

function moveXbySlicePos(x, img) {
    if (!document.layers) {
        var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
        var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
        var par = img;
        var lastOffset = 0;
        while (par) {
            if (par.leftMargin && !onWindows) x += parseInt(par.leftMargin);
            if ((par.offsetLeft != lastOffset) && par.offsetLeft) x += parseInt(par.offsetLeft);
            if (par.offsetLeft != 0) lastOffset = par.offsetLeft;
            par = macIE45 ? par.parentElement : par.offsetParent;
        }
    } else if (img.x) x += img.x;
    return x;
}

function moveYbySlicePos(y, img) 
{
    if (!document.layers) {
        var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
        var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
        var par = img;
        var lastOffset = 0;
        while (par) {
            if (par.topMargin && !onWindows) y += parseInt(par.topMargin);
            if ((par.offsetTop != lastOffset) && par.offsetTop) y += parseInt(par.offsetTop);
            if (par.offsetTop != 0) lastOffset = par.offsetTop;
            par = macIE45 ? par.parentElement : par.offsetParent;
        }
    } else if (img.y >= 0) y += img.y;
    return y;
}

function MM_preloadImages()
 { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
    }
}

function openBrow(ref) 
{
    url = ref;
    w = 470;
    h = 290;
    x = 250;
    y = 250;
    pos = "dialogHeight: " + h + "px; dialogWidth: " + w + "px; dialogTop: " + x + "px; dialogLeft: " + y + "px; edge: Raised; center: No; resizable: No; status: No;";
    window.showModalDialog(ref, "Dialog Box Arguments # 2", pos);
}

function Load_dropdown() {
    var totalRecords;
    var pageCount;
    var objPageCount;
    var totalPages;
    var cmdPageLimit;
    totalRecords = document.getElementById("totalRecs").value;
    objPageCount = document.getElementById("cmblist");
    pageCount = objPageCount.options[objPageCount.options.selectedIndex].value;
    totalPages = totalRecords / pageCount;
    totalPages = Math.ceil(totalPages);
    cmdPageLimit = document.getElementById("cmblimit");
    var i;
    for (i = cmdPageLimit.options.length - 1; i >= 0; i--) {
        cmdPageLimit.remove(i);
    }
    for (i = 1; i <= totalPages; i++) {
        addOption(document.getElementById("cmblimit"), i, "Page " + i + " of " + totalPages, "");
    }
}

   function show(src)
   {
       try{
           var cmd =document.getElementById(src);
           var c = cmd.src.indexOf('plus');
           if( c == -1){cmd.src="images/plus.gif";}
                else{cmd.src="images/minus.gif";}
        }catch(e){}
   }
   
  function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }  
   

function addOption(selectbox, value, text) {
    var optn = document.createElement("OPTION");
    optn.text = text;
    optn.value = value;
    selectbox.options.add(optn);
}


// NoIEActivate.js

//ediy v2
n = navigator.userAgent;
w = n.indexOf("MSIE");
if ((w > 0) && (parseInt(n.charAt(w + 5)) > 5)) {
    T = ["object", "embed", "applet"];
    for (j = 0; j < 3; j++) {
        E = document.getElementsByTagName(T[j]);
        for (i = 0; i < E.length; i++) {
            P = E[i].parentNode;
            H = P.innerHTML;
            P.removeChild(E[i]);
            P.innerHTML = H;
        }
    }
}

// JavaScript Document


function mousemove(idd, srcc) {
    idd.src = srcc;
}

function ssHide(RowId,ImgId)
	{
		if(navigator.appName.indexOf('Microsoft') == 0 )
		{
		    //For IE Browser
		    if ((document.getElementById(RowId).style.display =="") || (document.getElementById(RowId).style.display =="none")) 
	            {
			    document.getElementById(RowId).style.display ="block";
			    document.getElementById(ImgId).src='images/nav-tab.gif';	
		    }
		    else
		    {
			    document.getElementById(RowId).style.display ="none";
			    document.getElementById(ImgId).src='images/nav-tab01.gif';	
		    }
		}
		else
		{
		    
		    if ((document.getElementById(RowId).style.display =="") || (document.getElementById(RowId).style.display =="none")) 
		    {   
			    document.getElementById(RowId).style.display = "table-row";
				document.getElementById(ImgId).src='images/nav-tab.gif';	
		    }
		    else{
			    document.getElementById(RowId).style.display = "none";
			    document.getElementById(ImgId).src='images/nav-tab01.gif';	
		    }
		}
	}
	
	
function Show(divname)
{
        document.getElementById("news").className="VisibleFalse";
        document.getElementById("event").className="VisibleFalse";
        document.getElementById("about").className="VisibleFalse";
        document.getElementById(divname).className="VisibleTrue";
        
        document.getElementById("newsDiv").className="DeActivated";
        document.getElementById("eventDiv").className="DeActivated";
        document.getElementById("aboutDiv").className="DeActivated";
        document.getElementById(divname+"Div").className="Activated";
        
        document.getElementById("newsHref").className="DeActivated";
        document.getElementById("eventHref").className="DeActivated";
        document.getElementById("aboutHref").className="DeActivated";
        document.getElementById(divname+"Href").className="Activated";  
}

// JScript File

//======================================================================================

// Validate only characters

function TextOnly(e)
{
    var Keycode =e.keyCode;
    if((Keycode >64 && Keycode <91)||(Keycode >96 && Keycode <123)||(Keycode ==8)||(Keycode ==32)) 
    {
                e.returnValue = true;
    }
    else 
                e.returnValue = false;      
}

//======================================================================================

// Validate Alpha Numeric Values

function AlphaNumeric(e)
{
    var key = window.event ? e.keyCode : e.which;
	var Keycode =key;
    if((Keycode >64 && Keycode <91)||(Keycode >96 && Keycode <123)
        ||(Keycode >47 && Keycode <58)||(Keycode ==8)||(Keycode ==45)
        ||(Keycode ==95)||(Keycode==32) || Keycode ==0) 
    {
                e.returnValue = true;
   }
    else
     {
	alert("Invalid Character")
        return false
     }
}

//======================================================================================

//Validate decimal values

function NumericWithDecimal(e)
{
	var Keycode =e.keyCode;
    if((Keycode >47 && Keycode <58)||(Keycode ==8) || (Keycode == 46)) 
    {
                e.returnValue = true;
    }
    else
                e.returnValue = false;
}

//======================================================================================

//Validate only numeric values

function NumericOnly(e)
{
	var Keycode =e.keyCode;
    if((Keycode >47 && Keycode <58)||(Keycode ==8)) 
    {
                e.returnValue = true;
    }
    else
                e.returnValue = false;
}
function isNumberKey(evt)
{
   var charCode = (evt.which) ? evt.which : evt.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
         {
			//alert("Please Enter Only Numbers!!!!");
            return false;            
         }
         else
         {
             return true;
         }         
}

//======================================================================================

 function OnlyCharactersWithAmbersand(e)
{
var key = window.event ? e.keyCode : e.which;
			var Keycode =key;
            if((Keycode >64 && Keycode <91)||(Keycode >96 && Keycode <123)||(Keycode ==8)||(Keycode ==32)
                ||(Keycode ==38)||(Keycode ==45)||(Keycode ==95)|| Keycode ==0 ||(Keycode ==127) ) 
            {
                        e.returnValue = true;
            }
             else
     {
	alert("Invalid Character")
        return false
     }
}
/****************************************************************************************************************/
//***********************************************************************************************************
//This accepts Characters,numbers and special characters like & - _ , . 
function ProgramName(e)
{

			var key = window.event ? e.keyCode : e.which;
			var Keycode =key;
            if((Keycode >64 && Keycode <91)||(Keycode >96 && Keycode <123)||
				(Keycode ==8)||(Keycode ==32 ||  
				Keycode ==38 || Keycode ==95 ) 
				|| (Keycode >43 && Keycode <48 )||(Keycode >47 && Keycode <58)) 
            {
                 e.returnValue = true;
            }
            else 
                 e.returnValue = false; 
}

//************************************************************************************************************
function ValidateUserName(e)
{
var key = window.event ? e.keyCode : e.which;

			var Keycode =key;
            if((Keycode >64 && Keycode <91)||(Keycode >96 && Keycode <123)||
				(Keycode ==8 || Keycode ==95 || Keycode ==45) 
				|| (Keycode >47 && Keycode <58 ) || Keycode ==0 || (Keycode ==127)) 
            {
                 e.returnValue = true;
            }
            else 
            {
            alert("Invalid character");
                 return false; 
                 }
}

//******************************************************************************************************************

function checkUrl(theUrl){

  if(theUrl.value.match(/^(http|ftp|https)\:\/\/\w+([\.\-]\w+)*\.\w{2,4}(\:\d+)*([\/\.\-\?\&\%\#]\w+)*\/?$/i) ||
     theUrl.value.match(/^mailto\:\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w{2,4}$/i)){
    return true;
  } else {
    alert("Invalid Website");
    theUrl.select();
    theUrl.focus();
    return false;
  }
}

	   
//******************************************************************************************************************
 function ValidatePhoneNo(e)
  { //numbers,|,/ only

var key = window.event ? e.keyCode : e.which;
			var Keycode =key;
 var Keycode =key;
   if(Keycode==8 || Keycode==9 || Keycode==45|| Keycode==43  || Keycode==46 || Keycode >=48 && Keycode<=57 || Keycode==47 || Keycode==116 || Keycode==32 || Keycode==91 || Keycode==93 || Keycode==45 || Keycode==40 || Keycode==41 || Keycode==20 || Keycode ==0 || (Keycode ==127))
     {
     	  	  
     }
     else
     {
	alert("Invalid Character")
        return false
     }
  }
  
function NumericWithHypen(e)
{
var key = window.event ? e.keyCode : e.which;
			var Keycode =key;
            if((Keycode >47 && Keycode <58)||(Keycode ==8)||(Keycode ==45) || Keycode ==0 || Keycode == 127) 
            {
                        e.returnValue = true;
            }
            else
     {
	alert("Invalid Character")
        return false
     }
}
/****************************************************************************************************************/
function DontEnter(e)
{
        e.returnValue = false; chkMaxValueAndCalculate
}

//******************************************************************************************************************	   
function chkMaxValueAndCalculate(txtbox1,value,strtxtbox2,txtResult)
{
    var val1 = txtbox1.value;
    var val2 = document.getElementById(strtxtbox2).value;
    
    if(val1 > value)
    {    
        alert("Value Should be Lessthan or EqualTo " + value); 
        txtbox1.value="";
        txtbox1.focus();
        document.getElementById(txtResult).value = "";  
        return false;      
    }    
    else
    {
     var res = (parseFloat(val1) + parseFloat(val2)) * parseFloat(0.0);
     document.getElementById(txtResult).value = Math.round(res * 100)/100;     
     return true;
    }    
}
//******************************************************************************************************************
function chkMaxValue(txtbox1,value)
{
    var val1 = txtbox1.value;  
    
    if(val1 > value)
    {    
        alert("Value Should be Lessthan or EqualTo " + value); 
        txtbox1.value="";
        txtbox1.focus();
        return false;
    }     
}

//*****************************************************/

// Move and Remove the selected value(s) from One Listbox to another Listbox
function fnMoveItems(lstbxFrom,lstbxTo)
{
 var varFromBox = document.getElementById(lstbxFrom);
 var varToBox = document.getElementById(lstbxTo); 
 if ((varFromBox != null) && (varToBox != null)) 
 { 
  if(varFromBox.length < 1) 
  {
   alert('There are no items in the source ListBox');
   return false;
  }
  if(varFromBox.options.selectedIndex == -1) // when no Item is selected the index will be -1
  {
   alert('Please select an Item to move');
   return false;
  }
  while ( varFromBox.options.selectedIndex >= 0 ) 
  { 
   var newOption = new Option(); // Create a new instance of ListItem 

   newOption.text = varFromBox.options[varFromBox.options.selectedIndex].text; 
   newOption.value = varFromBox.options[varFromBox.options.selectedIndex].value; 
   varToBox.options[varToBox.length] = newOption; //Append the item in Target Listbox

   varFromBox.remove(varFromBox.options.selectedIndex); //Remove the item from Source Listbox 

  } 
 }
 return false; 
}
/*******************************************************************************/
// Listbox Double click Event for Unselect Listbox selected item
function lstDblClicked(LstBx) 
{
    var varlstbx=document.getElementById(LstBx);    
    if(varlstbx!=null)
    {
    for (i=0;i<varlstbx.length;i++)
     {
        if(varlstbx.options[i].selected) // check the Listbox selectd item
        {
        varlstbx.options[i].selected=false; // Unselect the Listbox selected value
        }
    }
    
    //return false;
    }
}

function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}
/**
 * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */
// Declaring valid date character, minimum year and maximum year
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function CheckIsValidate(txtBoxName)
{
    var ReturnValue=true;
    var txtBox;
    txtBox=document.getElementById(txtBoxName);
    txtBoxValue=trim(txtBox.value);
    if (txtBoxValue.length>0)
    {
        if (isDate(txtBoxValue)==false)
        {
            txtBox.focus();
            ReturnValue=false;
        }
    }
    return ReturnValue;
}



