//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      LoginValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function LoginValid() {

	if (isWhitespace(document.frmLogin.UserName.value)) 
	{
	     alert("Please enter User Name  ");
	     document.frmLogin.UserName.focus();
	     return false;
	}  

	if (document.frmLogin.UserName.value.length < 3) 
	{
	     alert("The Minimum length for User Name should be 3 !");
	     document.frmLogin.UserName.focus();
	     return false;
	 }

	if (isWhitespace(document.frmLogin.UserPassword.value)) 
	{
	     alert("Please enter  User Password ");
	     document.frmLogin.UserPassword.focus();
	     return false;
	}  
	 if (document.frmLogin.UserPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 !");
	     document.frmLogin.UserPassword.focus();
	     return false;
	 }
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidExhibitors     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidExhibitors() {

	
	if ((document.myform.MCode[1].checked) && (document.myform.MID.value=='' || document.myform.MID.value=="0" ))   { 
			alert("For TAMB Member - TAMB ID must be completed! ");
			return false;
   }	
	if ((document.myform.MCode[0].checked) && (document.myform.MID.value!='' && document.myform.MID.value!="0" ))   { 
			alert("For Non TAMB Member - TAMB ID must be 0! ");
			return false;
   }	
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
		}
	}
	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>3){ 
	 if (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 booth(s) number! ");
//		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.ExStaffNr.value.length>0){ 
		if (isNumber1(document.myform.ExStaffNr.value)==false) {
			document.myform.ExStaffNr.focus();
			return false;
		}
	}
	if (document.myform.ExSatNr.value.length>0){ 
		if (isNumber1(document.myform.ExSatNr.value)==false) {
			document.myform.ExSatNr.focus();
			return false;
		}
	}
	if (document.myform.ExAttNr.value.length>0){ 
		if (isNumber1(document.myform.ExAttNr.value)==false) {
			document.myform.ExAttNr.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){x1=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.ExSatSum.value)==true){x5=parseInt(document.myform.ExSatSum.value)};
	if (isInt(document.myform.ExAttSum.value)==true){x6=parseInt(document.myform.ExAttSum.value)};
		
	xx = x1+x2+x3+x4+x5+x6;
	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;
		}
	}
	document.myform.sCMD.value = "upd";
	return true;
}



//----------------------------------------------------------------------------------------
function ValidNum(thefield) {
	if (isNumber1(thefield.value)==false) {
		thefield.focus();
		return false;
	}
	if (thefield.value>2) { 
			alert("Please select maximum 2 booths! ");
			thefield.focus();
			return false;
	}	
return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CalculTotal()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CalculTotal() {

	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){x1=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.ExSatSum.value)==true){x5=parseInt(document.myform.ExSatSum.value)};
	if (isInt(document.myform.ExAttSum.value)==true){x6=parseInt(document.myform.ExAttSum.value)};
	
		
//	for (counter = 0;  counter < document.myform.NMSum.length; counter++){
//		if (isInt(document.myform.NMSum[counter].value)==true){
//			x3=x3+parseInt(document.myform.NMSum[counter].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;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      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>3) {
			 if (document.myformStaff.NMZip[counter]==false) {
						document.myformStaff.NMZip[counter].focus();
						return false;
			} 
		}  
	
	}	

	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidRegis      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidRegis() {

	if ((document.myform.MCode[1].checked) && (document.myform.MID.value=='' || document.myform.MID.value=="0" ))   { 
			alert("For TAMB Member - TAMB ID must be completed! ");
			return false;
   }	
	if ((document.myform.MCode[0].checked) && (document.myform.MID.value!='' && document.myform.MID.value!="0" ))   { 
			alert("For Non TAMB Member - TAMB ID must be 0! ");
			return false;
   }	
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
		}
	}

	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>3){ 
	 if (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=="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.ExRegID.value=="7") {document.myform.ExRegistration.value= document.myform.ExhibRegPersonnel2.value;}
		if (document.myform.ExRegID.value=="8") {document.myform.ExRegistration.value= document.myform.ExhibRegTix.value;}
		if (document.myform.ExRegID.value=="10") {document.myform.ExRegistration.value= document.myform.ExhibRegTix2.value;}
	}

	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)};
	if (isInt(document.myform.ExLunSum.value)==true){x4=parseInt(document.myform.ExLunSum.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+x4;
	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;}
				if (document.myform.NMRegID[counter].value=="7") {document.myform.NMSum[counter].value= document.myform.ExhibRegPersonnel2.value;}
				if (document.myform.NMRegID[counter].value=="8") {document.myform.NMSum[counter].value= document.myform.ExhibRegTix.value;}
				if (document.myform.NMRegID[counter].value=="10") {document.myform.NMSum[counter].value= document.myform.ExhibRegTix2.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;
		}
	}


	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.ExRegID.value=="7") {document.myform.ExRegistration.value= document.myform.ExhibRegPersonnel2.value;}
		if (document.myform.ExRegID.value=="8") {document.myform.ExRegistration.value= document.myform.ExhibRegTix.value;}
		if (document.myform.ExRegID.value=="10") {document.myform.ExRegistration.value= document.myform.ExhibRegTix2.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)};
	if (isInt(document.myform.ExLunSum.value)==true){x4=parseInt(document.myform.ExLunSum.value)};

	xx = x1+x2+x3+x4;
	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;}
				if (document.myform.NMRegID[counter].value=="7") {document.myform.NMSum[counter].value= document.myform.ExhibRegPersonnel2.value;}
				if (document.myform.NMRegID[counter].value=="8") {document.myform.NMSum[counter].value= document.myform.ExhibRegTix.value;}
				if (document.myform.NMRegID[counter].value=="10") {document.myform.NMSum[counter].value= document.myform.ExhibRegTix2.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 ((document.myform.MCode[1].checked) && (document.myform.MID.value=='' || document.myform.MID.value=="0" ))   { 
			alert("For TAMB Member - TAMB ID must be completed! ");
			return false;
   }	
	if ((document.myform.MCode[0].checked) && (document.myform.MID.value!='' && document.myform.MID.value!="0" ))   { 
			alert("For Non TAMB Member - TAMB ID must be 0! ");
			return false;
   }	
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
		}
	}

	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>3){ 
	 if (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;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidGolf      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidGolf() {

	if ((document.myform.MCode[1].checked) && (document.myform.MID.value=='' || document.myform.MID.value=="0" ))   { 
			alert("For TAMB Member - TAMB ID must be completed! ");
			return false;
   }	
	if ((document.myform.MCode[0].checked) && (document.myform.MID.value!='' && document.myform.MID.value!="0" ))   { 
			alert("For Non TAMB Member - TAMB ID must be 0! ");
			return false;
   }	
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
		}
	}
	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>3){ 
	 if (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;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmail()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmail() {

	if (isWhitespace(document.myform.EmailSubject.value)) 
	{
	     alert("Please enter Email Subject! ");
	     document.myform.EmailSubject.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.EmailTitle.value)) 
	{
	     alert("Please enter Email Title! ");
	     document.myform.EmailTitle.focus();
	     return false;
	} 
//	if (document.myform.email.value.length>0){ 
//	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;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidCCourse      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCCourse() {

	if (isWhitespace(document.myform.CCName.value)) 
	{
	     alert("Please enter Course Name! ");
	     document.myform.CCName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.CCDate.value)) 
	{
	     alert("Please enter Course Date! ");
	     document.myform.CCDate.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.CCTime.value)) 
	{
	     alert("Please enter Course Time!");
	     document.myform.CCTime.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.CCMPrice.value)) 
	{
	     alert("Please enter Course Member Fee! ");
	     document.myform.CCMPrice.focus();
	     return false;
	}  
	if (ValidPrice(document.myform.CCMPrice.value)==false) {
			document.myform.CCMPrice.focus();
			return false;
	}	
	if (isWhitespace(document.myform.CCNMPrice.value)) 
	{
	     alert("Please enter Course Non-Member Fee! ");
	     document.myform.CCNMPrice.focus();
	     return false;
	}  
	if (ValidPrice(document.myform.CCNMPrice.value)==false) {
			document.myform.CCNMPrice.focus();
			return false;
	}	
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      UserValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function UserValid() {

	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name  ");
	     document.myform.UserName.focus();
	     return false;
	}  

	if (document.myform.UserName.value.length < 3) 
	{
	     alert("The Minimum length for User Name should be 3 !");
	     document.myform.UserName.focus();
	     return false;
	 }

	if (isWhitespace(document.myform.UserPassword.value)) 
	{
	     alert("Please enter  User Password ");
	     document.myform.UserPassword.focus();
	     return false;
	}  
	 if (document.myform.UserPassword.value.length < 3) 
	 {
	     alert("The Minimum length for Password should be 3 !");
	     document.myform.UserPassword.focus();
	     return false;
	 }
	if (isWhitespace(document.myform.UserEmail.value)) 
	{
	     alert("Please enter User Email ");
	     document.myform.UserEmail.focus();
	     return false;
	}  
	if (document.myform.UserEmail.value.length>0){ 
	document.myform.UserEmail.value = NonSpace(document.myform.UserEmail.value);

	if (isEmail(document.myform.UserEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.UserEmail.focus();
			return false;
	}  
	}
	if ( (document.myform.UserType.options[document.myform.UserType.options.selectedIndex].value)=="0")
	{
			alert("Please enter User Type ");
			document.myform.UserType.focus();
			return false;
	}	
	 
	 if ( (document.myform.UserType.options[document.myform.UserType.options.selectedIndex].value)=="77")
	{
		 if ( (document.myform.UserChapter.options[document.myform.UserChapter.options.selectedIndex].value)=="0")
			{
			alert("Please enter User Chapter ");
			document.myform.UserChapter.focus();
			return false;
			}
	}	
	else
	{
	if ( (document.myform.UserChapter.options[document.myform.UserChapter.options.selectedIndex].value)!="0")
		{
		document.myform.UserChapter.options[document.myform.UserChapter.options.selectedIndex].value = 0
		}
	}
	 
	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CManagerValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CManagerValid() {

	if (document.forms[0].blob.value!="")	{
		myext = getExtension(document.forms[0].blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.forms[0].blob.value.focus;
		return false; 
		}
	}		
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value > 300) {
	     alert("The Image's  width is too big! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value > 300) {
	     alert("The Image's height is too big!");
	     document.forms[0].height.focus();
	     return false;
		}
	} 
	 	
	if (isWhitespace(document.forms[0].xText.value)) 
	{
	     alert("Please enter  Page Content");
	     document.forms[0].xText.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      CChapterValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function CChapterValid() {

	if (document.forms[0].blob.value!="")	{
		myext = getExtension(document.forms[0].blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.forms[0].blob.value.focus;
		return false; 
		}
	}		

	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value > 300) {
	     alert("The Image's  width is too big! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value > 300) {
	     alert("The Image's height is too big!");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (isWhitespace(document.forms[0].xText.value)) 
	{
	     alert("Please enter  Page Content");
	     document.forms[0].xText.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     FAQValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function FAQValid() {

	if (isWhitespace(document.forms[0].FAQQuestion.value)) 
	{
	     alert("Please enter Question ");
	     document.forms[0].FAQQuestion.focus();
	     return false;
	}  

	if (isWhitespace(document.forms[0].FAQResponse.value)) 
	{
	     alert("Please enter Response ");
	     document.forms[0].FAQResponse.focus();
	     return false;
	}  
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      HCValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function HCValid() {

	if (isWhitespace(document.frmHC.HCTypeName.value)) 
	{
	     alert("Please enter Type Name ");
	     document.frmHC.HCTypeName.focus();
	     return false;
	}  
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  HCCValid   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function HCCValid(){


	if (document.frmHCC.HCCZip.value.length>3){ 
	 if (document.frmHCC.HCCZip==false) {
				document.frmHCC.HCCZip.focus();
				return false;
	} 
	}

	if (document.frmHCC.HCCPhone.value.length>0){ 
	if (IsPhone(document.frmHCC.HCCPhone.value)==false) {
			document.frmHCC.HCCPhone.focus();
		return false;
	} 
	}
	if (document.frmHCC.HCCFax.value.length>0){ 
	if (IsFax(document.frmHCC.HCCFax.value)==false) {
			document.frmHCC.HCCFax.focus();
			return false;
	}
	}
	if (document.frmHCC.HCCEmail.value.length>0){ 
	document.frmHCC.HCCEmail.value = NonSpace(document.frmHCC.HCCEmail.value);
	
	if (isEmail(document.frmHCC.HCCEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmHCC.HCCEmail.focus();
			return false;
	}  
	}

	if ( isWhitespace(document.frmHCC.HCCTitle.value)&&isWhitespace(document.frmHCC.HCCFName.value)&&isWhitespace(document.frmHCC.HCCLName.value)&&isWhitespace(document.frmHCC.HCCLocation.value)&&isWhitespace(document.frmHCC.HCCCity.value)) { 
		alert("Please enter at least one field! ");
		return false;
	}  

	document.frmHCC.sCMD.value = "upd";
	return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ToolsValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ToolsValid() {
	if ( (document.forms[0].ToolTypeID.options[document.forms[0].ToolTypeID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter Tool Type");
	     document.forms[0].ToolTypeID.focus();
	     return false;
	}  
	if (document.forms[0].blob.value!="")	{
		myext = getExtension(document.forms[0].blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.forms[0].blob.value.focus;
		return false; 
		}
	}		
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value > 170) {
	     alert("The Image's  width is too big! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value > 60) {
	     alert("The Image's height is too big!");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (isWhitespace(document.forms[0].ToolName.value)) 
	{
	     alert("Please enter Tool Name ");
	     document.forms[0].ToolName.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     NewsValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function NewsValid() {

	if (isWhitespace(document.forms[0].NewsDate.value)) 
	{
	     alert("Please enter NewsDate ");
	     document.forms[0].NewsDate.focus();
	     return false;
	}  
//	if (isWhitespace(document.myform.NewsTitle.value)) 
//	{
//	     alert("Please enter NewsTitle");
//	     document.myform.NewsTitle.focus();
//	     return false;
//	}  

	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter News Text ");
	     document.myform.xText.focus();
	     return false;
	}  

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     PhotoValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function PhotoValid() {

	if (isWhitespace(document.forms[0].PhotoName.value)&&isWhitespace(document.forms[0].PhotoDescription.value)&&isWhitespace(document.forms[0].blob.value)) 
	{
	     alert("Please enter at least one field! ");
	     document.forms[0].blob.focus();
	     return false;
	} 
	if (document.forms[0].blob.value!="")	{
		myext = getExtension(document.forms[0].blob.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.forms[0].blob.value.focus;
		return false; 
		}
	}		
 
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].width.value > 350) {
	     alert("The Image's  width is too big! ");
	     document.forms[0].width.focus();
	     return false;
		}
	}  
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	
	if (document.forms[0].blob.value!="")	{
		if (document.forms[0].height.value > 500) {
	     alert("The Image's height is too big!");
	     document.forms[0].height.focus();
	     return false;
		}
	}  	

	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     validForm      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function validForm() {

	if (isWhitespace(document.frmContactUs.fname.value)) 
	{
	     alert("Please enter First Name");
	     document.frmContactUs.fname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.lname.value)) 
	{
	     alert("Please enter Last Name");
	     document.frmContactUs.lname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.cname.value)) 
	{
	     alert("Please enter Company Name");
	     document.frmContactUs.cname.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.address1.value)) 
	{
	     alert("Please enter Address ");
	     document.frmContactUs.address1.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.city.value)) 
	{
	     alert("Please enter City");
	     document.frmContactUs.city.focus();
	     return false;
	}  
	if ( (document.frmContactUs.state.options[document.frmContactUs.state.options.selectedIndex].value)=="0")
	{
	     alert("Please enter State");
	     document.frmContactUs.state.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.country.value)) 
	{
	     alert("Please enter Country");
	     document.frmContactUs.country.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.telephone.value)) 
	{
	     alert("Please enter Telephone ");
	     document.frmContactUs.telephone.focus();
	     return false;
	}  
	if (IsPhone(document.frmContactUs.telephone.value)==false) {
			document.frmContactUs.telephone.focus();
			return false;
	}
	
	if (isWhitespace(document.frmContactUs.email.value)) 
	{
	     alert("Please enter email ");
	     document.frmContactUs.email.focus();
	     return false;
	}  
	if (isEmail(document.frmContactUs.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmContactUs.email.focus();
			return false;
	}  
	if (isWhitespace(document.frmContactUs.comments.value)) 
	{
	     alert("Please enter Comments ");
	     document.frmContactUs.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("You entered another  Password!");
	     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;
	}
	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 (document.myform.MBusZip==false) {
			document.myform.MBusZip.focus();
			return false;
	}
	
	if (document.myform.MHomeZip.value.length>3){ 
	 if (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;
  }
  
	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  < 4) {
			alert("Please enter 4 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;
	}
	}
//	if (isWhitespace(document.myform.MExpDate.value)) 
//	{
//			alert("Please enter Expire Date");
//			document.myform.MExpDate.focus();
//			return false;
//	}	
	
//	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;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidDirST      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDirST() {

	if (isWhitespace(document.frmDirST.SubTypeName.value)) 
	{
	     alert("Please enter Type Name ");
	     document.frmDirST.SubTypeName.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidDirector      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDirector() {
	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name ");
	     document.myform.UserName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.UserPassword.value)) 
	{
	     alert("Please enter User Password ");
	     document.myform.UserPassword.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.BodFirstName.value)) 
	{
	     alert("Please enter First Name ");
	     document.myform.BodFirstName.focus();
	     return false;
	} 	
	if (isWhitespace(document.myform.BodLastName.value)) 
	{
	     alert("Please enter Last Name ");
	     document.myform.BodLastName.focus();
	     return false;
	} 	
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidBoard      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidBoard() {

	if (isWhitespace(document.myform.BodFirstName.value)) 
	{
	     alert("Please enter First Name ");
	     document.myform.BodFirstName.focus();
	     return false;
	} 	
	if (isWhitespace(document.myform.BodLastName.value)) 
	{
	     alert("Please enter Last Name ");
	     document.myform.BodLastName.focus();
	     return false;
	} 
//	if (isWhitespace(document.myform.BodCompany.value)) 
//	{
//	     alert("Please enter Company Name ");
//	     document.myform.BodCompany.focus();
//	     return false;
//	} 		
	if (document.myform.BodZip.value.length>3){ 
	 if (document.myform.BodZip==false) {
				document.myform.BodZip.focus();
				return false;
	} 
	}
	if (document.myform.BodPhone.value.length>0){ 
	if (IsPhone(document.myform.BodPhone.value)==false) {
			document.myform.BodPhone.focus();
			return false;
	}
	}	
	if (document.myform.BodFax.value.length>0){ 
	if (IsFax(document.myform.BodFax.value)==false) {
			document.myform.BodFax.focus();
			return false;
	}
	}
	if (document.myform.BodEmail.value.length>0){ 
	document.myform.BodEmail.value = NonSpace(document.myform.BodEmail.value);
	if (isEmail(document.myform.BodEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.BodEmail.focus();
			return false;
	}
	}	
	document.myform.sCMD.value = "upd";
			
	 return true;
}



//~~~~~~~      ValidListClass      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidListClass() {
	if (isWhitespace(document.forms[0].ClassListName.value)) 
	{
	     alert("Please enter Class Name");
	     document.forms[0].ClassListName.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].xText.value)) 
	{
	     alert("Please enter Class Description");
	     document.forms[0].xText.focus();
	     return false;
	}  
	if (document.forms[0].ClassListPriceM.value > 0) {
	if (ValidPrice(document.forms[0].ClassListPriceM.value)==false) {
			document.forms[0].ClassListPriceM.focus();
			return false;
	}
	}
	if (document.forms[0].ClassListPriceNM.value > 0) {
	if (ValidPrice(document.forms[0].ClassListPriceNM.value)==false) {
			document.forms[0].ClassListPriceNM.focus();
			return false;
	}
	}
	
	 return true;
}

//~~~~~~~      ValidClass      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidClass() {
	if ( (document.myform.ClassType.options[document.myform.ClassType.options.selectedIndex].value)=="0")
	{
	     alert("Please enter Class Name");
	     document.forms[0].ClassType.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].ClassLocation.value)) 
	{
	     alert("Please enter Class Location");
	     document.forms[0].ClassLocation.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].ClassAddress.value)) 
	{
	     alert("Please enter Class Address");
	     document.forms[0].ClassAddress.focus();
	     return false;
	}  
	if (document.forms[0].ClassDateStart.value.length < 1)
	{
		alert("Please, enter Class Start Date!");
		document.forms[0].ClassDateStart.focus();
		return false;
	}
	DateStart = new Date(document.forms[0].ClassDateStart.value);
	if (document.forms[0].ClassDateEnd.value.length < 1)
	{
		alert("Please, enter Class End Date!");
		document.forms[0].ClassDateEnd.focus();
		return false;
	}
	DateEnd = new Date(document.forms[0].ClassDateEnd.value);
	if (DateStart > DateEnd) {
			alert("Class End Date cannot be earlier than Class Start Date.");
			document.forms[0].ClassDateEnd.focus();
			return false;
	}	
//	if (isWhitespace(document.forms[0].SCText.value)) 
//	{
//	     alert("Please enter Class Description");
//	     document.forms[0].SCText.focus();
//	     return false;
//	}  

	if (document.forms[0].ClassPriceM.value > 0) {
	if (ValidPrice(document.forms[0].ClassPriceM.value)==false) {
			document.forms[0].ClassPriceM.focus();
			return false;
	}
	}
	if (document.forms[0].ClassPriceNM.value > 0) {
	if (ValidPrice(document.forms[0].ClassPriceNM.value)==false) {
			document.forms[0].ClassPriceNM.focus();
			return false;
	}
	}

	 return true;
}

//~~~~~~~      ValidPay      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TO DO ~~~~~~~~~~~~~~~~~~~~~

function ValidPay() {

	if (isWhitespace(document.forms[0].TAMBID.value)) 
	{
	     alert("Please enter 'TAMB ID' field");
	     document.forms[0].TAMBID.focus();
	     return false;
	} 
	if ( (document.forms[0].PayTypeID.options[document.forms[0].PayTypeID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter 'Payment with' field");
	     document.forms[0].PayTypeID.focus();
	     return false;
	}  
	if ( (document.forms[0].PayCodeID.options[document.forms[0].PayCodeID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter 'Payment for' field");
	     document.forms[0].PayCodeID.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].PayAmount.value)) 
	{
	     alert("Please enter 'Pay Amount' field");
	     document.forms[0].PayAmount.focus();
	     return false;
	} 
	if (ValidPrice(document.forms[0].PayAmount.value)==false) {
			document.forms[0].PayAmount.focus();
			return false;
	}
	if (isWhitespace(document.forms[0].PayDate.value)) 
	{
	     alert("Please enter 'Pay Date' field");
	     document.forms[0].PayDate.focus();
	     return false;
	} 
	if (isWhitespace(document.forms[0].PayStartDate.value)) 
	{
	     alert("Please enter 'Pay Start Date' field");
	     document.forms[0].PayStartDate.focus();
	     return false;
	} 
	DateStart = new Date(document.forms[0].PayStartDate.value);
	if (isWhitespace(document.forms[0].PayExpDate.value)) 
	{
	     alert("Please enter 'Pay Expire Date' field");
	     document.forms[0].PayExpDate.focus();
	     return false;
	} 	
	DateEnd = new Date(document.forms[0].PayExpDate.value);
	if (DateStart > DateEnd) {
			alert("Pay Expire Date cannot be earlier than Pay Start Date.");
			document.forms[0].PayExpDate.focus();
			return false;
	}	
	document.forms[0].sCMD.value = "upd";
	return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      DocValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function DocValid() {
	if (isWhitespace(document.forms[0].xText.value)) 
	{
	     alert("Please enter Document Text");
	     document.forms[0].xText.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     GlossaryValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function GlossaryValid() {
	if (isWhitespace(document.forms[0].xText.value)) 
	{
	     alert("Please enter Glossary Text");
	     document.forms[0].xText.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidMerchantAccounts      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMerchantAccounts() {
	if (isWhitespace(document.forms[0].MAName.value)) 
	{
	     alert("Please enter Merchant Account Name");
	     document.forms[0].MAName.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidBuss      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidBuss() {
	if (isWhitespace(document.forms[0].BussType.value)) 
	{
	     alert("Please enter Business Type");
	     document.forms[0].BussType.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     PhonesValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function PhonesValid() {
	if (isWhitespace(document.forms[0].PhoneNo.value)) 
	{
	     alert("Please enter Phone No ");
	     document.forms[0].PhoneNo.focus();
	     return false;
	}  
	if (IsPhone(document.forms[0].PhoneNo.value)==false) {
			document.forms[0].PhoneNo.focus();
			return false;
	}
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidUserTypes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidUserTypes() {

	if (isWhitespace(document.forms[0].UserTypeName.value)) 
	{
	     alert("Please enter User Type Name ");
	     document.forms[0].UserTypeName.focus();
	     return false;
	}  
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayCodes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayCodes() {

	if (isWhitespace(document.forms[0].PCName.value)) 
	{
	     alert("Please enter Pay Code Name ");
	     document.forms[0].PCName.focus();
	     return false;
	} 
	if (isNumber1(document.forms[0].PCDayLimit.value)==false) {
			document.forms[0].PCDayLimit.focus();
			return false;
	}
	if (ValidPrice(document.forms[0].PCAmount.value)==false) {
			document.forms[0].PCAmount.focus();
			return false;
	}
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidDow     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDow() {
	document.myform.sCMD.value = "upd";
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidToolTypes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidToolTypes() {

	if (isWhitespace(document.forms[0].TTName.value)) 
	{
	     alert("Please enter Tool Type ");
	     document.forms[0].TTName.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPhotoTypes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPhotoTypes() {

	if (isWhitespace(document.forms[0].PhType.value)) 
	{
	     alert("Please enter Photo Gallery Type ");
	     document.forms[0].PhType.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayTypes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayTypes() {

	if (isWhitespace(document.forms[0].PayTypeName.value)) 
	{
	     alert("Please enter Pay Type ");
	     document.forms[0].PayTypeName.focus();
	     return false;
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidMembership     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMembership() {

	if (isWhitespace(document.forms[0].MCodeTypeName.value)) 
	{
	     alert("Please enter Membership Type ");
	     document.forms[0].MCodeTypeName.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].MCodeAmount.value)) 
	{
	     alert("Please enter Membership Amount ");
	     document.forms[0].MCodeAmount.focus();
	     return false;
	}  
	if (isNumber1(document.forms[0].MCodeAmount.value)==false) {
			document.forms[0].MCodeAmount.focus();
			return false;
	}
	
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidChapterFunctions     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidChapterFunctions() {

	if (isWhitespace(document.forms[0].ChFuncName.value)) 
	{
	     alert("Please enter Chapter Function ");
	     document.forms[0].ChFuncName.focus();
	     return false;
	}  

	if (document.forms[0].ChFuncOrder.value.length>0){ 
		if (isNumber1(document.forms[0].ChFuncOrder.value)==false) {
				document.forms[0].ChFuncOrder.focus();
				return false;
		}
	}
	if (document.forms[0].ChFuncOrderCounty.value.length>0){ 
		if (isNumber1(document.forms[0].ChFuncOrderCounty.value)==false) {
				document.forms[0].ChFuncOrderCounty.focus();
				return false;
		}
	}
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidDirT     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDirT() {

	if (isWhitespace(document.forms[0].DirType.value)) 
	{
	     alert("Please enter Web Page Name ");
	     document.forms[0].DirType.focus();
	     return false;
	}  

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayM     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayM() {
	document.myform.sCMD.value = "upd";
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidPayE     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPayE() {
	document.myform.sCMD.value = "upd";
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidRefunds     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidRefunds() {
	if (isWhitespace(document.myform.TAMBID.value)) 
	{
	     alert("Please enter Member ID");
	     document.myform.TAMBID.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.RefundsAmount.value)) 
	{
	     alert("Please enter amount requested");
	     document.myform.RefundsAmount.focus();
	     return false;
	}  
	if (document.myform.RefundsAmount.value.length>0){ 
		if (ValidPrice(document.myform.RefundsAmount.value)==false) {
				document.myform.RefundsAmount.focus();
				return false;
		}
		}

	document.myform.sCMD.value = "upd";
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidMCC     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMCC() {
	if (isWhitespace(document.myform.MID.value)) 
	{
	     alert("Please enter Member ID");
	     document.myform.MID.focus();
	     return false;
	}  
	if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.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 (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;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidECC     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidECC() {
	if (document.myform.MemberID.value=="" || document.myform.MemberID.value=="0") 
	{
	     alert("Please enter Exhibitor ID");
	     document.myform.MemberID.focus();
	     return false;
	}  
	if (isNumber1(document.myform.MemberID.value)==false) {
			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 (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;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidFloorplanes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFloorplanes() {

	if (isWhitespace(document.myform.FLLocationName.value)) 
	{
	     alert("Please enter Booth Name ");
	     document.myform.FLLocationName.focus();
	     return false;
	} 
	if (isWhitespace(document.myform.FLLocationPrice.value)) 
	{
	     alert("Please enter Booth Price ");
	     document.myform.FLLocationPrice.focus();
	     return false;
	} 
	if (ValidPrice(document.myform.FLLocationPrice.value)==false) {
			document.myform.FLLocationPrice.focus();
			return false;
	}
	 
	document.myform.sCMD.value = "upd";
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidLoc     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidLoc() {
	if (isWhitespace(document.myform1.FLLocationName.value)) 
	{
	     alert("Please enter Floorplane Location Name ");
	     document.myform1.FLLocationName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform1.FLLocationPrice.value)) 
	{
	     alert("Please enter Floorplane Location Price ");
	     document.myform1.FLLocationPrice.focus();
	     return false;
	}  	
	document.myform1.sCMD.value = "add";
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidCC     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCC() {
	if (isWhitespace(document.myform.CCTypeName.value)) 
	{
	     alert("Please enter Credit Card Type");
	     document.myform.CCTypeName.focus();
	     return false;
	}  
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidSponsorship     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSponsorship() {
	if (isWhitespace(document.myform.SPName.value)) 
	{
	     alert("Please enter Sponsorship Type!");
	     document.myform.SPName.focus();
	     return false;
	}  
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidCPS     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCPS() {
	if (isWhitespace(document.myform.CPSName.value)) 
	{
	     alert("Please enter Sponsorship Level!");
	     document.myform.CPSName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.CPSAmount.value)) 
	{
	     alert("Please enter Sponsorship Amount!");
	     document.myform.CPSAmount.focus();
	     return false;
	}  
	if (ValidPrice(document.myform.CPSAmount.value)==false) {
			document.myform.CPSAmount.focus();
			return false;
	}
	
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidFL     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFL() {

	document.myform.sCMD.value = "upd";
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidDuePayments     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDuePayments() {

	if ( (document.forms[0].PayTypeID.options[document.forms[0].PayTypeID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter 'Payment with' field");
	     document.forms[0].PayTypeID.focus();
	     return false;
	}  
	if ( (document.forms[0].PayCodeID.options[document.forms[0].PayCodeID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter 'Payment for' field");
	     document.forms[0].PayCodeID.focus();
	     return false;
	}  
	if (isWhitespace(document.forms[0].PayAmount.value)) 
	{
	     alert("Please enter 'Pay Amount' field");
	     document.forms[0].PayAmount.focus();
	     return false;
	} 
	if (ValidPrice(document.forms[0].PayAmount.value)==false) {
			document.forms[0].PayAmount.focus();
			return false;
	}
	if (isWhitespace(document.forms[0].PayDate.value)) 
	{
	     alert("Please enter 'Pay Date' field");
	     document.forms[0].PayDate.focus();
	     return false;
	} 
	if (isWhitespace(document.forms[0].PayStartDate.value)) 
	{
	     alert("Please enter 'Pay Start Date' field");
	     document.forms[0].PayStartDate.focus();
	     return false;
	} 
	DateStart = new Date(document.forms[0].PayStartDate.value);
	if (isWhitespace(document.forms[0].PayExpDate.value)) 
	{
	     alert("Please enter 'Pay Expire Date' field");
	     document.forms[0].PayExpDate.focus();
	     return false;
	} 	
	DateEnd = new Date(document.forms[0].PayExpDate.value);
	if (DateStart > DateEnd) {
			alert("Pay Expire Date cannot be earlier than Pay Start Date.");
			document.forms[0].PayExpDate.focus();
			return false;
	}	

	if (document.myform.PayNewMemberAmount.value !=0){ 
	if (ValidPrice(document.myform.PayNewMemberAmount.value)==false) {
			document.myform.PayNewMemberAmount.focus();
			return false;
	}
	}
	if (document.myform.PayNAMBAmount.value!=0){ 
	if (ValidPrice(document.myform.PayNAMBAmount.value)==false) {
			document.myform.PayNAMBAmount.focus();
			return false;
	}
	}
	if (document.myform.PayTAMBAmount.value!=0){ 
	if (ValidPrice(document.myform.PayTAMBAmount.value)==false) {
			document.myform.PayTAMBAmount.focus();
			return false;
	}
	}
	if (document.myform.PayLocalAmount.value >0){ 
	if (ValidPrice(document.myform.PayLocalAmount.value)==false) {
			document.myform.PayLocalAmount.focus();
			return false;
	}
	}
	if (document.myform.PayGovtAmount.value >0){ 
	if (ValidPrice(document.myform.PayGovtAmount.value)==false) {
			document.myform.PayGovtAmount.focus();
			return false;
	}
	}
	if (document.myform.PayStatewideSponsorDueAmount.value >0){ 
	if (ValidPrice(document.myform.PayStatewideSponsorDueAmount.value)==false) {
			document.myform.PayStatewideSponsorDueAmount.focus();
			return false;
	}
	}
	if (document.myform.PayStatewideSponsorAmount.value >0){ 
	if (ValidPrice(document.myform.PayStatewideSponsorAmount.value)==false) {
			document.myform.PayStatewideSponsorAmount.focus();
			return false;
	}
	}
	if (document.myform.PayBalanceDue.value >0){ 
	if (ValidPrice(document.myform.PayBalanceDue.value)==false) {
			document.myform.PayBalanceDue.focus();
			return false;
	}
	}



	document.myform.sCMD.value = "upd";
	 return true;
}

function ValidB() {

	document.myform.sCMD.value = "func";
	 return true;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidMP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMP()
{
	var radio_choice = false;

	if (document.myform.Pay.checked==true)
	radio_choice = true; 

	for (counter = 0;  counter < document.myform.Pay.length; counter++)
	{
		if (document.myform.Pay[counter].checked)
		radio_choice = true; 
	}
	if (!radio_choice)
	{
		alert("Please select one Payment.")
		return (false);
	}
		document.myform.action = "MakePayments.asp";
		document.myform.submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidFormTypes     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFormTypes() {
	if (isWhitespace(document.myform.FormTypeName.value)) 
	{
	     alert("Please enter Category Name");
	     document.myform.FormTypeName.focus();
	     return false;
	}  
	document.myform.sCMD.value = "upd";
	 return true;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidExhibitions      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidExhibitions() {
	if (isWhitespace(document.myformUpload.ExhibName.value)) 
	{
	     alert("Please enter  Exhibition Name ");
	     document.myformUpload.ExhibName.focus();
	     return false;
	}  
	if (isWhitespace(document.myformUpload.ExhibStartDate.value)) 
	{
	     alert("Please enter Start Date ");
	     document.myformUpload.ExhibStartDate.focus();
	     return false;
	}  
	DateStart = new Date(document.myformUpload.ExhibStartDate.value);
	if (isWhitespace(document.myformUpload.ExhibEndDate.value)) 
	{
	     alert("Please enter End Date ");
	     document.myformUpload.ExhibEndDate.focus();
	     return false;
	} 	
	DateEnd = new Date(document.myformUpload.ExhibEndDate.value);
	if (DateStart > DateEnd) {
			alert("Exhibition End Date cannot be earlier than Exhibition Start Date.");
			document.myformUpload.ExhibEndDate.focus();
			return false;
	}	
	if ( (document.myformUpload.ExhibStateID.options[document.myformUpload.ExhibStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State");
			document.myformUpload.ExhibStateID.focus();
			return false;
	}
	if (isWhitespace(document.myformUpload.ExhibCity.value)) 
	{
	     alert("Please enter City ");
	     document.myformUpload.ExhibCity.focus();
	     return false;
	} 
	if (isWhitespace(document.myformUpload.ExhibAddress.value)) 
	{
	     alert("Please enter Address ");
	     document.myformUpload.ExhibAddress.focus();
	     return false;
	} 
	
	if (isWhitespace(document.myformUpload.ExhibMemberFee.value)) 
	{
	     alert("Please enter Member Fee ");
	     document.myformUpload.ExhibMemberFee.focus();
	     return false;
	} 
	
	if (ValidPrice(document.myformUpload.ExhibMemberFee.value)==false) {
			document.myformUpload.ExhibMemberFee.focus();
			return false;
	}
	
	
	if (isWhitespace(document.myformUpload.ExhibNonMemberFee.value)) 
	{
	     alert("Please enter Non Member Fee ");
	     document.myformUpload.ExhibNonMemberFee.focus();
	     return false;
	}
	
	if (ValidPrice(document.myformUpload.ExhibNonMemberFee.value)==false) {
			document.myformUpload.ExhibNonMemberFee.focus();
			return false;
	}
	
	
	if (isWhitespace(document.myformUpload.ExhibComplReg.value)) 
	{
	     alert("Please enter Complementary Registration Fee ");
	     document.myformUpload.ExhibComplReg.focus();
	     return false;
	}
	
	if (ValidPrice(document.myformUpload.ExhibComplReg.value)==false) {
			document.myformUpload.ExhibComplReg.focus();
			return false;
	}
	
	if (isWhitespace(document.myformUpload.ExhibFulllReg.value)) 
	{
	     alert("Please enter Full Convention Registration Fee ");
	     document.myformUpload.ExhibFulllReg.focus();
	     return false;
	}
	if (ValidPrice(document.myformUpload.ExhibFulllReg.value)==false) {
			document.myformUpload.ExhibFulllReg.focus();
			return false;
	}

/*	for (counter = 0;  counter < document.myformUpload.RegID.length; counter++){
		if (document.myformUpload.RegFee[counter].value>0){
			if (ValidPrice(document.myformUpload.RegFee[counter].value)==false) {
					return false;}	
		}
		if (document.myformUpload.RegFee2[counter].value>0){
			if (ValidPrice(document.myformUpload.RegFee2[counter].value)==false) {
					return false;}
		}
	}*/

	if (isWhitespace(document.myformUpload.ExhibRegSpouseFee.value)) 
	{
	     alert("Please enter Spouse Registration Fee!");
	     document.myformUpload.ExhibRegSpouseFee.focus();
	     return false;
	}
	if (ValidPrice(document.myformUpload.ExhibRegSpouseFee.value)==false) {
			document.myformUpload.ExhibRegSpouseFee.focus();
			return false;
	}
	
	if (isWhitespace(document.myformUpload.ExhibDinner.value)) 
	{
	     alert("Please enter Presidents Reception and Dinner Fee: ");
	     document.myformUpload.ExhibDinner.focus();
	     return false;
	}
	if (ValidPrice(document.myformUpload.ExhibDinner.value)==false) {
			document.myformUpload.ExhibDinner.focus();
			return false;
	}
	if (isWhitespace(document.myformUpload.ExhibGolfFee.value)) 
	{
	     alert("Please enter Golf Tournament Fee: ");
	     document.myformUpload.ExhibGolfFee.focus();
	     return false;
	}
	if (ValidPrice(document.myformUpload.ExhibGolfFee.value)==false) {
			document.myformUpload.ExhibGolfFee.focus();
			return false;
	}
		
	document.myformUpload.sCMD.value = "upd";
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidAttendees      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidAttendees() {
	if (document.myform.MID.value.length>0){ 
	if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
	}
	}
	if (isWhitespace(document.myform.NMFullName.value)) 
	{
	     alert("Please enter Full Name ");
	     document.myform.NMFullName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NMCompany.value)) 
	{
	     alert("Please enter  Company ");
	     document.myform.NMCompany.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NMAddress.value)) 
	{
	     alert("Please enter Address ");
	     document.myform.NMAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NMCity.value)) 
	{
	     alert("Please enter City ");
	     document.myform.NMCity.focus();
	     return false;
	}  
	if ( (document.myform.NMStateID.options[document.myform.NMStateID.options.selectedIndex].value)=="0")
	{
			alert("Please enter State");
			document.myform.NMStateID.focus();
			return false;
	}
	if (document.myform.NMZip.value.length>3){ 
	 if (document.myform.NMZip==false) {
				document.myform.NMZip.focus();
				return false;
	} 
	}
	if (document.myform.NMPhone.value.length>0){ 
	if (IsPhone(document.myform.NMPhone.value)==false) {
			document.myform.NMPhone.focus();
			return false;
	}
	}	
	if (document.myform.NMFax.value.length>0){ 
	if (IsFax(document.myform.NMFax.value)==false) {
			document.myform.NMFax.focus();
			return false;
	}
	}
	if (document.myform.NMEmail.value.length>0){ 
	document.myform.NMEmail.value = NonSpace(document.myform.NMEmail.value);
	if (isEmail(document.myform.NMEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.NMEmail.focus();
			return false;
	}
	}
	document.myform.sCMD.value = "upd";
	 return true;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidDues     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDues() {
	if (isWhitespace(document.myform.DueName.value)) 
	{
	     alert("Please enter Type ");
	     document.myform.DueName.focus();
	     return false;
	}  
	if ( (document.myform.DueMembershipTypeID.options[document.myform.DueMembershipTypeID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Membership Type");
			document.myform.DueMembershipTypeID.focus();
			return false;
	}
	if ( (document.myform.DueStatusID.options[document.myform.DueStatusID.options.selectedIndex].value)=="0")
	{
			alert("Please enter Status");
			document.myform.DueStatusID.focus();
			return false;
	}
	if (document.myform.DueNew.value !=0){ 
	if (ValidPrice(document.myform.DueNew.value)==false) {
			document.myform.DueNew.focus();
			return false;
	}
	}
	if (document.myform.DueNAMB.value !=0){ 
	if (ValidPrice(document.myform.DueNAMB.value)==false) {
			document.myform.DueNAMB.focus();
			return false;
	}
	}
	if (document.myform.DueTAMB.value !=0){ 
	if (ValidPrice(document.myform.DueTAMB.value)==false) {
			document.myform.DueTAMB.focus();
			return false;
	}
	}
	if (document.myform.DueLocal.value !=0){ 
	if (ValidPrice(document.myform.DueLocal.value)==false) {
			document.myform.DueLocal.focus();
			return false;
	}
	}
	if (document.myform.DueTotal.value !=0){ 
	if (ValidPrice(document.myform.DueTotal.value)==false) {
			document.myform.DueTotal.focus();
			return false;
	}
	}
	 return true;
}






//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidSearchM      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSearchM() {

	var theForm = document.forms[0];
	var nr = theForm.length;
	var cod = 0;

	for (i=0; i<nr; i++){
		if (theForm.elements[i].type != "hidden" && theForm.elements[i].type != "submit" && theForm.elements[i].type != "radio" ){
//		alert(theForm.elements[i].value+theForm.elements[i].name);
			if (theForm.elements[i].value != "" && theForm.elements[i].value != "0"){cod = 1;}
		}
	}
		if (cod == 0) {
			alert("Please, fill at least one field to Search!");
			theForm.AccountName.focus();
			return false;
		}			
	if (document.myform.MID.value.length>0){ 
	if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.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;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      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));
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      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 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 ValidPrice(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 Price");
				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 isInt(chr)           
{
	if (isNaN(chr))
	{return false; }
	else
	  {
		if (chr>0)
		{ return true;	}
		else
		  { return false; }	  
	   }
}


function IsOK(val) {
	CharRep = /,/gi;
	newstr=val.replace(CharRep," ");
	return newstr;
}

function IsOKNumber(val) {
	CharRep = /,/gi;
	newstr=val.replace(CharRep,"");
	return newstr;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~   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].ID.value = ID;
		document.forms[0].action = url;
		document.forms[0].submit();
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDel1      ~~~~~~~~~~~~~~~~~~~~  FOR PAYMENT  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDel1(url,ID,Code)   
{
	if (confirm("This Record will be deleted! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "del";
		document.forms[0].action = url;
		document.forms[0].ID.value = ID;
		document.forms[0].Code.value = Code;
		document.forms[0].submit();
		}
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDel2      ~~~~~~~~~~~~~~~~~~~~  FOR PAYMENT  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDel2(url,PayID)   
{
	if (confirm("This Record will be deleted! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "del";
		document.forms[0].action = url;
		document.forms[0].PayID.value = PayID;
		document.forms[0].submit();
		}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goMod1      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  FOR PAYMENT  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goMod1(url,ID,Code,PayMembers)   
{
		document.forms[0].sCMD.value = "edit";
		document.forms[0].action = url;
		document.forms[0].ID.value = ID;
		document.forms[0].Code.value = Code;
		document.forms[0].PayMembers.value = PayMembers;
		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();
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goUpdM     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goUpdM(MemberID){

	if (isWhitespace(document.myform.MID.value)) {
			alert("You must enter TAMB ID! ");
	
			document.myform.MID.focus();
			return false;
	}
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)==false) {
			document.myform.MID.focus();
			return false;
		}
	}
	if ((document.myform.MCode[1].checked) && (document.myform.MID.value=='' || document.myform.MID.value=="0" ))   { 
			alert("For TAMB Member - TAMB ID must be completed! ");
			document.myform.MID.focus();
			return false;
   }	
	if ((document.myform.MCode[0].checked) && (document.myform.MID.value!='' && document.myform.MID.value!="0" ))   { 
			alert("For Non TAMB Member - TAMB ID must be 0! ");
			document.myform.MID.focus();
			return false;
   }	
	if (!(isWhitespace(document.myform.MID.value))) {
		if (isNumber2(document.myform.MID.value)) {
			document.myform.sCMD.value = "edit";
			document.myform.MemberID.value =MemberID;
			document.myform.submit();
		}
	}
	
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goChange    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goChange(code){
	document.myform.sCMD.value = "edit";
	document.myform.VCode.value =code;
	document.myform.submit();

}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubmi      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubmi()
{
		document.forms[0].sCMD.value = "upd";
		document.forms[0].ED.value = "edit";
		document.forms[0].submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSub      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSub(url,xID,act)
{
		document.myform1.sCMD.value = act;
		document.myform1.IDLoc.value = xID;
		document.myform1.action = url;
		document.myform1.submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubm      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubm(xID)
{
		document.forms[0].ID.value = xID;
		document.forms[0].submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubA      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubA()
{
	if (document.myform.MID.value.length>0){ 
		if (isNumber2(document.myform.MID.value)==false) {
				document.myform.MID.focus();
				return false;
		}
	}
	document.myform.sCMD.value = "add";
	document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubE      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubE()
{
	if (document.myform.MemberID.value.length>0){ 
		if (isNumber2(document.myform.MemberID.value)==false) {
				document.myform.MemberID.focus();
				return false;
		}
	}
	document.myform.sCMD.value = "add";
	document.myform.submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSort      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSort(url,sSortBy,sSortOrd)
{
//		document.forms[0].sCMD.value = "sort";
		document.forms[0].action = url;
		document.forms[0].SortBy.value  = sSortBy;
		document.forms[0].SortOrd.value = sSortOrd;

		document.forms[0].submit( );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSortX      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSortX(url,sSortBy,TAMBID,sSortOrd)
{
//		document.forms[0].sCMD.value = "sort";
		document.forms[0].action = url;
		document.forms[0].MID.value  = TAMBID;
		document.forms[0].SortBy.value  = sSortBy;
		document.forms[0].SortOrd.value = sSortOrd;

		document.forms[0].submit( );
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goModE      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goModE(url,ID)   
{
		document.forms[0].sCMD.value = "edit";
		document.forms[0].action = url;
		document.forms[0].StaffID.value = ID;
		document.forms[0].submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goAddE      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goAddE(url)   
{

		document.forms[0].sCMD.value = "add";
		document.forms[0].StaffID.value = "";
		document.forms[0].action = url;
		document.forms[0].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();
		}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goAssign       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goAssign(FAID,LocID)
{
		document.forms[0].sCMD.value = "upd";
		document.forms[0].FAID.value = FAID;
		document.forms[0].LocatID.value = LocID;
		document.forms[0].submit( );
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidAssign      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidAssign()
{
	var number = 0;
	
	if (document.myform.FAAssigned){
		if (isInt(document.myform.FAAssigned.length)==false) {
				
				number = number + 1;}
	
		if (isInt(document.myform.FAAssigned.length)==true) {
		
			for (counter = 0;  counter < document.myform.FAAssigned.length; counter++){

				if (document.myform.FAAssigned[counter].checked)
				number = number +1;}
		}		
	}
	if (number=="0")
	{
		alert("Please make assignment!")
		return (false);
	}
	if (number > 2 )
	{
		alert("Please select only two Booths!")
		return (false);
	}

	document.myform.sCMD.value = "upd";
	return true;
}




function StartX(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}


function Start(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=550,height=250,top=10,left=10");
}


