
//------from consumer side
var browser
	function getBrowserName(){
		ver=(navigator.appVersion).substring(0,1)
		return ((navigator.appName).indexOf("Explorer")==-1?"N":"E")
		}
	function focusPField(){
		browser=getBrowserName()
		document.interest.p.focus()
		}

//for testing purposes only
function setInitialValues(){
	/*theForm=document.forms.interest
	theForm.p.value=13000
	theForm.r.value=5.75
	theForm.t.value=30
	theForm.skd.checked="checked"*/
	}

	function round2(nbr,digits){
		nbr=nbr.toString()
		if (nbr.indexOf('.')==-1){
			int_part=nbr
			decimal_part=""
			}
		else{
			int_part=nbr.substring(0,nbr.indexOf('.'))
			decimal_part=nbr.substring(1+nbr.indexOf('.'),2+nbr.indexOf('.')+digits)
			}
		while(decimal_part.length<digits+1)
			decimal_part+="0"
		if (Number(decimal_part.charAt(decimal_part.length-1)<5))
			decimal_part=decimal_part.substring(0,digits)
		else{
			decimal_part=(Number(decimal_part)+10).toString()
			if (decimal_part.length>digits+1){
				int_part=(Number(int_part)+1).toString()
				decimal_part=decimal_part.substring(1,digits+1)
				}
			decimal_part=decimal_part.substring(0,digits)
			}
		if (int_part=="")
			int_part=0;
		if (Number(digits)>0)
			return int_part+'.'+decimal_part
		else
			return int_part
		}
	function getKeyCode(e){
		if (browser=="N")
			chr=e.which
		else chr=e.keyCode
      if ((chr<48 || chr>57) &&chr!=58 && chr!=0 && chr!=46 & chr!=8)
                return false
        return true
        }

	function isValid(theForm){
		if (theForm.p.value<=0){
			alert("Pricipal value should be a number >0")
			theForm.p.focus();
			return false;
			}
		if (theForm.r.value<=0){
			alert("Interest rate value should be >0")
			theForm.r.focus();
			return false;
			}
		if (theForm.add.value<0){
			alert("Additional principal should be a number > 0")
			theForm.add.focus();
			return false;
			}
		compute(theForm.p.value,theForm.r.value,theForm.t.value,
		theForm.add.value,theForm.skd.checked)
		}
	function getYearsMonths(mon){
		var months, years
		years=Math.floor(mon/12)
		months=mon-(years*12)
		if (months==0)
			months=null
		else if (months==1)
			months="1 month"
		else months=months+" months"

		if (years==0)
			years =null
		else if (years==1)
			years="1 year"
		else years=years+" years"
		if (years==null)
			return months
		else if (months==null)
			return years
		else return years+" and "+months
		}
	function compute(p,r,t,add,skd){
		amFactor=getAmFactor(p,r,t)
		monthlyPayment=Number(add)+p/amFactor
		howLong(p,r,t,monthlyPayment,add,skd)
		}

	function getAmFactor(p,r,t){
		numerator=1-Math.pow(1+r/1200,-1*t*12)
		denominator=r/1200
		return numerator/denominator
		}

	function howLong(p,r,t,monthlyPayment,add,skd){
		html2="<center><table width=65% cols=5 cellpadding=2 border=1 align='center'>"+
			"<tr><th colspan=5>Schedule of Payments</th></tr>"
		html2+="<tr><th>Month #<th>Beginning Principal<th>Monthly Payment"+
			"<th>Interest Payment<th>Ending Principal</tr>"
		var months=0
		monthlyRate=r/1200
		pr=p
		mp=monthlyPayment
		ttlmp=0
		ttlip=0
		while (Number(pr)>0){
			html2+="<tr><td align='right'>"+(months+1)+"<td align='right'>"+round2(pr,2)
			ip=pr*monthlyRate
			pr=Math.abs(pr)+ip
			if (pr>monthlyPayment*1.20)
				pr=pr-mp
			else{
				mp=pr
				pr=0
				}
			ttlip+=ip
			ttlmp+=mp
			html2+="<td align='right'>"+round2(mp,2)+"<td align='right'>"+
					round2(ip,2)+"<td align='right'>"+round2(pr,2)+"</tr>"
			months++
			}
		html2+="<tr><td><b><td>Totals</td><td  align='right'>"+round2(ttlmp,2)+
			"<td align='right'>"+round2(ttlip,2)+"</table>"
		html="<p><table width=65% cellpadding=2 border=1 align='center'>"+
			  "<tr><th colspan='3'>Summary of Payments</th></tr>"+
				"<tr><td>Principal<td>$"+round2(p,2)
		html+="<tr><td>Interest rate<td>"+r+"%"
		html+="<tr><td>Original Term<td>"+t+" years ("+t*12+" months)"
		html+="<tr><td>Monthly principal and interest payment <td>$"+
			round2((monthlyPayment-add),2)
		html+="<tr><td>Additional monthly payment<td>$"+round2(add,2)
		html+="<tr><td>Total monthly payment<td>$"+round2(monthlyPayment,2)
		html+="<tr><td>Number of years to pay off <td>"+getYearsMonths(months)+
			  "</table></p>"
		if (skd)
			html+="<br>"+html2
		unhide()
		write_result("result",html)
		}
	function changeColor(str){
		if (str.style.backgroundColor=="red")
			str.style.backgroundColor="black"
		else str.style.backgroundColor="red"
		}

	function hide(){
		document.getElementById('result').style.visibility="hidden"
		}
	function unhide(){
		document.getElementById('result').style.visibility="visible"
		}

	function write_result(id,the_result){
		d=document;
		re=d.all?d.all[id]:d.getElementById(id);
		re.innerHTML=the_result
	}
//-------end of mort calc
function agreeCheck(form){
if (form.agreeTerms.checked) return true
else
 {alert('You must agree to the terms before submission.')
  return false
 }
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      LoginValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function LoginValid() {

	if (isWhitespace(document.myform.MAccountName.value)) 
	{
	     alert("Please enter Account Name  ");
	     document.myform.MAccountName.focus();
	     return false;
	}  

	if (document.myform.MAccountName.value.length < 3) 
	{
	     alert("The Minimum length for Account Name should be 3 !");
	     document.myform.MAccountName.focus();
	     return false;
	 }

	if (isWhitespace(document.myform.MAccountPassword.value)) 
	{
	     alert("Please enter  Account Password ");
	     document.myform.MAccountPassword.focus();
	     return false;
	}  
	 if (document.myform.MAccountPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 !");
	     document.myform.MAccountPassword.focus();
	     return false;
	 }
	 return true;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidExhibitors      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidExhibitors() {
	if (isWhitespace(document.myform.ExCompany.value)) 
	{
	     alert("Please enter Company! ");
	     document.myform.ExCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExContactName.value)) 
	{
	     alert("Please enter Contact Name! ");
	     document.myform.ExContactName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExAddress.value)) 
	{
	     alert("Please enter Address! ");
	     document.myform.ExAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExCity.value)) 
	{
	     alert("Please enter City! ");
	     document.myform.ExCity.focus();
	     return false;
	}  	
	if ( (document.myform.ExStateID.options[document.myform.ExStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State!");
			document.myform.ExStateID.focus();
			return false;
	}
	if (isWhitespace(document.myform.ExZip.value)) 
	{
	     alert("Please enter Zip! ");
	     document.myform.ExZip.focus();
	     return false;
	}  	
	if (document.myform.ExZip.value.length>0){ 
	 if (validateZIP(document.myform.ExZip)==false) {
				document.myform.ExZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.ExPhone.value)) 
	{
	     alert("Please enter Phone! ");
	     document.myform.ExPhone.focus();
	     return false;
	}  	
	if (document.myform.ExPhone.value.length>0){ 
	if (IsPhone(document.myform.ExPhone.value)==false) {
			document.myform.ExPhone.focus();
			return false;
	}
	}	
//	if (isWhitespace(document.myform.ExFax.value)) 
//	{
//	     alert("Please enter Fax! ");
//	     document.myform.ExFax.focus();
//	     return false;
//	}  	
	if (document.myform.ExFax.value.length>0){ 
	if (IsFax(document.myform.ExFax.value)==false) {
			document.myform.ExFax.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.ExEmail.value)) 
	{
	     alert("Please enter Email! ");
	     document.myform.ExEmail.focus();
	     return false;
	}  	
	
	if (document.myform.ExEmail.value.length>0){ 
	document.myform.ExEmail.value = NonSpace(document.myform.ExEmail.value);
	if (isEmail(document.myform.ExEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.ExEmail.focus();
			return false;
	}
	}
	if (isNumber1(document.myform.ExBoothNr.value)==false) {
		document.myform.ExBoothNr.focus();
		return false;
	}
	if ((document.myform.ExBoothNr.value=="0" ||document.myform.ExBoothNr.value=='' ))   { 
			alert("Please type how many  booths you want! ");
			return false;
   }	
	if (document.myform.ExDinnerNr.value.length>0){ 
		if (isNumber1(document.myform.ExDinnerNr.value)==false) {
			document.myform.ExDinnerNr.focus();
			return false;
		}
	}


	if ((document.myform.ExBoothNr.value>0) ) { 
		if (isInt(document.myform.ExBoothNr.value)==true){document.myform.ExStaffNr.value =2*parseInt(document.myform.ExBoothNr.value); }
	}

	if (document.myform.agree.checked==false){
			alert("You must agree to continue! ");
			document.myform.agree.focus();
			return false;
	}

	var xx=0;x1=0;x2=0;x3=0;x4=0;x5=0;x6=0;
	document.myform.ExBoothSum.value=document.myform.ExBoothNr.value*document.myform.Fee.value;

	if (isInt(document.myform.ExBoothSum.value)==true){x2=parseInt(document.myform.ExBoothSum.value)};
	if (isInt(document.myform.ExDinSum.value)==true){x3=parseInt(document.myform.ExDinSum.value)};
	if (isInt(document.myform.ExStaffSum.value)==true){x4=parseInt(document.myform.ExStaffSum.value)};
	if (isInt(document.myform.ExAttSum.value)==true){x5=parseInt(document.myform.ExAttSum.value)};
	if (isInt(document.myform.ExSatSum.value)==true){x6=parseInt(document.myform.ExSatSum.value)};
	

	xx = x1+x2+x3+x4+x5+x6;

	document.myform.totalAmount.value=xx;

	document.myform.sCMD.value = "upd";
	return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CalculTotal()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CalculTotal() {

	if (document.myform.agree.checked==false){
			alert("You must agree to continue! ");
			document.myform.agree.focus();
			return false;
	}

	var xx=0;x1=0;x2=0;x3=0;x4=0;x5=0;x6=0;
	document.myform.ExBoothSum.value=document.myform.ExBoothNr.value*document.myform.Fee.value;

	if (isInt(document.myform.ExBoothSum.value)==true){x2=parseInt(document.myform.ExBoothSum.value)};
	if (isInt(document.myform.ExDinSum.value)==true){x3=parseInt(document.myform.ExDinSum.value)};
	if (isInt(document.myform.ExStaffSum.value)==true){x4=parseInt(document.myform.ExStaffSum.value)};
	if (isInt(document.myform.ExAttSum.value)==true){x5=parseInt(document.myform.ExAttSum.value)};
	if (isInt(document.myform.ExSatSum.value)==true){x6=parseInt(document.myform.ExSatSum.value)};
	
	
	xx = x1+x2+x3+x4+x5+x6;

	document.myform.totalAmount.value=xx;

	if (xx > 0) {
		if (confirm("Total amount is:  " +xx +'!  Do you want to Continue?  '))
			{
				return false;
			}
			else {return false;}
	}
return false;
}



function ValidNum(thefield) {

	if (isNumber1(thefield.value)==false) {
		thefield.focus();
		return false;
	}
	if (thefield.value>2) { 
			alert("The  maximum number is 2! ");
			thefield.focus();
			return false;
	}	
return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidStaff()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidStaff() {

	for (counter = 0;  counter < document.myformStaff.NMFullName.length; counter++){
	
	
//	if (isWhitespace(document.myformStaff.NMZip[counter].value)) {
//	     alert("Please enter Zip! ");
//	     document.myformStaff.NMZip[counter].focus();
//	     return false;	}  
	
		if (document.myformStaff.NMZip[counter].value.length>0) {
			 if (validateZIP(document.myformStaff.NMZip[counter])==false) {
						document.myformStaff.NMZip[counter].focus();
						return false;
			} 
		}  
	
	}	

	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidRegis      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidRegis() {

	if (isWhitespace(document.myform.ExCompany.value)) 
	{
	     alert("Please enter  Company ");
	     document.myform.ExCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExContactName.value)) 
	{
	     alert("Please enter Contact Name ");
	     document.myform.ExContactName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExAddress.value)) 
	{
	     alert("Please enter  Address ");
	     document.myform.ExAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExCity.value)) 
	{
	     alert("Please enter City ");
	     document.myform.ExCity.focus();
	     return false;
	}  	
	if ( (document.myform.ExStateID.options[document.myform.ExStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State");
			document.myform.ExStateID.focus();
			return false;
	}
	if (isWhitespace(document.myform.ExZip.value)) 
	{
	     alert("Please enter Zip ");
	     document.myform.ExZip.focus();
	     return false;
	}  	
	if (document.myform.ExZip.value.length>0){ 
	 if (validateZIP(document.myform.ExZip)==false) {
				document.myform.ExZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.ExPhone.value)) 
	{
	     alert("Please enter Phone ");
	     document.myform.ExPhone.focus();
	     return false;
	}  	
	if (document.myform.ExPhone.value.length>0){ 
	if (IsPhone(document.myform.ExPhone.value)==false) {
			document.myform.ExPhone.focus();
			return false;
	}
	}	
//	if (isWhitespace(document.myform.ExFax.value)) 
//	{
//	     alert("Please enter Fax! ");
//	     document.myform.ExFax.focus();
//	     return false;
//	}  	
	if (document.myform.ExFax.value.length>0){ 
	if (IsFax(document.myform.ExFax.value)==false) {
			document.myform.ExFax.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.ExEmail.value)) 
	{
	     alert("Please enter Email ");
	     document.myform.ExEmail.focus();
	     return false;
	}  	
	
	if (document.myform.ExEmail.value.length>0){ 
	document.myform.ExEmail.value = NonSpace(document.myform.ExEmail.value);
	if (isEmail(document.myform.ExEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.ExEmail.focus();
			return false;
	}
	}
	if ( (document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value)=="0")
	{
			alert("Please select your registration type");
			document.myform.ExRegID.focus();
			return false;
	}
	


	if (document.myform.ExSpouseAtt[0].checked){
		if (isWhitespace(document.myform.ExSpouse.value)) 	{
		     alert("Please enter Spouse Name! ");
		     document.myform.ExSpouse.focus();
		     return false;
		}  	
	}

	
	//---check for dinner ticket confirm--	
	
	if (( ((document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "1") ||(document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "2") && ( ((document.myform.ExAttDinnerParty[0].checked)==false) && ((document.myform.ExAttDinnerParty[1].checked)==false)))
	{
		alert("Please RSVP for the Dinner Party");
		return false;
	}
   	if (( ((document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "1") ||(document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "2") && ( ((document.myform.ExAttLunchParty[0].checked)==false) && ((document.myform.ExAttLunchParty[1].checked)==false)))
	{
		alert("Please RSVP for the Welcome Lunch");
		return false;
	}
	
		if (( ((document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "1") ||(document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "2") && (document.myform.ExhibRegSpouseFee.value!= 0) &&( ((document.myform.ExAttDinnerPartySpouse[0].checked)==false) && ((document.myform.ExAttDinnerPartySpouse[1].checked)==false)))
	{
		alert("Please RSVP for the Spouse/Guest Dinner Party");
		return false;
	}
   	if (( ((document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "1") ||(document.myform.ExRegID.options[document.myform.ExRegID.options.selectedIndex].value) == "2") && (document.myform.ExhibRegSpouseFee.value!= 0) && ( ((document.myform.ExAttLunchPartySpouse[0].checked)==false) && ((document.myform.ExAttLunchPartySpouse[1].checked)==false)))
	{
		alert("Please RSVP for the Spouse/Guest Welcome Lunch");
		return false;
	}
	
//--end check for dinner ticket confirm# 	
	
	
	if (document.myform.ExSpouseAtt[0].checked){document.myform.ExhibRegSpouseFee.value= document.myform.Spouse.value;}
	if (document.myform.ExSpouseAtt[1].checked){document.myform.ExhibRegSpouseFee.value= 0;}
	
	if (document.myform.ExDinnerNr.value.length>0){ 
		if (isNumber1(document.myform.ExDinnerNr.value)==false) {
			document.myform.ExDinnerNr.focus();
			return false;
		}
	}

	var xx=0;x1=0;x2=0;x3=0;x4=0;x5=0;

	if (document.myform.ExRegID.value>0){ 
		if (document.myform.ExRegID.value=="1") {document.myform.ExRegistration.value= document.myform.ExhibRegMemberFee.value;}
		if (document.myform.ExRegID.value=="2") {document.myform.ExRegistration.value= document.myform.ExhibRegNonMemberFee.value;}
		if (document.myform.ExRegID.value=="3") {document.myform.ExRegistration.value= document.myform.ExhibRegSaturday.value;}
		if (document.myform.ExRegID.value=="5") {document.myform.ExRegistration.value= document.myform.ExhibRegSaturday2.value;}
		if (document.myform.ExRegID.value=="6") {document.myform.ExRegistration.value= document.myform.ExhibRegPersonnel.value;}
		
	}


/*	if (document.myform.ExRegID.value>0){ 
		if  ((document.myform.MCode.value=="2")||(document.myform.ExRegID.value=="1")) { 
			alert("Please enter a valid Registration! ");
			document.myform.ExRegID.focus();
			return false;
		}
	}

	if (document.myform.ExRegID.value>0){ 
		if  ((document.myform.MCode.value=="1")||(document.myform.ExRegID.value=="2")) { 
			alert("Please enter a valid Registration! ");
			document.myform.ExRegID.focus();
			return false;
		}
	}*/


	if (isInt(document.myform.ExRegistration.value)==true){x1=parseInt(document.myform.ExRegistration.value)};
	if (isInt(document.myform.ExhibRegSpouseFee.value)==true){x2=parseInt(document.myform.ExhibRegSpouseFee.value)};
	if (isInt(document.myform.ExDinSum.value)==true){x3=parseInt(document.myform.ExDinSum.value)};


	for (counter = 0;  counter < document.myform.NMFullName.length; counter++){
			if (document.myform.NMFullName[counter].value!=""){
				if (document.myform.NMRegID[counter].value=="0"){
					alert("Please enter Registration! ");
					return false;
				}
			}
	}

	xx = x1+x2+x3;
	for (counter = 0;  counter < document.myform.NMFullName.length; counter++){
			if (isInt(document.myform.NMRegID[counter].value)==true){
				if (document.myform.NMRegID[counter].value=="1") {document.myform.NMSum[counter].value= document.myform.ExhibRegMemberFee.value;}
				if (document.myform.NMRegID[counter].value=="2") {document.myform.NMSum[counter].value= document.myform.ExhibRegNonMemberFee.value;}
				if (document.myform.NMRegID[counter].value=="3") {document.myform.NMSum[counter].value= document.myform.ExhibRegSaturday.value;}
				if (document.myform.NMRegID[counter].value=="5") {document.myform.NMSum[counter].value= document.myform.ExhibRegSaturday2.value;}
				if (document.myform.NMRegID[counter].value=="6") {document.myform.NMSum[counter].value= document.myform.ExhibRegPersonnel.value;}
				x4=parseInt(document.myform.NMSum[counter].value)
				xx = xx +x4;}
	}

	document.myform.totalAmount.value=xx;
	
	if (document.myform.totalAmount.value.length>0){ 
		if (isNumber1(document.myform.totalAmount.value)==false) {
			document.myform.totalAmount.focus();
			return false;
		}
	}

	if (xx > 0) {
		if (confirm("Total amount is:  " +xx +'!  Do you want to Continue?  '))
			{
	document.myform.sCMD.value = "upd";
	return true;
			}
			else {return false;}
	}
	
	document.myform.sCMD.value = "upd";
	return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidGolf      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidGolf() {

	if (isWhitespace(document.myform.ExCompany.value)) 
	{
	     alert("Please enter  Company! ");
	     document.myform.ExCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExContactName.value)) 
	{
	     alert("Please enter Contact Name! ");
	     document.myform.ExContactName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExAddress.value)) 
	{
	     alert("Please enter  Address! ");
	     document.myform.ExAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExCity.value)) 
	{
	     alert("Please enter City! ");
	     document.myform.ExCity.focus();
	     return false;
	}  	
	if ( (document.myform.ExStateID.options[document.myform.ExStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State!");
			document.myform.ExStateID.focus();
			return false;
	}
	if (isWhitespace(document.myform.ExZip.value)) 
	{
	     alert("Please enter Zip! ");
	     document.myform.ExZip.focus();
	     return false;
	}  	
	if (document.myform.ExZip.value.length>0){ 
	 if (validateZIP(document.myform.ExZip)==false) {
				document.myform.ExZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.ExPhone.value)) 
	{
	     alert("Please enter Phone! ");
	     document.myform.ExPhone.focus();
	     return false;
	}  	
	if (document.myform.ExPhone.value.length>0){ 
	if (IsPhone(document.myform.ExPhone.value)==false) {
			document.myform.ExPhone.focus();
			return false;
	}
	}	
//	if (isWhitespace(document.myform.ExFax.value)) 
//	{
//	     alert("Please enter Fax! ");
//	     document.myform.ExFax.focus();
//	     return false;
//	}  	
	if (document.myform.ExFax.value.length>0){ 
	if (IsFax(document.myform.ExFax.value)==false) {
			document.myform.ExFax.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.ExEmail.value)) 
	{
	     alert("Please enter Email! ");
	     document.myform.ExEmail.focus();
	     return false;
	}  	
	
	if (document.myform.ExEmail.value.length>0){ 
	document.myform.ExEmail.value = NonSpace(document.myform.ExEmail.value);
	if (isEmail(document.myform.ExEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.ExEmail.focus();
			return false;
	}
	}

	if (document.myform.totalAmount.value<1) {
		alert("You must make at least a selection!");
	     document.myform.totalAmount.focus();
	     return false;
	}  	
	document.myform.sCMD.value = "upd";
	return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CalculTotalReg()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CalculTotalReg() {
	var xx=0;x1=0;x2=0;x3=0;x4=0;x5=0;

	if (document.myform.ExRegID.value>0){ 
		if (document.myform.ExRegID.value=="1") {document.myform.ExRegistration.value= document.myform.ExhibRegMemberFee.value;}
		if (document.myform.ExRegID.value=="2") {document.myform.ExRegistration.value= document.myform.ExhibRegNonMemberFee.value;}
		if (document.myform.ExRegID.value=="3") {document.myform.ExRegistration.value= document.myform.ExhibRegSaturday.value;}
		if (document.myform.ExRegID.value=="9") {document.myform.ExRegistration.value= document.myform.ExhibRegSaturday2.value;}
		if (document.myform.ExRegID.value=="6") {document.myform.ExRegistration.value= document.myform.ExhibRegPersonnel.value;}
	}


	if (document.myform.ExSpouseAtt[0].checked){document.myform.ExhibRegSpouseFee.value= document.myform.Spouse.value;}
	if (document.myform.ExSpouseAtt[1].checked){document.myform.ExhibRegSpouseFee.value= 0;}
	
	if (isInt(document.myform.ExRegistration.value)==true){x1=parseInt(document.myform.ExRegistration.value)};
	if (isInt(document.myform.ExhibRegSpouseFee.value)==true){x2=parseInt(document.myform.ExhibRegSpouseFee.value)};
	if (isInt(document.myform.ExDinSum.value)==true){x3=parseInt(document.myform.ExDinSum.value)};


	xx = x1+x2+x3;
	for (counter = 0;  counter < document.myform.NMFullName.length; counter++){
			if (isInt(document.myform.NMRegID[counter].value)==true){
				if (document.myform.NMRegID[counter].value=="1") {document.myform.NMSum[counter].value= document.myform.ExhibRegMemberFee.value;}
				if (document.myform.NMRegID[counter].value=="2") {document.myform.NMSum[counter].value= document.myform.ExhibRegNonMemberFee.value;}
				if (document.myform.NMRegID[counter].value=="3") {document.myform.NMSum[counter].value= document.myform.ExhibRegSaturday.value;}
				if (document.myform.NMRegID[counter].value=="9") {document.myform.NMSum[counter].value= document.myform.ExhibRegSaturday2.value;}
				if (document.myform.NMRegID[counter].value=="6") {document.myform.NMSum[counter].value= document.myform.ExhibRegPersonnel.value;}
				x4=parseInt(document.myform.NMSum[counter].value)
				xx = xx +x4;}
	}

	document.myform.totalAmount.value=xx;
	
	if (document.myform.totalAmount.value.length>0){ 
		if (isNumber1(document.myform.totalAmount.value)==false) {
			document.myform.totalAmount.focus();
			return false;
		}
	}

	if (xx > 0) {
		if (confirm("Total amount is:  " +xx +'!  Do you want to Continue?  '))
			{
				return false;
			}
			else {return false;}
	}
	return false;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      SumCourse()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function SumCourse() {
	var x1=0;xx=0;

	if (isInt(document.myform.check.length)==true) {
		for (counter = 0; counter < document.myform.check.length; counter++){
			if (document.myform.check[counter].checked)
				{document.myform.CCSum[counter].value=document.myform.xSumm[counter].value;}
			else 
				{document.myform.CCSum[counter].value=0;}
					xx = xx +parseInt(document.myform.CCSum[counter].value);
			}		
		}
	document.myform.totalAmount.value=xx;
	}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      SumGolf()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function SumGolf() {
	var x1=0;xx=0;

	if (isInt(document.myform.check.length)==true) {
		for (counter = 0; counter < document.myform.check.length; counter++){
			if (document.myform.check[counter].checked)
				{document.myform.CCSum[counter].value=document.myform.xSumm[counter].value;}
			else 
				{document.myform.CCSum[counter].value=0;}
					xx = xx +parseInt(document.myform.CCSum[counter].value);
			}		
		}
	document.myform.totalAmount.value=xx;
	
	if (document.myform.totalAmount.value<1000) {
		document.myform.NMFullName[0].disabled=true;
		document.myform.NMFullName[1].disabled=true;
	}
	if (document.myform.totalAmount.value==1000) {
			document.myform.NMFullName[0].disabled=false;
			document.myform.NMFullName[1].disabled=true;
	}
	if (document.myform.totalAmount.value>1000) {
			document.myform.NMFullName[0].disabled=false;
		document.myform.NMFullName[1].disabled=false;
	}	
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidCourse     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCourse() {

	if (isWhitespace(document.myform.ExCompany.value)) 
	{
	     alert("Please enter  Company! ");
	     document.myform.ExCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExContactName.value)) 
	{
	     alert("Please enter Contact Name! ");
	     document.myform.ExContactName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExAddress.value)) 
	{
	     alert("Please enter  Address! ");
	     document.myform.ExAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ExCity.value)) 
	{
	     alert("Please enter City! ");
	     document.myform.ExCity.focus();
	     return false;
	}  	
	if ( (document.myform.ExStateID.options[document.myform.ExStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State!");
			document.myform.ExStateID.focus();
			return false;
	}
	if (isWhitespace(document.myform.ExZip.value)) 
	{
	     alert("Please enter Zip! ");
	     document.myform.ExZip.focus();
	     return false;
	}  	
	if (document.myform.ExZip.value.length>0){ 
	 if (validateZIP(document.myform.ExZip)==false) {
				document.myform.ExZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.ExPhone.value)) 
	{
	     alert("Please enter Phone! ");
	     document.myform.ExPhone.focus();
	     return false;
	}  	
	if (document.myform.ExPhone.value.length>0){ 
	if (IsPhone(document.myform.ExPhone.value)==false) {
			document.myform.ExPhone.focus();
			return false;
	}
	}	
//	if (isWhitespace(document.myform.ExFax.value)) 
//	{
//	     alert("Please enter Fax! ");
//	     document.myform.ExFax.focus();
//	     return false;
//	}  	
	if (document.myform.ExFax.value.length>0){ 
	if (IsFax(document.myform.ExFax.value)==false) {
			document.myform.ExFax.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.ExEmail.value)) 
	{
	     alert("Please enter Email! ");
	     document.myform.ExEmail.focus();
	     return false;
	}  	
	
	if (document.myform.ExEmail.value.length>0){ 
	document.myform.ExEmail.value = NonSpace(document.myform.ExEmail.value);
	if (isEmail(document.myform.ExEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.ExEmail.focus();
			return false;
	}
	}
	
	
	var x1=0;xx=0;
		
	if (isInt(document.myform.check.length)==true) {
		for (counter = 0; counter < document.myform.check.length; counter++){
			if (document.myform.check[counter].checked){
				document.myform.CCSum[counter].value=document.myform.xSumm[counter].value;
					x1=parseInt(document.myform.CCSum[counter].value)
					xx = xx +x1;
				}
			}		
		}

	document.myform.totalAmount.value=xx;
	if (document.myform.totalAmount.value.length>0){ 
		if (isNumber1(document.myform.totalAmount.value)==false) {
			document.myform.totalAmount.focus();
			return false;
		}
	}

	if (xx > 0) {
		if (confirm("Total amount is:  " +xx +'!  Do you want to Continue?  '))
			{
			document.myform.sCMD.value = "upd";
			return true;
			}
			else {return false;}
	}
	else {
		alert("You must make at least a selection!");
		return false;
	}				
				
	document.myform.sCMD.value = "upd";
	return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CalculTotalCourse()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CalculTotalCourse() {
	
	var x1=0;xx=0;
		
	if (isInt(document.myform.check.length)==true) {
		for (counter = 0; counter < document.myform.check.length; counter++){
			if (document.myform.check[counter].checked){
				document.myform.CCSum[counter].value=document.myform.xSumm[counter].value;
					x1=parseInt(document.myform.CCSum[counter].value)
					xx = xx +x1;
				}
			}		
		}


	document.myform.totalAmount.value=xx;
	
	if (document.myform.totalAmount.value.length>0){ 
		if (isNumber1(document.myform.totalAmount.value)==false) {
			document.myform.totalAmount.focus();
			return false;
		}
	}

	if (xx > 0) {
		if (confirm("Total amount is:  " +xx +'!  Do you want to Continue?  '))
			{
				return false;
			}
			else {return false;}
	}
	return false;
}






//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CalculProg()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CalculProg() {
	var xSum=0;x1=0;

	if (document.myform.check){
		if (isInt(document.myform.check.length)==false) {
			if (document.myform.check.checked){
					if (isInt(document.myform.CPSAmount.value)==true){
							x1=parseInt(document.myform.CPSAmount.value)
							xSum = xSum +x1;
						}
					}
		}
		if (isInt(document.myform.check.length)==true) {
			for (counter = 0;  counter < document.myform.check.length; counter++){
				if (document.myform.check[counter].checked)
					if (isInt(document.myform.CPSAmount[counter].value)==true){
							x1=parseInt(document.myform.CPSAmount[counter].value)
							xSum = xSum +x1;
						}
				}
		}		
	}

	document.myform.totalAmount.value=xSum;

	if (xSum > 0) {
		if (confirm("Total amount is:  " +xSum +'!  Do you want to Continue?  '))
			{
				return false;
			}
			else {return false;}
	}
	return false;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidSponsors      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSponsors() {
	var number = 0;

	if (document.myform.check){
		if (isInt(document.myform.check.length)==false) {
			if (document.myform.check.checked){
						number = number + 1;
					}
		}
	
		if (isInt(document.myform.check.length)==true) {
			for (counter = 0;  counter < document.myform.check.length; counter++){
				if (document.myform.check[counter].checked)
					number = number +1;
				}
		}		
	}

	if (number=="0")
	{
		alert("Please select a Level of Sponsorship.")
		return (false);
	}

	if (isWhitespace(document.myform.SpCompany.value)) 
	{
	     alert("Please enter  Company! ");
	     document.myform.SpCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SpContactName.value)) 
	{
	     alert("Please enter Contact Name! ");
	     document.myform.SpContactName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SpAddress.value)) 
	{
	     alert("Please enter  Address! ");
	     document.myform.SpAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SpCity.value)) 
	{
	     alert("Please enter City! ");
	     document.myform.SpCity.focus();
	     return false;
	}  	
	if ( (document.myform.SpStateID.options[document.myform.SpStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State!");
			document.myform.SpStateID.focus();
			return false;
	}
	if (isWhitespace(document.myform.SpZip.value)) 
	{
	     alert("Please enter Zip! ");
	     document.myform.SpZip.focus();
	     return false;
	}  	
	if (document.myform.SpZip.value.length>0){ 
	 if (validateZIP(document.myform.SpZip)==false) {
				document.myform.SpZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.SpPhone.value)) 
	{
	     alert("Please enter Phone! ");
	     document.myform.SpPhone.focus();
	     return false;
	}  	
	if (document.myform.SpPhone.value.length>0){ 
	if (IsPhone(document.myform.SpPhone.value)==false) {
			document.myform.SpPhone.focus();
			return false;
	}
	}	
//	if (isWhitespace(document.myform.SpFax.value)) 
//	{
//	     alert("Please enter Fax! ");
//	     document.myform.SpFax.focus();
//	     return false;
//	}  	
	if (document.myform.SpFax.value.length>0){ 
	if (IsFax(document.myform.SpFax.value)==false) {
			document.myform.SpFax.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.SpEmail.value)) 
	{
	     alert("Please enter Email! ");
	     document.myform.SpEmail.focus();
	     return false;
	}  	
	
	if (document.myform.SpEmail.value.length>0){ 
	document.myform.SpEmail.value = NonSpace(document.myform.SpEmail.value);
	if (isEmail(document.myform.SpEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.SpEmail.focus();
			return false;
	}
	}

	if (document.myform.totalAmount.value=="0" &&  document.myform.totalAmount.value==""  )    { 
			alert("Please select a Level of Sponsorship.")
			document.myform.totalAmount.focus();
			return false;
	}

	document.myform.sCMD.value = "upd";
	return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  ValidFloor   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFloor() {
	var number = 0;

	if (document.myform.check){
		if (isInt(document.myform.check.length)==false) {
			if (document.myform.check.checked){
						number = number + 1;
					}
		}
	
		if (isInt(document.myform.check.length)==true) {
			for (counter = 0;  counter < document.myform.check.length; counter++){
				if (document.myform.check[counter].checked)
					number = number +1;
				}
		}		
	}

	if (document.myform.checkBack){
		if (isInt(document.myform.checkBack.length)==false) {
			if (document.myform.checkBack.checked){
						number = number + 1;
						}
			}
	
		if (isInt(document.myform.checkBack.length)==true) {
			for (counter = 0;  counter < document.myform.checkBack.length; counter++){
				if (document.myform.checkBack[counter].checked)
				number = number +1;
				}
		}		
	}
	if (number=="0")
	{
		alert("Please select Booth(s).")
		return (false);
	}
	if (number > 2 )
	{
		alert("Please select only two Booths.")
		return (false);
	}
		
	if (isWhitespace(document.myform.TAMBID.value)) 
	{
	     alert("Please enter Your TAMB Convention ID");
	     document.myform.TAMBID.focus();
	     return false;
	} 
	if (isNumber2(document.myform.TAMBID.value)==false) {
			document.myform.TAMBID.focus();
			return false;
	}
	
	document.myform.sCMD.value = "upd";
	return true;
}






//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  ValidCustomer   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCustomer() {
	if (document.frmSite.blob.value!="")	{
		myext = getExtension(document.frmSite.blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
			alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
			document.frmSite.blob.value.focus;
		return false; 
		}
	}			
	if (document.frmSite.width.value > 0)	{
		if (document.frmSite.width.value > 114) {
	     alert("The width of  Image is too big! ");
	     document.frmSite.width.focus();
	     return false;
		}
	}  
	if (document.frmSite.height.value > 0)	{
		if (document.frmSite.height.value > 65) {
	     alert("The height of  Image is too big!");
	     document.frmSite.height.focus();
	     return false;
		}
	}  	
	document.frmSite.sCMD.value = "upd";
	return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidSiteHP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSiteHP() {
	if (document.frmSite.blob.value!="")	{
		myext = getExtension(document.frmSite.blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
			alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
			document.frmSite.blob.value.focus;
		return false; 
		}
	}	
	if (document.frmSite.width.value > 0)	{
		if (document.frmSite.width.value > 230) {
	     alert("The width of  Image is too big! ");
	     document.frmSite.width.focus();
	     return false;
		}
	}  
	if (document.frmSite.height.value > 0)	{
		if (document.frmSite.height.value > 230) {
	     alert("The height of  Image is too big!");
	     document.frmSite.height.focus();
	     return false;
		}
	}  	
	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPay      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPay() {
	var radio_choice = false;

	if (document.myform.PayID.checked==true)
	radio_choice = true; 

	for (counter = 0;  counter < document.myform.PayID.length; counter++)
	{
		if (document.myform.PayID[counter].checked)
		radio_choice = true; 
	}
	if (!radio_choice)
	{
		alert("Please select one Payment.")
		return (false);
	}

	if ( (document.myform.PayType.options[document.myform.PayType.options.selectedIndex].value)=="0")
	{
			alert("Please enter Payment Type ");
			document.myform.PayType.focus();
			return false;
	}
		return true;

}	
	


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayP()
{
	var radio_choice = false;
	if (document.myform.PayID){
		if (document.myform.PayID.checked==true)
		radio_choice = true; 

		for (counter = 0;  counter < document.myform.PayID.length; counter++)
		{
			if (document.myform.PayID[counter].checked)
			radio_choice = true; 
		}
	}
	if (!radio_choice)
	{
	alert("Please select one Payment.")
		return (false);
	}
		document.myform.submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayment      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayment() {
	if (isWhitespace(document.myform.bname.value)) 
	{
	     alert("Please enter Payment Name");
	     document.myform.bname.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.baddr1.value)) 
	{
	     alert("Please enter Payment Address");
	     document.myform.baddr1.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bcity.value)) 
	{
	     alert("Please enter City");
	     document.myform.bcity.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bcountry.value)) 
	{
	     alert("Please enter Country");
	     document.myform.bcountry.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bzip.value)) 
	{
	     alert("Please enter Zip Code");
	     document.myform.bzip.focus();
	     return false;
	} 
	 if (validateZIP(document.myform.bzip)==false) {
			document.myform.bzip.focus();
			return false;
	}

	if (isWhitespace(document.myform.email.value)) 
	{
	     alert("Please enter email ");
	     document.myform.email.focus();
	     return false;
	} 
	document.myform.email.value = NonSpace(document.myform.email.value);
	if (isEmail(document.myform.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.email.focus();
			return false;
	}  

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidCC     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCC() {
	if (document.myform.MemberID.value=="" || document.myform.MemberID.value=="0") 
	{
	     alert("Please enter ID");
	     document.myform.MemberID.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bname.value)) 
	{
	     alert("Please enter Name");
	     document.myform.bname.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.baddr1.value)) 
	{
	     alert("Please enter Address");
	     document.myform.baddr1.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bcity.value)) 
	{
	     alert("Please enter City");
	     document.myform.bcity.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bcountry.value)) 
	{
	     alert("Please enter Country");
	     document.myform.bcountry.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.bzip.value)) 
	{
	     alert("Please enter Zip Code");
	     document.myform.bzip.focus();
	     return false;
	} 
	 if (validateZIP(document.myform.bzip)==false) {
			document.myform.bzip.focus();
			return false;
	}

	if (isWhitespace(document.myform.email.value)) 
	{
	     alert("Please enter email ");
	     document.myform.email.focus();
	     return false;
	} 
	document.myform.email.value = NonSpace(document.myform.email.value);
	if (isEmail(document.myform.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.email.focus();
			return false;
	} 
	if ( (document.myform.cctype.options[document.myform.cctype.options.selectedIndex].value)=="0")
	{
	     alert("Please enter Credit Card Type");
	     document.forms[0].cctype.focus();
	     return false;
	}  
	
	if (isWhitespace(document.myform.cardnumber.value)) 
	{
	     alert("Please enter Credit Card Number ");
	     document.myform.cardnumber.focus();
	     return false;
	} 
	if (document.myform.cardnumber.value.length>0){ 
	document.myform.cardnumber.value = NonSpace(document.myform.cardnumber.value);
	if (isNumber1(document.myform.cardnumber.value)==false) {
			document.myform.cardnumber.focus();
			return false;
	}
	}
	if (document.myform.cardnumber.value.length!=16){ 
			alert("Please enter a valid Credit Card Number");
			document.myform.cardnumber.focus();
			return false;
	}  
	if (isWhitespace(document.myform.expmonth.value)) 
	{
	     alert("Please enter Expiration Month");
	     document.myform.expmonth.focus();
	     return false;
	} 
	if (isWhitespace(document.myform.expyear.value)) 
	{
	     alert("Please enter Expiration Year");
	     document.myform.expyear.focus();
	     return false;
	} 

	document.myform.sCMD.value = "upd";
	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidSearch      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSearch() {

	//var theForm = document.forms[0];
	var nr = document.theForm.length;
	var cod = 0;
	
	for (i=0; i<nr; i++){
		if (document.theForm.elements[i].type != "hidden" && document.theForm.elements[i].type != "submit" && document.theForm.elements[i].type != "radio"){
			if (document.theForm.elements[i].value != "" && document.theForm.elements[i].value != "0"){cod = 1;}
		}
	}
		if (cod == 0) {
			alert("Please, fill at least one field to Search!");
			document.theForm.FirstName.focus();
			return false;
		}			
	
	return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validCR    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validCR() {

	if (isWhitespace(document.frmCR.fname.value)) 
	{
	     alert("Please enter First Name");
	     document.frmCR.fname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmCR.lname.value)) 
	{
	     alert("Please enter Last Name");
	     document.frmCR.lname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmCR.cname.value)) 
	{
	     alert("Please enter Company Name");
	     document.frmCR.cname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmCR.address1.value)) 
	{
	     alert("Please enter Address ");
	     document.frmCR.address1.focus();
	     return false;
	}  
	if (isWhitespace(document.frmCR.city.value)) 
	{
	     alert("Please enter City");
	     document.frmCR.city.focus();
	     return false;
	}  
	if ( (document.frmCR.state.options[document.frmCR.state.options.selectedIndex].value)=="0")
	{
			alert("Please enter State!");
			document.frmCR.state.focus();
			return false;
	}
	if (isWhitespace(document.frmCR.zipCode.value)) 
	{
	     alert("Please enter Zip Code");
	     document.frmCR.zipCode.focus();
	     return false;
	} 
	 if (validateZIP(document.frmCR.zipCode)==false) {
			document.frmCR.zipCode.focus();
			return false;
	}
	if (isWhitespace(document.frmCR.telephone.value)) 
	{
	     alert("Please enter Telephone ");
	     document.frmCR.telephone.focus();
	     return false;
	}  
	if (IsPhone(document.frmCR.telephone.value)==false) {
			document.frmCR.telephone.focus();
			return false;
	}
	if (document.frmCR.fax.value.length>0){ 
	if (IsFax(document.frmCR.fax.value)==false) {
			document.frmCR.fax.focus();
			return false;
	}
	
	}
	if (isWhitespace(document.frmCR.email.value)) 
	{
	     alert("Please enter email ");
	     document.frmCR.email.focus();
	     return false;
	} 
	if (document.frmCR.email.value.length>0){ 
	document.frmCR.email.value = NonSpace(document.frmCR.email.value);
	 
	if (isEmail(document.frmCR.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmCR.email.focus();
			return false;
	}  
	}	
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validLN()    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validLN() {


	if (document.frmNL.legnet.checked == false){
				alert ("Please Accept To Join TAMB Legislative Network ! ");
				document.frmNL.legnet.focus();
				return false ;
			}
	 

	if (isWhitespace(document.frmNL.name.value)) 
	{
	     alert("Please enter Your Name !");
	     document.frmNL.name.focus();
	     return false;
	}  
	
	if (isWhitespace(document.frmNL.firm.value)) 
	{
	     alert("Please enter Company Name !");
	     document.frmNL.firm.focus();
	     return false;
	}  
	if (isWhitespace(document.frmNL.address.value)) 
	{
	     alert("Please enter Address !");
	     document.frmNL.address.focus();
	     return false;
	}  
	if (isWhitespace(document.frmNL.csz.value)) 
	{
	     alert("Please enter City/State/Zip !");
	     document.frmNL.csz.focus();
	     return false;
	}  
	if (isWhitespace(document.frmNL.phone.value)) 
	{
	     alert("Please enter Telephone !");
	     document.frmNL.phone.focus();
	     return false;
	}  
	if (IsPhone(document.frmNL.phone.value)==false) {
			document.frmNL.phone.focus();
			return false;
	}
	
	if (isWhitespace(document.frmNL.email.value)) 
	{
	     alert("Please enter Your Email !");
	     document.frmNL.email.focus();
	     return false;
	}  
	if (document.frmNL.email.value.length>0){ 
	document.frmNL.email.value = NonSpace(document.frmNL.email.value);
	if (isEmail(document.frmNL.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmNL.email.focus();
			return false;
	}  
	}
	if (isWhitespace(document.frmNL.precinct.value)) 
	{
	     alert("Please enter Precinct !");
	     document.frmNL.precinct.focus();
	     return false;
	} 
	
		if (isWhitespace(document.frmNL.us.value)) 
	{
	     alert("Please enter US Cong Dist !");
	     document.frmNL.us.focus();
	     return false;
	}  
	if (isWhitespace(document.frmNL.sen.value)) 
	{
	     alert("Please enter State Sen Dist !");
	     document.frmNL.sen.focus();
	     return false;
	}  
	if (isWhitespace(document.frmNL.leg.value)) 
	{
	     alert("Please enter State Leg Dist !");
	     document.frmNL.leg.focus();
	     return false;
	}  
	
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validAdv    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validAdv() {

	if (isWhitespace(document.frmAdv.fname.value)) 
	{
	     alert("Please enter First Name");
	     document.frmAdv.fname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmAdv.lname.value)) 
	{
	     alert("Please enter Last Name");
	     document.frmAdv.lname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmAdv.cname.value)) 
	{
	     alert("Please enter Company Name");
	     document.frmAdv.cname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmAdv.address1.value)) 
	{
	     alert("Please enter Address ");
	     document.frmAdv.address1.focus();
	     return false;
	}  
	if (isWhitespace(document.frmAdv.city.value)) 
	{
	     alert("Please enter City");
	     document.frmAdv.city.focus();
	     return false;
	}  
	if (isWhitespace(document.frmAdv.telephone.value)) 
	{
	     alert("Please enter Telephone ");
	     document.frmAdv.telephone.focus();
	     return false;
	}  
	if (IsPhone(document.frmAdv.telephone.value)==false) {
			document.frmAdv.telephone.focus();
			return false;
	}
	
	if (isWhitespace(document.frmAdv.email.value)) 
	{
	     alert("Please enter email ");
	     document.frmAdv.email.focus();
	     return false;
	}  
	if (document.frmAdv.email.value.length>0){ 
	document.frmAdv.email.value = NonSpace(document.frmAdv.email.value);
	
	if (isEmail(document.frmAdv.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmAdv.email.focus();
			return false;
	} 
	} 
	if (isWhitespace(document.frmAdv.comments.value)) 
	{
	     alert("Please enter Comments ");
	     document.frmAdv.comments.focus();
	     return false;
	}  

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  ValidMember   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMember() {

	if (isWhitespace(document.myform.MAccountName.value)) 
	{
	     alert("Please enter Account Name  ");
	     document.myform.MAccountName.focus();
	     return false;
	}  
	if (document.myform.MAccountName.value.length < 3) 
	{
	     alert("The Minimum length for Account Name should be 3 ");
	     document.myform.MAccountName.focus();
	     return false;
	 }
	if (isWhitespace(document.myform.MAccountPassword.value)) 
	{
	     alert("Please enter Password ");
	     document.myform.MAccountPassword.focus();
	     return false;
	}  
	 if (document.myform.MAccountPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 ");
	     document.myform.MAccountPassword.focus();
	     return false;
	 }
	if (isWhitespace(document.myform.ConfirmPassword.value)) 
	{
	     alert("Please Confirm Password");
	     document.myform.ConfirmPassword.focus();
	     return false;
	} 	 
	 if (document.myform.ConfirmPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3");
	     document.myform.ConfirmPassword.focus();
	     return false;
	 }	 
	 
	 if (document.myform.ConfirmPassword.value != document.myform.MAccountPassword.value ) 
	 {
	     alert("Your Passwords do not match");
	     document.myform.ConfirmPassword.focus();
	     return false;
	 }	
	 
	if ( (document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Membership Type ");
			document.myform.MCodeTypeID.focus();
			return false;
	}
	if ( (document.myform.MBussTypeID.options[document.myform.MBussTypeID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Business Type ");
			document.myform.MBussTypeID.focus();
			return false;
	}
	
/*---check for loan officer	- now lic mortgage originator
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)== "2") && ((document.myform.MBussTypeID.options[document.myform.MBussTypeID.options.selectedIndex].value) != "16"))
	{ 
			alert("You must be a Licensed Mortgage Originator for Associate Membership");
			document.myform.MCodeTypeID.focus();
			return false;
	}  */
	
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)== "2") && ((isWhitespace(document.myform.LicenseNumber.value)) || (document.myform.LicenseNumber.value=="0")))
	{
		alert("Enter your valid license number");
		document.myform.LicenseNumber.focus();
		return false;
	}
//--end check for loan officer--
//----check for mortgage banker------
if (((document.myform.MBussTypeID.options[document.myform.MBussTypeID.options.selectedIndex].value) == "31") && ((isWhitespace(document.myform.BankerLicNumber.value)) || (document.myform.BankerLicNumber.value=="0")))
	{
		alert("Enter your valid Mortgage Banker license number");
		document.myform.BankerLicNumber.focus();
		return false;
	}
//end check for mortgage banker
/*---check for professional member set as mortgage broker
	if (((((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)== "5") || ((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value) == "3")) && ((document.myform.MBussTypeID.options[document.myform.MBussTypeID.options.selectedIndex].value) != "1")))
	{ 
			alert("Professional Members must be Licensed Mortgage Originators - Non Mortgage Originators are Affiliates");
			document.myform.MCodeTypeID.focus();
			return false;
	}
//--end check for professional member set as mortgage broker--
*/
//---check for affiliate add company--	
	
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value) == "1") && ((isWhitespace(document.myform.FirstCoMemberID.value)) || (document.myform.FirstCoMemberID.value=="0")))
	{
		alert("Enter your valid First Affiliate Company TAMB Member ID");
		document.myform.FirstCoMemberID.focus();
		return false;
	}
//--end check for affiliate add company
//---check for assoc broker employee--	
	
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value) == "6") && ((isWhitespace(document.myform.FirstBrokMemberID.value)) || (document.myform.FirstBrokMemberID.value=="0")))
	{
		alert("Enter your valid Employer Professional TAMB Member ID");
		document.myform.FirstBrokMemberID.focus();
		return false;
	}
//--end check for broker employee
//---check for mortgage broker--	
	
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)== "5") && ((isWhitespace(document.myform.BrokerLicNumber.value)) || (document.myform.BrokerLicNumber.value=="0")))
	{
		alert("Enter your valid Mortgage Originator license number");
		document.myform.BrokerLicNumber.focus();
		return false;
	}
	if (((document.myform.MCodeTypeID.options[document.myform.MCodeTypeID.options.selectedIndex].value)== "3") && ((isWhitespace(document.myform.BrokerLicNumber.value)) || (document.myform.BrokerLicNumber.value=="0")))
	{
		alert("Enter your valid Mortgage Originator license number");
		document.myform.BrokerLicNumber.focus();
		return false;
	}	

//--end check for chapter
	if ( (document.myform.MChapterID.options[document.myform.MChapterID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Chapter");
			document.myform.MChapterID.focus();
			return false;
	}	
	if ( (document.myform.MMapID.options[document.myform.MMapID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Area");
			document.myform.MMapID.focus();
			return false;
	}
	
	if (isWhitespace(document.myform.MFirstName.value)) 
	{
			alert("Please enter First Name  ");
			document.myform.MFirstName.focus();
			return false;
	}
	if (isWhitespace(document.myform.MLastName.value)) 
	{
			alert("Please enter Last Name  ");
			document.myform.MLastName.focus();
			return false;
	}
	if (isWhitespace(document.myform.MCompanyName.value)) 
	{
			alert("Please enter Company Name ");
			document.myform.MCompanyName.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MBusAddress1.value)) 
	{
			alert("Please enter Address ");
			document.myform.MBusAddress1.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MBusCity.value)) 
	{
			alert("Please enter City ");
			document.myform.MBusCity.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MBusZip.value)) 
	{
			alert("Please enter Zip Code ");
			document.myform.MBusZip.focus();
			return false;
	}
	 if (validateZIP(document.myform.MBusZip)==false) {
			document.myform.MBusZip.focus();
			return false;
	}//--home address 
if (isWhitespace(document.myform.MHomeAddress1.value)) 
	{
			alert("Please enter Home Address");
			document.myform.MHomeAddress1.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MHomeCity.value)) 
	{
			alert("Please enter Home City");
			document.myform.MHomeCity.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MHomeZip.value)) 
	{
			alert("Please enter Home Zip Code");
			document.myform.MHomeZip.focus();
			return false;
	}
	 if (validateZIP(document.myform.MHomeZip)==false) {
			document.myform.MHomeZip.focus();
			return false;
	}
	
	
myOption = 1;
 for (i=0; i<document.myform.xAddress.length; i++) {
  if ((!document.myform.xAddress[0].checked) && (!document.myform.xAddress[1].checked)){
     myOption = -1;
   }
  }
  if (myOption == -1) {
    alert("Please select what address we should use for mailing.");
    return false;
  }


//---end home address
//	if (document.myform.MMAILZip.value.length>0){ 
//	 if (validateZIP(document.myform.MMAILZip)==false) {
//				document.myform.MMAILZip.focus();
//				return false;
//	} 
//	}
	if (isWhitespace(document.myform.MPhone1.value)) {
			alert("Please enter Phone No.");
			document.myform.MPhone1.focus();
			return false;
	}
	if (isNumber1(document.myform.MPhone1.value)==false) {
			document.myform.MPhone1.focus();
			return false;
	}
	if (document.myform.MPhone1.value.length  < 3) 
	{
			alert("Please enter 3 numbers");
			document.myform.MPhone1.focus();
			return false;
	}	
	if (isWhitespace(document.myform.MPhone2.value)) {
			alert("Please enter Phone No.");
			document.myform.MPhone2.focus();
			return false;
	}
	if (isNumber1(document.myform.MPhone2.value)==false) {
			document.myform.MPhone2.focus();
			return false;
	}
	if (document.myform.MPhone2.value.length  < 3) 
	{
			alert("Please enter 3 numbers");
			document.myform.MPhone2.focus();
			return false;
	}
	if (isWhitespace(document.myform.MPhone3.value)) {
			alert("Please enter Phone No");
			document.myform.MPhone3.focus();
			return false;
	}
	if (isNumber1(document.myform.MPhone3.value)==false) {
			document.myform.MPhone3.focus();
			return false;
	}
	if (document.myform.MPhone3.value.length  < 4) 
	{
			alert("Please enter 4 numbers");
			document.myform.MPhone3.focus();
			return false;
	}	
	
	
	if (document.myform.MFax1.value.length> 0){
	if (isWhitespace(document.myform.MFax1.value)) {
			alert("Please enter Fax No");
			document.myform.MFax1.focus();
			return false;
	}	
	}
	if (document.myform.MFax1.value.length> 0){
	if (isNumber1(document.myform.MFax1.value)==false) {
			document.myform.MFax1.focus();
			return false;
	}
	}
	if (document.myform.MFax1.value.length> 0){
	if (document.myform.MFax1.value.length  < 3) {
			alert("Please enter 3 numbers");
			document.myform.MFax1.focus();
			return false;
	}	
	}
	if (document.myform.MFax1.value.length> 0){
	if (isWhitespace(document.myform.MFax2.value)) {
			alert("Please enter Fax No");
			document.myform.MFax2.focus();
			return false;
	}
	}	
	if (document.myform.MFax2.value.length> 0){
	if (isNumber1(document.myform.MFax2.value)==false) {
			document.myform.MFax2.focus();
			return false;
	}
	}
	if (document.myform.MFax2.value.length> 0){
	if (document.myform.MFax2.value.length  < 3) {
			alert("Please enter 3 numbers");
			document.myform.MFax2.focus();
			return false;
	}	
	}
	
	if (document.myform.MFax2.value.length> 0){
	if (isWhitespace(document.myform.MFax3.value)) {
			alert("Please enter Fax No");
			document.myform.MFax3.focus();
			return false;
	}	
	}
	if (document.myform.MFax3.value.length> 0){
	if (isNumber1(document.myform.MFax3.value)==false) {
			document.myform.MFax3.focus();
			return false;
	}
	}
	if (document.myform.MFax3.value.length> 0){
	if (document.myform.MFax3.value.length  < 3) {
			alert("Please enter 3 numbers");
			document.myform.MFax3.focus();
			return false;
	}	
	}
	if (isWhitespace(document.myform.MEmail.value)) 
	{
			alert("Please enter Email Address");
			document.myform.MEmail.focus();
			return false;
	}	
	if (document.myform.MEmail.value.length>0){ 
	document.myform.MEmail.value = NonSpace(document.myform.MEmail.value);

	if (isEmail(document.myform.MEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com");
			document.myform.MEmail.focus();
			return false;
	}
	}
		
//------Vitaliy Myronenko--------

//-----End of Vitaliy Myronenko code--------
	
//	if (document.myform.MListView.checked==true)
//	{
//			if ( (document.myform.MListTypeID.options[document.myform.MListTypeID.options.selectedIndex].value)=="77")
//			{
//					alert("Please choose Listing Type");
//					document.myform.MListTypeID.focus();
//					return false;
//			}	
//	}
	document.myform.sCMD.value = "upd";
	return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  ValidCustomerX   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCustomerX() {

	if ( (document.frmSite.CustomerSalutation.options[document.frmSite.CustomerSalutation.options.selectedIndex].value)=="0")
	{
			alert("Please enter Salutation  ");
			document.frmSite.CustomerSalutation.focus();
			return false;
	}

	if (isWhitespace(document.frmSite.CustomerFirstName.value)) 
	{
			alert("Please enter  First Name  ");
			document.frmSite.CustomerFirstName.focus();
			return false;
	}
  
	if (isWhitespace(document.frmSite.CustomerLastName.value)) 
	{
			alert("Please enter  Last Name  ");
			document.frmSite.CustomerLastName.focus();
			return false;
	}
	if (isWhitespace(document.frmSite.CustomerCompanyName.value)) 
	{
			alert("Please enter a valid Company Name ");
			document.frmSite.CustomerCompanyName.focus();
			return false;
	}	
	if (document.frmSite.width.value > 0)	{
		if (document.frmSite.width.value > 114) {
	     alert("The width of  Image is too big! ");
	     document.frmSite.width.focus();
	     return false;
		}
	}  
	if (document.frmSite.height.value > 0)	{
		if (document.frmSite.height.value > 84) {
	     alert("The height of  Image is too big!");
	     document.frmSite.height.focus();
	     return false;
		}
	}  		
	if (document.frmSite.CustomerAddress1.value.length <2) 
	{
			alert("Please enter  Address ");
			document.frmSite.CustomerAddress1.focus();
			return false;
	}

	if (isWhitespace(document.frmSite.CustomerCity.value)) 
	{
			alert("Please enter  City ");
			document.frmSite.CustomerCity.focus();
			return false;
	}
	if (isWhitespace(document.frmSite.CustomerZip.value)) 
	{
			alert("Please enter Zip Code ");
			document.frmSite.CustomerZip.focus();
			return false;
	}

	 if (validateZIP(document.frmSite.CustomerZip)==false) {
				document.frmSite.CustomerZip.focus();
				return false;
	} 
	if (isWhitespace(document.frmSite.CustomerPhone.value)) 
	{
			alert("Please enter Phone No ");
			document.frmSite.CustomerPhone.focus();
			return false;
	}	
	if (IsPhone(document.frmSite.CustomerPhone.value)==false) {
			document.frmSite.CustomerPhone.focus();
			return false;
	}
	  if (document.frmSite.CustomerFax.value.length > 0) {
			if (IsFax(document.frmSite.CustomerFax.value)==false) {
					document.frmSite.CustomerFax.focus();
					return false;
			}
	 }	
	if (isWhitespace(document.frmSite.CustomerAccountName.value)) 
	{
	     alert("Please enter  Account Name  ");
	     document.frmSite.CustomerAccountName.focus();
	     return false;
	}  

	if (document.frmSite.CustomerAccountName.value.length < 3) 
	{
	     alert("The Minimum length for Account Name should be 3 !");
	     document.frmSite.CustomerAccountName.focus();
	     return false;
	 }

	if (isWhitespace(document.frmSite.CustomerPassword.value)) 
	{
	     alert("Please enter  Password ");
	     document.frmSite.CustomerPassword.focus();
	     return false;
	}  
	 if (document.frmSite.CustomerPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 !");
	     document.frmSite.CustomerPassword.focus();
	     return false;
	 }
	 
	if (isWhitespace(document.frmSite.ConfirmPassword.value)) 
	{
	     alert("Please Confirm Password ");
	     document.frmSite.ConfirmPassword.focus();
	     return false;
	} 	 
	 if (document.frmSite.ConfirmPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 !");
	     document.frmSite.ConfirmPassword.focus();
	     return false;
	 }	 
	 
	 if (document.frmSite.ConfirmPassword.value != document.frmSite.CustomerPassword.value ) 
	 {
	     alert("Passwords does not match!");
	     document.frmSite.ConfirmPassword.focus();
	     return false;
	 }	 
	 	 
 
	document.frmSite.sCMD.value = "upd";
	return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidStaff()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidStaff() {

	for (counter = 0;  counter < document.myformStaff.NMFullName.length; counter++){

		if (document.myformStaff.NMZip[counter].value.length>0) {
			 if (validateZIP(document.myformStaff.NMZip[counter])==false) {
						document.myformStaff.NMZip[counter].focus();
						return false;
			} 
		}  
	
	}	

	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      NonSpace      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function NonSpace(field) {

	var xpos =0;
	var xlen =field.length;
	var xpos1 =0;
	var xpos2 =xlen;

	for (var i=0; i < xlen; i++) {
		temp = "" + field.substring(i, i+1);
		if (temp == " ") {xpos++;}
		else {var xpos1=xpos;break;  }
	}
	field = field.substring(xpos1, xlen)
	var xlen1 = field.length;

	for (var i=0; i < xlen1; i++) {
		temp = "" + field.substring(i, i+1);
		if (temp != " ") {xpos1++;}
		else {xpos2=i;break;  }
	}
	field = field.substring(0, xpos2)
	return field;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      IsChar      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

function IsChar(val) {
var strPass = val.value;
var strLength = strPass.length;
var lchar = val.value.charAt((strLength) - 1);
if(lchar.search(mikExp) != -1) {
var tst = val.value.substring(0, (strLength) - 1);
val.value = tst;
   }
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~   IsChara   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function IsChara(form) {
if(form.value.length < 1) {
alert("Please fill this field; cannot be empty.");
return false;
}
if(form.value.search(mikExp) == -1) {
return true;
}
else {
alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ =  | \n\r\n\rare not allowed!\n");
form.select();
form.focus();
return false;
}
return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~   Valid_Date   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




function Valid_Date(datein){
        
        var indate=datein;
        if (indate.indexOf("-")!=-1){
                var sdate = indate.split("-")
        }
        else {
                var sdate = indate.split("/")
        }
        var chkDate=new Date(Date.parse(indate))
        var cmpDate=(chkDate.getMonth()+1)+"/"+(chkDate.getDate())+"/"+(chkDate.getFullYear())
        var indate2=(Math.abs(sdate[0]))+"/"+(Math.abs(sdate[1]))+"/"+(Math.abs(sdate[2]))

		if ((chkDate.getFullYear() > 3000)||(chkDate.getFullYear() < 1900)) {
                alert("You've entered an invalid year");
				return false;
		}				
		if ((Math.abs(sdate[2]) > 3000)||(Math.abs(sdate[2])< 1900)) {
                alert("You've entered an invalid year");
				return false;
		}				


   if (indate2=="0/NaN/NaN"){
				return true;
   }        
	else {
 		
        if (indate2!=cmpDate){
                alert("You've entered an invalid date or date format.  Please use the MM/DD/YYYY format.");
				return false;
        }
        else {
                if (cmpDate=="NaN/NaN/NaN"){
                        alert("You've entered an invalid date or date format. Please use the MM/DD/YYYY format.");
						return false;
                }
                else {
						return true;
                }       
        }
}        
}







//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     isEmail      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function isEmail(string) {
    if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
        return true;
    else
        return false;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     IsPhone      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function IsPhone(str)          // is phone str valid
    {
    if (str.length != 12) 
              // nope - wrong str length
		{
		alert('Invalid PhoneNo. Must be in the form NNN-NNN-NNNN.');
		return false;
	}		
  for (i=0; i<12; i++)
    {
    if (i == 3 || i == 7)
    {
      if (str.charAt(i) != "-")     // nope - "-" missing
			{
			alert(' Missing - . PhoneNo  must be in the form NNN-NNN-NNNN.');
			return false;
			}
	}		
	else
    {
      if (!isNum(str.charAt(i)))
		{
		alert('Non-numeric characters. PhoneNo must be in the form NNN-NNN-NNNN.');
		return false;
		}
	}		
  }
  return true;                     

}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     IsFax      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function IsFax(str)          // is Fax str valid
    {
    if (str.length != 12) 
              // nope - wrong str length
		{
		alert('Invalid FaxNo. Must be in the form NNN-NNN-NNNN.');
		return false;
	}		
  for (i=0; i<12; i++)
    {
    if (i == 3 || i == 7)
    {
      if (str.charAt(i) != "-")     // nope - "-" missing
			{
			alert(' Missing - . FaxNo  must be in the form NNN-NNN-NNNN.');
			return false;
			}
	}		
	else
    {
      if (!isNum(str.charAt(i)))
		{
		alert('Non-numeric characters. FaxNo must be in the form NNN-NNN-NNNN.');
		return false;
		}
	}		
  }
  return true;                     

}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validateZIP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function validateZIP(field) {
var valid = "0123456789-";
var hyphencount = 0;

if (field.value.length!=5 && field.value.length!=10) {
alert("Please enter your 5 digit or ( 5 + 4 ) digit  ZIP  code.");
return false;
}
for (var i=0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your ZIP code.  Please try again.");
return false;
}
if ((hyphencount > 1) || ((field.value.length==10) && ""+field.value.charAt(5)!="-")) {
alert("The hyphen character should be used with a properly formatted 5 digit+four  ZIP  code, like '12345-6789'.   Please try again.");
return false;
   }
}
return true;
}


function isInt(chr)           
{
	if (isNaN(chr))
	{return false; }
	else
	  {
		if (chr>0)
		{ return true;	}
		else
		  { return false; }	  
	   }
}


function isNum(chr)            // is character a number?
  {
  if (chr < "0" || chr > "9")  // nope
    return false;
  else                         // yep
    return true;
  }



function isNumber(InString)  {
        RefString="123456789";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter numbers only: 1 - 9 ");
				return false;
			}
		}
        return true;
}

function isNumber1(InString)  {
        RefString="0123456789";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter numbers only: 0 - 9 ");
				return false;
			}
		}
        return true;
}

function isNumber2(InString)  {
        RefString="0123456789-";

        for (Count=0; Count < InString.length; Count++)  {
            TempChar= InString.substring (Count, Count+1);
            if (RefString.indexOf (TempChar, 0)==-1) { 
				alert("Please enter a valid Member ID");
				return false;
			}
		}
        return true;
}

function validateam(field) {
var valid = "123456789:";
var sep = 0;

if (field.value.length <4) {
alert("The GenericTime shall be at least 4 chars long.");
return false;
}
for (var i=0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (temp == ":") sep++;
if (valid.indexOf(temp) == "-1") {
alert("Invalid characters in your GenericTime.  Please try again.");
return false;
}
if ((sep > 1) || ((field.value.length==5) && ""+field.value.charAt(2)!=":")) {
alert("The ':' character should be used with a properly format, like 7:00.   Please try again.");
return false;
   }
if ((sep > 1) || ((field.value.length==4) && ""+field.value.charAt(1)!=":")) {
alert("The ':' character should be used with a properly format, like 7:00.   Please try again.");
return false;
   }
}
return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validateW      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function validateW(field) {
var valid = "0123456789.";
var hyphencount = 0;


for (var i=0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);

if (temp == ".") hyphencount++;
	if (valid.indexOf(temp) == "-1") {
	alert("Invalid characters.\n You must type only decimal numbers less than 1.");
	return false;
	}
}
if (field.value >= 1) {
	alert("You must type only decimal numbers less than 1.");
	return false;
}


return true;
}



var reWhitespace = /^\s+$/
// warnEmpty (theField, s)             Notify user that required field theField is empty.


// Notify user that required field theField is empty.
// String s describes expected contents of theField.value.
// Put focus in theField and return false.

function warnEmpty (theField, s)
{   theField.focus()
    alert(mPrefix + s + mSuffix)
    return false
}



// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}



// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)

{   // Is s empty?
//    return (isEmpty(s));
    return (isEmpty(s) || reWhitespace.test(s));
}


function IsOK(val) {
	CharRep = /,/gi;
	newstr=val.replace(CharRep," ");
	return newstr;
}

function IsOKNumber(val) {
	CharRep = /,/gi;
	newstr=val.replace(CharRep,"");
	return newstr;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSort      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSort(url,sSortBy,sSortOrd)
{
//		document.forms[0].sCMD.value = "sort";
		document.myform.action = url;
		document.myform.SortBy.value  = sSortBy;
		document.myform.SortOrd.value = sSortOrd;

		document.myform.submit( );
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~   DelConf   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function DelConf(url)   {
	if (confirm("This Record will be deleted! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "del";
		document.forms[0].action = url;

		document.forms[0].submit();
		}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goRefresh      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goRefresh(url)   
{

		document.forms[0].sCMD.value = "";
		document.forms[0].action = url;
		document.forms[0].submit();
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDel      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDel(url,ID)   
{
	if (confirm("This Record will be deleted! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "del";
		document.forms[0].ID.value = ID;
		document.forms[0].action = url;
		document.forms[0].submit();
		}
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goMod      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goMod(url,ID)   
{
		document.forms[0].sCMD.value = "edit";
		document.forms[0].action = url;
		document.forms[0].ID.value = ID;
		document.forms[0].submit();
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goAdd      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goAdd(url)   
{

		document.forms[0].sCMD.value = "add";
		document.forms[0].ID.value = "";
		document.forms[0].action = url;
		document.forms[0].submit();
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubm      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubm(url,xID,yID)
{
		//document.forms[0].action = url;
		//document.forms[0].TemplateID.value = xID;
		//document.forms[0].ColorID.value = yID;
		//document.forms[0].submit();
		
		document.frmColor.action = url;
		document.frmColor.TemplateID.value = xID;
		document.frmColor.ColorID.value = yID;
		document.frmColor.submit();

}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goPage      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goPage(xpage)   
{
//		document.frmTemp1.sCMD.value = "upd";
		document.frmTemp1.page.value  = xpage;
//		document.frmTemp1.sSQL.value = sSQL;
		document.frmTemp1.submit();
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goPageB      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goPageB(xpage,sorder)   
{
//		document.frmTemp1.sCMD.value = "upd";
		document.frmTemp1.page.value  = xpage;
//		document.frmTemp1.sSQL.value = sSQL;
		document.frmTemp1.submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goPageM      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goPageM(xpage)   
{
//		document.frmTemp1.sCMD.value = "upd";
		document.frmTemp1.page.value  = xpage;
//		document.frmTemp1.sSQL.value = sSQL;
		document.frmTemp1.submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDelE      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDelE(url,ID)   
{
	if (confirm("This Record will be deleted! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "delete";
		document.forms[0].StaffID.value = ID;
		document.forms[0].action = url;
		document.forms[0].submit();
		}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubmit      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubmit(xAction)
{
		document.myform.sCMD.value = xAction;
		document.myform.action = "Login.asp";
		document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubmitM      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubmitM(xAction)
{
		document.myform.sCMD.value = xAction;
		document.myform.action = "Login.asp";
		document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     doSubmit      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function doSubmit(xdate)
{
		document.myform.mydate.value = xdate;
		document.myform.action = "EvCalendar.asp";
		document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     doSubmitM      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function doSubmitM(xdate,xid)
{
		document.myform.mydate.value = xdate;
		document.myform.action = "ClassSchedule.asp";
		document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      getExtension      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function getExtension(field) {
	var xpos =0;
	var xlen =field.length;
	for (var i=xlen; i > 0 ; i--) {
		temp = "" + field.substring(i, i-1);
		if (temp != ".") {xpos--;}
			else {break;
		}
	}
	return (field.substring(xlen+xpos, xlen));
}



function ovrRow(eItem)
{
	eItem.DefaultBgColor=eItem.style.backgroundColor;
	eItem.style.backgroundColor="#CCCC99";		green
	
	eItem.style.cursor="hand"
}

function outRow(eItem)
{
	eItem.style.backgroundColor=eItem.DefaultBgColor;
	eItem.style.cursor="hand"
}

function ovrTD(Item,col_mover)
{
	Item.style.backgroundColor=col_mover;	

	Item.style.cursor="hand"
}

function outTD(Item,col_mout)
{
	Item.style.backgroundColor=col_mout; 
	Item.style.cursor="hand"
}

function go(eItem){top.location.href= findTag(eItem).getAttribute("HREF")}



function xCheck(x,col_check)
    {
    xItem = x.parentElement.parentElement.parentElement
	if (x.checked) {
		xItem.DefaultBgColor=xItem.style.backgroundColor;
		xItem.style.backgroundColor=col_check;
		xItem.style.cursor="hand";
	}
	else {
		xItem.style.backgroundColor=xItem.DefaultBgColor;
		xItem.style.cursor="hand";
	}
}
   
    
function Start(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=550,height=550,top=10,left=10");
}

function OpenPage(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=650,height=550,top=10,left=10");
}


function BackDisabled()   {
	if(history.forward() != null) {
		self.location.reload()
	} 
}