// JScript source code

function printContent()
{
    var newWin = window.open("printContent.asp","","left=10,top=10,width=784,height=500,scrollbars=yes,resizable=yes");
}
/*
<!--
function printContent()
{
    var styleSheet = "";
    styleSheet += "<" + "style type=text/css>";
    styleSheet += "body";
    styleSheet += "{";
    styleSheet += "     margin-top: 0px;";
    styleSheet += "     margin-left: 0px;";
    styleSheet += "     margin-right: 0px;";
    styleSheet += "     margin-bottom: 0px;";
    styleSheet += "     background-position:0 0;";
    styleSheet += "}";
    styleSheet += "A";
    styleSheet += "{";
    styleSheet += "     color:#007c85;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-decoration:none;";	
    styleSheet += "}";
    styleSheet += "A:HOVER";
    styleSheet += "{";
    styleSheet += "     color:#8a8a89;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-decoration:underline;";
    styleSheet += "}";
    styleSheet += ".contentHeader";
    styleSheet += "{";
    styleSheet += "     width: 100%;";
    styleSheet += "     height: 1px;";
    styleSheet += "}";
    styleSheet += ".contentLeft";
    styleSheet += "{";
    styleSheet += "     padding-top:20px;";
    styleSheet += "     width: 220px;";
    styleSheet += "     height: 579px;";
    styleSheet += "     background-image: url(images/content_left.jpg);";
    styleSheet += "     background-repeat: no-repeat;";
    styleSheet += "     vertical-align:top;";
    styleSheet += "     text-align:right;";
    styleSheet += "     background-color: #FCFBEC;";
    styleSheet += "}";
    styleSheet += ".contentMiddle";
    styleSheet += "{";
    styleSheet += "     width:100%;";
    styleSheet += "     height: 579px;";
    styleSheet += "     background-repeat: no-repeat;";
    styleSheet += "     vertical-align:top;";
    styleSheet += "}";
    styleSheet += ".contentRight";
    styleSheet += "{";
    styleSheet += "     width: 184px;";
    styleSheet += "     height: 579px;";
    styleSheet += "     background-image: url(images/content_right.jpg);";
    styleSheet += "     background-repeat: no-repeat;";
    styleSheet += "     vertical-align:bottom;";
    styleSheet += "     text-align:center;";
    styleSheet += "}";
    styleSheet += ".contentBottom";
    styleSheet += "{";
    styleSheet += "     padding: 0px;";
    styleSheet += "     background-color: #FCFBEC;";
    styleSheet += "     width: 990px;";
    styleSheet += "     height: 65px;";
    styleSheet += "     padding-bottom:15px;";
    styleSheet += "}";
    styleSheet += ".contentFooterHref";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "     color: #000000;";
    styleSheet += "}";
    styleSheet += ".contentFooterHref:HOVER";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: underline;";
    styleSheet += "     color: #007C84;";
    styleSheet += "}";
    styleSheet += ".copyText2";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "     color: #000000;";
    styleSheet += "}";
    styleSheet += ".leftNavDiv";
    styleSheet += "{";
    styleSheet += "     padding-right:70px;";
    styleSheet += "     width:150px;";
    styleSheet += "     height:300px;";
    styleSheet += "     vertical-align:top;";
    styleSheet += "}";
    styleSheet += ".contentTable";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     color: #000000;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "	    border-style: none;";
    styleSheet += "     margin: 0px;";
    styleSheet += "     width: 720px;";
    styleSheet += "     border-collapse: collapse;";
    styleSheet += "     border-spacing: 0px;";
    styleSheet += "     empty-cells: show;";
    styleSheet += "}";
    styleSheet += ".spacerTD";
    styleSheet += "{";
    styleSheet += "     height:0px;";
    styleSheet += "}";
    styleSheet += ".headerTD";
    styleSheet += "{";
    styleSheet += "     vertical-align:middle;";
    styleSheet += "     padding-left:15px;";
    styleSheet += "     display:none;";
    styleSheet += "}";
    styleSheet += ".contentTD";
    styleSheet += "{";
    styleSheet += "     background-color:#ffffff;";
    styleSheet += "     height:480px;";
    styleSheet += "     width:100%;";
    styleSheet += "}";
    styleSheet += ".contentDiv";
    styleSheet += "{";
    styleSheet += "     height: 480px;";
    styleSheet += "     padding: 0px 15px 15px 15px;";
    styleSheet += "     margin-top: 15px;";
    styleSheet += "     width:100%;";
    styleSheet += "}";
    styleSheet += ".titleFont1";
    styleSheet += "{";
    styleSheet += "     color:#DBC701;";
    styleSheet += "     font-family: 'times New Roman' , Times, serif;";
    styleSheet += "     font-size: 28px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";	
    styleSheet += "}";
    styleSheet += ".titleFont2";
    styleSheet += "{";
    styleSheet += "     color: #ffffff;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 16px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "}";
    styleSheet += ".titleFont3";
    styleSheet += "{";
    styleSheet += "     color: #007C85;";
    styleSheet += "     font-family: Georgia;";
    styleSheet += "     font-size: 28px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";	
    styleSheet += "}";
    styleSheet += ".tocLink";
    styleSheet += "{";
    styleSheet += "     line-height:150%;";
    styleSheet += "     color:#007C85;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 16px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "}";
    styleSheet += ".tocLink:HOVER";
    styleSheet += "{";
    styleSheet += "     line-height:150%;";
    styleSheet += "     color:#8A8A89;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 16px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: underline;";
    styleSheet += "}";
    styleSheet += ".tocInstructions";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";	
    styleSheet += "     color:#a49a00;";
    styleSheet += "     margin-bottom:10px;";
    styleSheet += "}";
    styleSheet += ".orangeHeader";
    styleSheet += "{";
    styleSheet += "     color:#B3740D;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";	
    styleSheet += "}";
    styleSheet += ".grayText";
    styleSheet += "{";
    styleSheet += "     color:#8a8a89;";
    styleSheet += "}";
    styleSheet += ".aquaText";
    styleSheet += "{";
    styleSheet += "     color:#007c85;";
    styleSheet += "}";
    styleSheet += ".mustardText";
    styleSheet += "{";
    styleSheet += "     color:#a49a00;";
    styleSheet += "}";
    styleSheet += ".yellowText";
    styleSheet += "{";
    styleSheet += "     color:#dbc701;";
    styleSheet += "}";
    styleSheet += ".tanText";
    styleSheet += "{";
    styleSheet += "     color:#d2ca7f;";
    styleSheet += "}";
    styleSheet += ".brownText";
    styleSheet += "{";
    styleSheet += "     color:#b3740d;";
    styleSheet += "}";
    styleSheet += ".defaultLink";
    styleSheet += "{";
    styleSheet += "     color:#007c85;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-decoration:none;";	
    styleSheet += "}";
    styleSheet += ".defaultLink:HOVER";
    styleSheet += "{";
    styleSheet += "     color:#8a8a89;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-decoration:underline;";
    styleSheet += "}";
    styleSheet += ".yellowHeader2";
    styleSheet += "{";
    styleSheet += "     color: #DAC701;";
    styleSheet += "     font-family: 'times New Roman' , Times, serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";	
    styleSheet += "}";
    styleSheet += ".orangeHeader2";
    styleSheet += "{";
    styleSheet += "     color: #B3740D;";
    styleSheet += "     font-family: 'times New Roman' , Times, serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "}";
    styleSheet += ".aquaHeader2";
    styleSheet += "{";
    styleSheet += "     color: #007C85;";
    styleSheet += "     font-family: Georgia;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";	
    styleSheet += "}";
    styleSheet += ".aquaHeader3";
    styleSheet += "{";
    styleSheet += "     color: #007C85;";
    styleSheet += "     font-family:Arial;";
    styleSheet += "     font-size: 18px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant:normal;";
    styleSheet += "     text-transform:none;";
    styleSheet += "     text-decoration: none;";	
    styleSheet += "}";
    styleSheet += ".printButton";
    styleSheet += "{";
    styleSheet += "     font-family: Georgia;";
    styleSheet += "     font-size: 18px;";
    styleSheet += "     font-weight: bold;";
    styleSheet += "     font-style: italic;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     color: #007c85;";
    styleSheet += "     background-color: #d2ca7f;";
    styleSheet += "     border: 1px solid #007c85;";
    styleSheet += "     cursor: hand;";
    styleSheet += "}";
    styleSheet += ".printHref";
    styleSheet += "{";
    styleSheet += "     display: none;";
    styleSheet += "}";
    styleSheet += ".noPrint";
    styleSheet += "{";
    styleSheet += "     display: none;";
    styleSheet += "}";
    styleSheet += ".borderTD";
    styleSheet += "{";
    styleSheet += "     padding: 2px;";
    styleSheet += "     border-top: 2px solid #000000;";
    styleSheet += "     border-bottom: 2px solid #000000;";
    styleSheet += "     border-right: 2px solid #000000;";
    styleSheet += "     border-left: 2px solid #000000;";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 14px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     color: #000000;";
    styleSheet += "     vertical-align:top;";
    styleSheet += "}";
    styleSheet += ".borderTable";
    styleSheet += "{";
    styleSheet += "     table-layout: auto;";
    styleSheet += "     border-collapse: collapse;";
    styleSheet += "     border-spacing: 0px;";
    styleSheet += "     empty-cells: show;";
    styleSheet += "     border: 2px solid #000000;";
    styleSheet += "     width:98%;";
    styleSheet += "}";
    styleSheet += ".footerTD";
    styleSheet += "{";
    styleSheet += "     font-family: arial, Helvetica, sans-serif;";
    styleSheet += "     font-size: 12px;";
    styleSheet += "     font-weight: normal;";
    styleSheet += "     font-style: normal;";
    styleSheet += "     font-variant: normal;";
    styleSheet += "     text-transform: none;";
    styleSheet += "     text-decoration: none;";
    styleSheet += "     color: #8A8A89;";
    styleSheet += "}";
    styleSheet += "<" + "/style>";


    var printContent = document.getElementById("printTD");
    var printWindow = window.open('', '', 'left=50000,top=50000,width=0,height=0');
    var newHTML = styleSheet;
    newHTML += "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr><td style='background-color:#F7F3C6'><img src='images/printTitle.jpg' /></td>";
    newHTML += "</tr><tr><td class='footerTD' align='center'><br />P.O. Box 3093 Redwood City CA 94064&nbsp;&nbsp;~&nbsp;&nbsp;877-576-1102 (toll free)"
    newHTML += "&nbsp;&nbsp;~&nbsp;&nbsp;www.SizeDiversityandHealth.org<br /><br /></td></tr></table>";
    printWindow.document.write(newHTML + printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    //printWindow.close();
 
}
// -->
*/
//TRIM FUNCTION
String.prototype.trim = function() {
a = this.replace(/^\s+/, '');
return a.replace(/\s+$/, '');
};

//CURRENCY
//-- JavaScript code written by Alan Simpson - www.coolnerds.com
function currency(anynum) {
   //-- Returns passed number as string in $xxx,xxx.xx format.
   anynum=eval(anynum)
   workNum=Math.abs((Math.round(anynum*100)/100));workStr=""+workNum
   if (workStr.indexOf(".")==-1){workStr+=".00"}
   dStr=workStr.substr(0,workStr.indexOf("."));dNum=dStr-0
   pStr=workStr.substr(workStr.indexOf("."))
   while (pStr.length<3){pStr+="0"}

   //--- Adds comma in thousands place.
   if (dNum>=1000) {
      dLen=dStr.length
      dStr=parseInt(""+(dNum/1000))+","+dStr.substring(dLen-3,dLen)
   }

   //-- Adds comma in millions place.
   if (dNum>=1000000) {
      dLen=dStr.length
      dStr=parseInt(""+(dNum/1000000))+","+dStr.substring(dLen-7,dLen)
   }
   retval = dStr + pStr 
   //-- Put numbers in parentheses if negative.
   if (anynum<0) {retval="("+retval+")"}
   return "$"+retval
}

//DATE CHECKER
function isDate(dateStr) 
{
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
	var matchArray = dateStr.match(datePat); // is the format ok?
	
	if (matchArray == null) 
	{
		return false;
	}

	month = matchArray[1]; // p@rse date into variables
	day = matchArray[3];
	year = matchArray[5];

	if (month < 1 || month > 12) 
	{ // check month range
		return false;
	}

	if (day < 1 || day > 31) 
	{
		return false;
	}

	if ((month==4 || month==6 || month==9 || month==11) && day==31) 
	{
		return false;
	}

	if (month == 2) 
	{ // check for february 29th
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day > 29 || (day==29 && !isleap)) 
		{
			return false;
		}
	}
return true; // date is valid
}

function isPhone(phone)
{
    return true;
    var phoneStr = "0123456789-ext";
    var rtn = true;
    for(i=0;i<phone.length;i++)
    {
        if(phoneStr.indexOf(phone.charAt(i))==-1);
        {
            rtn = false;
        } 
    }   
    return rtn;  
}

function isZip(zip)
{
    return true;
    var zipStr = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- ";
    var rtn = true;
    for(i=0;i<zip.length;i++)
    {
        if(zipStr.indexOf(zip.charAt(i))==-1);
        {
            rtn = false;
        } 
    } 
    return rtn;    
}

//GENERIC VALIDATION
function genericValidation(frmID)
{
	//REGULAR EXPRESSIONS
	var regExpEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	var regExpZip = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
	var regExpPhone =  /^\(\d{3}\) \d{3}-\d{4}$/;
	var regExpState = /\D{2}/;	
	var regExpFnameLname = /\D+\,\D+/;
	var regExpAdmin = /[^a-z\d]/i;
	var regExpURL = /^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(\/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$/;
    //var regExpPhone = /^((\+\d{1,3}( )?\(?\d\)?(-)?\d{1,5})|(\(?\d{2,6}\)?))(-)?(\d{3,4})(-)?(\d{4})(( x| ext )\d{1,5}){0,1}$/
	//var regExpPhone = /^(\(?\d{3}\)?[-]\d{3}[-]\d{4})|(\+\d{1,4}[-]\d{2,4}[-]\d{3,4}[-]\d{3,4}|(\+\d{1,4}[-]\d{2,4}[-]\d{3,4}[-]\d{3,4}( x| ext )\d{1,5}))$/
	//var regExpPhone = /^\+\d{2}[-]\d{2,4}\([-]\d{3,4}\){2}/
	//var regExpPhone =/\/+\/{1}\d{1,4}-\d{3}-\d{3}-\d{4}( x| ext )\d{1,5}$/;
	//var regExpPhone = /\d/;
	//var regExpIntlZip = /(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXYabcdefghijklmnpqrstuvwxyz ]{1}\d{1}[ABCEGHJKLMNPRSTVXYabcdefghijklmnpqrstuvwxyz ]{1} *\d{1}[ABCEGHJKLMNPRSTVXYabcdefghijklmnpqrstuvwxyz ]{1}\d{1}$)|(^\d{4})/;
	
	var frm = document.getElementById(frmID);
	var frmLen = document.getElementById(frmID).elements.length;
	var msg = "";
	var thisID = "";
	var msg1 = "";
	var msg2 = "";
	var rtn = true;
	var tempID = "";
	for(x=frmLen-1;x>-1;x--)
	{
		tempID = frm.elements[x].id;
		if(tempID!="")
		{
			msg1 = document.getElementById(tempID).getAttribute("message1");
			msg2 = document.getElementById(tempID).getAttribute("message2"); 
			if(msg1!="" && msg1!=undefined && frm.elements[x].value.trim()=="")
			{
				msg = document.getElementById(tempID).getAttribute("message1");
				thisID = tempID;
				rtn = false;		
			}

			if(msg2!="" && msg2!=undefined && msg2!="undefined")
			{	
				var thisType = document.getElementById(tempID).getAttribute("thisType"); 
				switch(thisType)
				{
				/*
					case "intlPhone":
						if((isPhone(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
						
					case "intlZip":
						if((isZip(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;		*/									
				
					case "phone":
						if(!(regExpPhone.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
										
					case "url":
						if(!(regExpURL.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
										
					case "integerChk":
						if((isNaN(frm.elements[x].value.trim()) || Math.floor(frm.elements[x].value)>9999) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;
										
					case "number":
						if(isNaN(frm.elements[x].value.trim()) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;
					
					case "date":
						if(!(isDate(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
					
					case "email":
						if(!(regExpEmail.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
						
					/*
					case "intlZip":
						if(!(regExpIntlZip.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	*/							
					/*
					case "zip":
						if(!(regExpZip.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;		
						*/
							
					case "state":
						if(!(regExpState.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;	
					
					case "lnamefname":
						if(!(regExpFnameLname.test(frm.elements[x].value.trim())) && frm.elements[x].value.trim()!="")	
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;		
					
					case "admin":
						if((regExpAdmin.test(frm.elements[x].value.trim()) || frm.elements[x].value.length>10 || frm.elements[x].value<4) && frm.elements[x].value.trim()!="")	
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = tempID;
							rtn = false;	
						}
						break;
					
					case "hidden":
						if(frm.elements[x].value.trim()=="")	
						{
							msg = document.getElementById(tempID).getAttribute("message2"); 
							thisID = frm.elements[x].focusID;		
							rtn = false;	
						}					
				}
				
			}
		}	
	}
	return (msg+"|"+rtn+"|"+thisID);
}

//FILE UPLOAD
function fileUpload(id,thisType)
{
	var uniqueID = new Date();
	uniqueID = uniqueID.getMonth().toString() + uniqueID.getDate().toString() + uniqueID.getFullYear().toString() + uniqueID.getMinutes().toString() + uniqueID.getSeconds().toString() + uniqueID.getMilliseconds().toString();
	var params = "left=10,top=10,width=350,height=125,resizable=yes,scrollbars=no,status=yes";
	var newUrl = "fileUpload.aspx?id="+id+"&thisType="+thisType;//+"&uniqueID="+uniqueID;
	window.open(newUrl,"UPLOAD",params);
}

//REFORMAT DATE
function reformatDate(val,id)
{
	var regExpDate = /\d{1,}[-/\\]\d{1,}[-/\\]\d{2,}/;
	if(regExpDate.test(val))
	{
		var newDate = new Date(val);
		var y = newDate.getFullYear();
		if(y<2000)
		{
			y = y + 100;
		}
		var d = newDate.getDate().toString();
		if(d.length<2)
		{
			d = "0" + d;
		}
		var m = (newDate.getMonth()+1).toString();
		if(m.length<2)
		{
			m = "0" + m;
		}
		newDate = m + "/" + d + "/" + y;
		document.getElementById(id).value=newDate;
	}
}

//REPLACE COMMAS
function replaceCommas(elName,id)
{
	var frm = document.getElementById(id);
	var tempVal = "";
	
	for(x=0;x<frm.length;x++)
	{
		if(frm.elements[x].name==elName)
		{
			tempVal = frm.elements[x].value;
			while(tempVal.indexOf(",")!=-1)
			{
				tempVal = tempVal.replace(",","^")
			}
			frm.elements[x].value = tempVal;
		}
	}
}

//REMOVE PERIODS
function removePeriods(elName,id)
{
	var frm = document.getElementById(id);
	var tempVal = "";
	
	for(x=0;x<frm.length;x++)
	{
		if(frm.elements[x].name==elName)
		{
			tempVal = frm.elements[x].value;
			while(tempVal.indexOf(".")!=-1)
			{
				tempVal = tempVal.replace(".","")
			}
			frm.elements[x].value = tempVal;
		}
	}
}

//DELETE CHECK
function deleteChk(id)
{
	var frm = document.getElementById(id);
	var chk = true;
	for(x=0;x<frm.length;x++)
	{
		if(frm.elements[x].name=="del" && frm.elements[x].checked)
		{
			chk = false;
		}
	}	
	return (chk);
}

//PSEUDO COMBO BOX
function chkComboBox(id,val,hdnID)
{
	if(val.trim()!="")
	{
		document.getElementById(id).value="";
	}	
	document.getElementById(hdnID).value=val;
}

//SHOW OR HIDE TOC FRAME
function toc()
{
    var curWidth = parent.document.getElementById('mainFrameset').cols;
    if(curWidth=="200,*")
    {
        parent.document.getElementById('mainFrameset').cols = "1,*";
        document.getElementById('tocHref').innerHTML = "Show Table of Contents";
    }
    else
    {
        parent.document.getElementById('mainFrameset').cols = "200,*";
        document.getElementById('tocHref').innerHTML = "Hide Table of Contents";
    } 
}

//CHECK CONFIRMATION FIELDS
function confirmVals(id1,id2)
{
    chk = true;
    if(document.getElementById(id1).value.toLowerCase()!=document.getElementById(id2).value.toLowerCase())
    {
        chk = false;
    }
    return chk;
}

//ADD OPTION
function addOptionPrompt(selectboxID,msg)
{
	var newOption = prompt(msg,"");
	if(newOption!="")
	{
		var selectbox = document.getElementById(selectboxID); 
		addOption(selectbox,newOption,newOption);
		selectbox.selectedIndex = selectbox.length - 1;
	}
}
function addOption(selectbox,text,value)
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	selectbox.options.add(optn);
}

function showHide(el1,el2,showLink,msg1,msg2)
{
    if(document.getElementById(el2).style.display=="none")
    {
        document.getElementById(el2).style.display="table-row";
        document.getElementById(el1).style.display="none";
        document.getElementById(showLink).innerHTML=msg1;
    }
    else
    {
        document.getElementById(el2).style.display="none";
        document.getElementById(el1).style.display="table-row";
        document.getElementById(showLink).innerHTML=msg2;    
    }
}

//MAXLENGTH OF TEXTAREAS
function TextMaxLength(evt, field, maxLen)
{
    maxLen = new Number(maxLen);
	charCode = new Number(evt.keyCode);
	if (field.length > maxLen && charCode!=8)
	{
		alert("You have reached the maximum amount of text allowed.")
		return false;
	}
}
