function printreport() {
 if (window.print) {
  setTimeout('window.print();',200);
 }
 else {
  alert("Press 'Ctrl+p' or 'Cmd+p' on your keyboard to print report.");
 }
}

function reloadContent(xID) {
	document.location.href="ContentManager.asp?sCMD=edit&ID="+xID;
	return true;
}


function reloadNewsLetters(ID) {
	document.location.href="NewsLetters.asp?sCMD=edit&ID="+ID;
	return true;
}



// on check/uncheck [Mask password] checkbox
function doChangePasswordElement(blnMask)
{
	if(blnMask) 
	{
		document.getElementById("UserPassword").value = document.getElementById("UserPasswordText").value;
		document.getElementById("dPassword").style.visibility = "visible";
		document.getElementById("dPasswordText").style.visibility = "hidden";
	}
	else
	{
		document.getElementById("UserPasswordText").value = document.getElementById("UserPassword").value;
		document.getElementById("dPassword").style.visibility = "hidden";
		document.getElementById("dPasswordText").style.visibility = "visible";
	}
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      LoginValid      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function LoginValid() {

	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name!  ");
	     document.myform.UserName.focus();
	     return false;
	}  

	if (document.myform.UserName.value.length < 4) 
	{
	     alert("The Minimum length for User Name should be 4!");
	     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 < 4) 
	 {
	     alert("The Minimum length for Password should be 4!");
	     document.myform.UserPassword.focus();
	     return false;
	 }
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidUser      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidUser() {

	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name!  ");
	     document.myform.UserName.focus();
	     return false;
	}  

	if (document.myform.UserName.value.length < 4) 
	{
	     alert("The Minimum length for User Name should be 4!");
	     document.myform.UserName.focus();
	     return false;
	 }

	if (document.getElementById("dPassword").style.visibility == "visible")
	{	
		if (isWhitespace(document.myform.UserPassword.value)) 
		{
			alert("Please enter User Password! ");
			document.myform.UserPassword.focus();
			return false;
		}
		
		if (document.myform.UserPassword.value.replace( / /g, "").length < 4) 
		{
			alert("The Minimum length for Password should be 4!");
			document.myform.UserPassword.focus();
			return false;
		}
	}
	else
	{	 
		if (isWhitespace(document.myform.UserPasswordText.value)) 
		{
			alert("Please enter User Password! ");
			document.myform.UserPasswordText.focus();
			return false;
		}
		
		if (document.myform.UserPasswordText.value.replace( / /g, "").length < 4) 
		{
			alert("The Minimum length for Password should be 4!");
			document.myform.UserPasswordText.focus();
			return false;
		}
		document.getElementById("UserPassword").value = document.getElementById("UserPasswordText").value;
	}  
	
	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;
	}  
	}
	 return true;
}



//________________________________________________________________________________________
//__________     ValidEvents    _________________________________________________________________

function ValidEvents() {

	if (isWhitespace(document.myform.EventTitle.value)) 
	{
	     alert("Please enter Event Title!  ");
	     document.myform.EventTitle.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.EventDescription.value)) 
	{
	     alert("Please enter Event Small Description!  ");
	     document.myform.EventDescription.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.EventStartDate.value)) 
	{
	     alert("Please enter Event Start  Date!  ");
	     document.myform.EventStartDate.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.EventEndDate.value)) 
	{
	     alert("Please enter Event End Date!  ");
	     document.myform.EventEndDate.focus();
	     return false;
	}  
	DateStart = new Date(document.myform.EventStartDate.value);
	DateEnd   = new Date(document.myform.EventEndDate.value);
	if (DateStart > DateEnd) {
			alert("Event End Date cannot be earlier than Event Start Date!");
			document.myform.EventEndDate.focus();
			return false;
	}	
	if (isWhitespace(document.myform.EventInfo.value)) 
	{
	     alert("Please enter Event Description!  ");
	     document.myform.EventInfo.focus();
	     return false;
	}  
/*
	if (document.myform.ImageSm.value!="")	{
		myext = getExtension(document.myform.ImageSm.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg")  && (myext != "jpe") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.ImageSm.value.focus;
		return false; 
		}
	}	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value > 70) {
	     alert("The Small Image's  width is too big! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value > 50) {
	     alert("The Small Image's  height is too big! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  
	
	if (document.myform.Image.value!="")	{
		if (document.myform.ImageSm.value="")	{
	     alert("Please, Upload a Small Image ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  	  		
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg")&& (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  

	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value > 450) {
	     alert("The Large Image's width is too big! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value > 450) {
	     alert("The Large Image's height is too big! ");
	     document.myform.height.focus();
	     return false;
		}
	}  
	if ( !(isWhitespace(document.myform.Image.value)) || !(isWhitespace(document.myform.xEventImgLarge.value)) )	{
		if ( isWhitespace(document.myform.ImageSm.value) && isWhitespace(document.myform.xEventImgSmall.value) )	{
	     alert("Please, Upload a Small Image ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	*/
	if (!(isWhitespace(document.myform.EventGenOrder.value))){
		if (isNumber1(document.myform.EventGenOrder.value)==false) {
			document.myform.EventGenOrder.focus();
			return false;
		}
	}			
	if (!(isWhitespace(document.myform.EventMailOrder.value))){
		if (isNumber1(document.myform.EventMailOrder.value)==false) {
			document.myform.EventMailOrder.focus();
			return false;
		}
	}	
	if (document.myform.EventMailOrder.value>0){
		if (document.myform.EventMail.checked==false) {
		    alert("Please, check 'Appears on Event Mail'! ");
			document.myform.EventMail.focus();
			return false;
		}
	}	
	if (document.myform.EventMail.checked==true) {
		if (document.myform.EventMailOrder.value<1){
		    alert("Please, enter 'Order on Event Mail'! ");
			document.myform.EventMailOrder.focus();
			return false;
		}
	}	
	if (!(isWhitespace(document.myform.EventFPOrder.value))){
		if (isNumber1(document.myform.EventFPOrder.value)==false) {
			document.myform.EventFPOrder.focus();
			return false;
		}
	}	
	if (document.myform.EventFPOrder.value>0){
		if (document.myform.EventFPage.checked==false) {
		    alert("Please, check 'Appears on First Page'! ");
			document.myform.EventFPage.focus();
			return false;
		}
	}	
	if (document.myform.EventFPage.checked==true) {
		if (document.myform.EventFPOrder.value<1){
		    alert("Please, enter 'Order on First Page'! ");
			document.myform.EventFPOrder.focus();
			return false;
		}
	}	

	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidNews    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNews() {

	if (isWhitespace(document.myform.NewsFullTitle.value)) 
	{
	     alert("Please enter News Full Title!  ");
	     document.myform.NewsFullTitle.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NewsShortTitle.value)) 
	{
	     alert("Please enter News Short Title!  ");
	     document.myform.NewsShortTitle.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NewsAuthor.value)) 
	{
	     alert("Please enter News Author!  ");
	     document.myform.NewsAuthor.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NewsDate.value)) 
	{
	     alert("Please enter News Date!  ");
	     document.myform.NewsDate.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NewsEndDate.value)) 
	{
	     alert("Please enter News End Date!  ");
	     document.myform.NewsEndDate.focus();
	     return false;
	}  
	DateStart = new Date(document.myform.NewsDate.value);
	DateEnd  = new Date(document.myform.NewsEndDate.value);
	if (DateStart > DateEnd) {
			alert("News End Date cannot be earlier than News Start Date!");
			document.myform.NewsEndDate.focus();
			return false;
	}	
	if (isWhitespace(document.myform.NewsBodySmall.value)) 
	{
	     alert("Please enter News Body Small!  ");
	     document.myform.NewsBodySmall.focus();
	     return false;
	}  
	/*
	if (isWhitespace(document.myform.NewsBody.value)) 
	{
	     alert("Please enter News Body!  ");
	     document.myform.NewsBody.focus();
	     return false;
	}  
	if (document.myform.ImageSm.value!="")	{
		myext = getExtension(document.myform.ImageSm.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg")  && (myext != "jpe") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.ImageSm.value.focus;
		return false; 
		}
	}	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value > 70) {
	     alert("The Small Image's width is too big! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  		
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value > 50) {
	     alert("The Small Image's height is too big! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg")&& (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value > 450) {
	     alert("The Large Image's width is too big! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value > 450) {
	     alert("The Large Image's height is too big! ");
	     document.myform.height.focus();
	     return false;
		}
	}  
	if ( !(isWhitespace(document.myform.Image.value)) || !(isWhitespace(document.myform.xNewsImgLarge.value)) )	{
		if ( isWhitespace(document.myform.ImageSm.value) && isWhitespace(document.myform.xNewsImgSmall.value) )	{
	     alert("Please, Upload a Small Image ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	
	if (document.myform.ImagePdf.value!="")	{
		myext = getExtension(document.myform.ImagePdf.value);
		if (myext != "pdf"){
				alert ("Please Upload a PDF File!");
				document.myform.ImagePdf.value.focus;
		return false; 
		}
	}
	*/	
	if (!(isWhitespace(document.myform.NewsMailOrder.value))){
		if (isNumber1(document.myform.NewsMailOrder.value)==false) {
			document.myform.NewsMailOrder.focus();
			return false;
		}
	}	
	if (document.myform.NewsMailOrder.value>0){
		if (document.myform.NewsMail.checked==false) {
		    alert("Please, check 'Appears on News Mail'! ");
			document.myform.NewsMail.focus();
			return false;
		}
	}	
	if (document.myform.NewsMail.checked==true) {
		if (document.myform.NewsMailOrder.value<1){
		    alert("Please, enter 'Order on News Mail'! ");
			document.myform.NewsMailOrder.focus();
			return false;
		}
	}	
	if (!(isWhitespace(document.myform.NewsFPOrder.value))){
		if (isNumber1(document.myform.NewsFPOrder.value)==false) {
			document.myform.NewsFPOrder.focus();
			return false;
		}
	}	
	if (document.myform.NewsFPOrder.value>0){
		if (document.myform.NewsFPage.checked==false) {
		    alert("Please, check 'Appears on First Page'! ");
			document.myform.NewsFPage.focus();
			return false;
		}
	}	
	if (document.myform.NewsFPage.checked==true) {
		if (document.myform.NewsFPOrder.value<1){
		    alert("Please, enter 'Order on First Page'! ");
			document.myform.NewsFPOrder.focus();
			return false;
		}
	}			
	 return true;
}


 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidNG     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNG() {
	if ((isWhitespace(document.myform.xImage.value)) && (isWhitespace(document.myform.hidImg.value)))
	{
	     alert("Please upload Image!");
	     return false;
	}   
	/*
	if (isWhitespace(document.myform.Image.value) && isWhitespace(document.myform.xImage.value) )
	{
	     alert("Please upload Image!");
	     document.myform.Image.focus();
	     return false;
	}  

	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value > 600) {
	     alert("The Large Image's  width is too big! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value > 600) {
	     alert("The Large Image's height is too big!");
	     document.myform.height.focus();
	     return false;
		}
	}  		
	if (!(isWhitespace(document.myform.NsImgOrder.value))) 	{
		if (isNumber1(document.myform.NsImgOrder.value)==false) {
			document.myform.NsImgOrder.focus();
			return false;
		}
	} */
	 
}







 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidReg      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidReg() {

	if (isWhitespace(document.myform.UserName.value)) 
	{
	     alert("Please enter User Name!  ");
	     document.myform.UserName.focus();
	     return false;
	}  

	if (document.myform.UserName.value.length < 4) 
	{
	     alert("The Minimum length for User Name should be 4!");
	     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 < 4) 
	 {
	     alert("The Minimum length for Password should be 4!");
	     document.myform.UserPassword.focus();
	     return false;
	 }
	 
	if (document.myform.UserPassword.value.length>0){ 
	if (isWhitespace(document.myform.UserPassword1.value)) 
	{
	     alert("Please Confirm User Password! ");
	     document.myform.UserPassword1.focus();
	     return false;
	}  
	}
	 
	if (document.myform.UserPassword.value.length>0){ 
	document.myform.UserPassword.value = NonSpace(document.myform.UserPassword.value);
	document.myform.UserPassword1.value= NonSpace(document.myform.UserPassword1.value);

	if (document.myform.UserPassword.value!=document.myform.UserPassword1.value) {
	     alert("Please Confirm User Password! ");
	     document.myform.UserPassword1.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;
	}  
	}
	 return true;
}




 
 
 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidSend()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSend() {

	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;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidUpload      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidUpload() {

		if (document.myform.Image1.value!="")	{
			myext = getExtension(document.myform.Image1.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
					alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
					document.myform.Image1.value.focus;
			return false; 
			}
		}		
		if (document.myform.Image1.value!="")	{
			if (document.myform.width1.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.width1.focus();
		     return false;
			}
		}  
		if (document.myform.Image1.value!="")	{
			if (document.myform.height1.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.heigh1t.focus();
		     return false;
			}
		}  

		if (document.myform.Image2.value!="")	{
			myext = getExtension(document.myform.Image2.value);
			if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
					alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
					document.myform.Image2.value.focus;
			return false; 
			}
		}		
		if (document.myform.Image2.value!="")	{
			if (document.myform.width2.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.width2.focus();
		     return false;
			}
		}  
		if (document.myform.Image2.value!="")	{
			if (document.myform.height2.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.height2.focus();
		     return false;
			}
		}  	
		if (document.myform.Image3.value!="")	{
			myext = getExtension(document.myform.Image3.value);
			if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
					alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
					document.myform.Image3.value.focus;
			return false; 
			}
		}		
		if (document.myform.Image3.value!="")	{
			if (document.myform.width3.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.width3.focus();
		     return false;
			}
		}  
		if (document.myform.Image3.value!="")	{
			if (document.myform.height3.value ==0) {
		     alert("Please, push the button 'Check Image dimensions' ! ");
		     document.myform.height3.focus();
		     return false;
			}
		}  

	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidDonation    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidDonation() {

if (!(isWhitespace(document.myform.DonationPrice.value)))
	{
		if (ValidPrice(document.myform.DonationPrice.value)==false) {
			document.myform.DonationPrice.focus();
			 return false;
	}  
	}
	if (isWhitespace(document.myform.DonationTitle.value)) 
	{
	     alert("Please enter Donation Title!  ");
	     document.myform.DonationTitle.focus();
	     return false;
	}  

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidBoat      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidBoat() {

	if (document.myform.BTLotNo.value.length>0){ 
	document.myform.BTLotNo.value = NonSpace(document.myform.BTLotNo.value);
		if (isNumber1(document.myform.BTLotNo.value)==false) {
			document.myform.BTLotNo.focus();
			return false;
		}
	}	

	if (document.myform.BTYear.value.length>0){ 
	document.myform.BTYear.value = NonSpace(document.myform.BTYear.value);
		if (isNumber1(document.myform.BTYear.value)==false) {
			document.myform.BTYear.focus();
			return false;
		}
	}		
	if (document.myform.BTYear.value.length>0){ 
	document.myform.BTYear.value = NonSpace(document.myform.BTYear.value);
		if (document.myform.BTYear.value< 1901|| document.myform.BTYear.value> 2100) {
			alert ("Please enter a valid Year!");
			return false;
		}
	}		

	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}		
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  

	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	

	if (document.myform.ImageSm.value!="")	{
		myext = getExtension(document.myform.ImageSm.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.ImageSm.value.focus;
		return false; 
		}
	}		
	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value > 70) {
	     alert("The Small Image's width is too big! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value > 50) {
	     alert("The Small Image's height is too big!");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  			
 return true;
}








//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidCar     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidCar() {

	if (document.myform.CRLotNo.value.length>0){ 
	document.myform.CRLotNo.value = NonSpace(document.myform.CRLotNo.value);
		if (isNumber1(document.myform.CRLotNo.value)==false) {
			document.myform.CRLotNo.focus();
			return false;
		}
	}
	if (document.myform.CRYear.value.length>0){ 
	document.myform.CRYear.value = NonSpace(document.myform.CRYear.value);
		if (isNumber1(document.myform.CRYear.value)==false) {
			document.myform.CRYear.focus();
			return false;
		}
	}	
	if (document.myform.CRYear.value.length>0){ 
	document.myform.CRYear.value = NonSpace(document.myform.CRYear.value);
		if (document.myform.CRYear.value< 1901 || document.myform.CRYear.value> 2100) {
			alert ("Please enter a valid Year!");
			return false;
		}
	}	
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value > 450) {
	     alert("The Large Image's  width is too big! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value > 450) {
	     alert("The Large Image's height is too big!");
	     document.myform.height.focus();
	     return false;
		}
	}  		
		
	if (document.myform.ImageSm.value!="")	{
		myext = getExtension(document.myform.ImageSm.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.ImageSm.value.focus;
		return false; 
		}
	}	
	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value > 70) {
	     alert("The Small Image's width is too big! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value ==0) {
	     alert("Please, push the button 'Check Small Image dimensions' ! ");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.heightSm.value > 50) {
	     alert("The Small Image's height is too big!");
	     document.myform.heightSm.focus();
	     return false;
		}
	}  				
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidSponsor    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSponsor() {

	if (isWhitespace(document.myform.SponsorName.value)) 
	{
	     alert("Please enter Sponsor Name!  ");
	     document.myform.SponsorName.focus();
	     return false;
	}  
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Logo dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Large Logo dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	
	
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value ==0) {
	     alert("Please, push the button 'Check Small Logo dimensions' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	if (document.myform.ImageSm.value!="")	{
		if (document.myform.widthSm.value >150) {
	     alert("The width of image must be smaller than 150 ' ! ");
	     document.myform.widthSm.focus();
	     return false;
		}
	}  
	
	if (document.myform.SponsorMailOrder.value!="")	{
			if (isNumber1(document.myform.SponsorMailOrder.value)==false) {
			     document.myform.SponsorMailOrder.focus();
				return false;
		}
	}	
	
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidVolunteer       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidVolunteer() {
if (isWhitespace(document.myform.VolunteerFName.value)) 
	{
	     alert("Please enter First Name! ");
	     document.myform.VolunteerFName.focus();
	     return false;
	}
if (isWhitespace(document.myform.VolunteerLName.value)) 
	{
	     alert("Please enter Last Name! ");
	     document.myform.VolunteerLName.focus();
	     return false;
	}

if (isWhitespace(document.myform.VolunteerCity.value)) 
	{
	     alert("Please enter City! ");
	     document.myform.VolunteerCity.focus();
	     return false;
	}
	if ( (document.myform.VolunteerStateID.options[document.myform.VolunteerStateID.options.selectedIndex].value)=="0")	{
			alert("Please enter State!");
			document.myform.VolunteerStateID.focus();
			return false;
	}
	if (!isWhitespace(document.myform.VolunteerZip.value)) { 
	 if (validateZIP(document.myform.VolunteerZip)==false) {
				document.myform.VolunteerZip.focus();
				return false;
	} 
	}

if (!check3Phone( 'phone1', 'phone2', 'phone3', true )) return false;

if (isWhitespace(document.myform.VolunteerEmail.value)) 
	{
	     alert("Please enter Email! ");
	     document.myform.VolunteerEmail.focus();
	     return false;
	}
	
if (!(isWhitespace(document.myform.VolunteerEmail.value))) {		
	 if (isEmail(document.myform.VolunteerEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.VolunteerEmail.focus();
			return false;
	 }
	 }	
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidVolunteerA       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidVolunteerA() {
if (isWhitespace(document.myform.VolunteerFName.value)) 
	{
	     alert("Please enter First Name! ");
	     document.myform.VolunteerFName.focus();
	     return false;
	}
if (isWhitespace(document.myform.VolunteerLName.value)) 
	{
	     alert("Please enter Last Name! ");
	     document.myform.VolunteerLName.focus();
	     return false;
	}

if (!(isWhitespace(document.myform.VolunteerEmail.value))) {		
	 if (isEmail(document.myform.VolunteerEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.VolunteerEmail.focus();
			return false;
	 }
	 }

	if (!(isWhitespace(document.myform.VolunteerPhone.value))) 	{ 
	if (document.myform.VolunteerPhone.value !="" && !checkUSPhone(document.myform.VolunteerPhone)) {
		document.myform.VolunteerPhone.focus();
		return false;
	}
	}
	 return true;
}


//____________________________________________________________________________________
//_____________     ValidQuotations      ________________________________________________

function ValidQuotations() {
	if (isWhitespace(document.myform.QuotationText.value)) 
	{
	     alert("Please enter Quotation Text! ");
	     document.myform.QuotationText.focus();
	     return false;
	}  
	
	if (isWhitespace(document.myform.QuotationAuthor.value)) 
	{
	     alert("Please enter Quotation Author! ");
	     document.myform.QuotationAuthor.focus();
	     return false;
	}  
	/*
	if (document.myform.QuotationPDF.value!="")	{
		myext = getExtension(document.myform.QuotationPDF.value);
		if (myext != "pdf"){
				alert ("Please Upload a PDF File!");
				document.myform.QuotationPDF.value.focus;
		return false; 
		}
	}	*/
	 return true;
}




//____________________________________________________________________________________
//_____________     ValidBus      ________________________________________________

function ValidBus() {
	if (isWhitespace(document.myform.BusRFPNo.value)) 
	{
	     alert("Please enter RFP#! ");
	     document.myform.BusRFPNo.focus();
	     return false;
	}  
	if ( (document.myform.BusDepartmentID.options[document.myform.BusDepartmentID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter Department!");
	     document.myform.BusDepartmentID.focus();
	     return false;
	}  

	if (isWhitespace(document.myform.BusTitle.value)) 
	{
	     alert("Please enter Title! ");
	     document.myform.BusTitle.focus();
	     return false;
	}  

	if (isWhitespace(document.myform.BusDescription.value)) 
	{
	     alert("Please enter Description! ");
	     document.myform.BusDescription.focus();
	     return false;
	}  

	if (isWhitespace(document.myform.BusDueDate.value)) 
	{
	     alert("Please enter Due Date!  ");
	     document.myform.BusDueDate.focus();
	     return false;
	}  
	if (document.myform.BusPDF.value!="")	{
		myext = getExtension(document.myform.BusPDF.value);
		if (myext != "pdf"){
				alert ("Please Upload a PDF File!");
				document.myform.BusPDF.value.focus;
		return false; 
		}
	}	
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidMailing      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidMailing() {

	var radio_choice = false;
	if (isWhitespace(document.myform.MEmail.value)) 
	{
	     alert("Please enter Email ! ");
	     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 (document.myform.MEmail.value.length>0){ 
		document.myform.MEmail.value = NonSpace(document.myform.MEmail.value);
		myext = getEmail(document.myform.MEmail.value);
		if (myext=="aol.com"){ 
				alert("Texans Can sincerely appreciates your interest in our Academy.\n\n Due to high turnover of Aol accounts, \n we would appreciate your entering another email address.");
			document.myform.MEmail.focus();
			return false;
		}	
	}		
	if (!isWhitespace(document.myform.MZip.value)) { 
	 if (validateZIP(document.myform.MZip)==false) {
				document.myform.MZip.focus();
				return false;
	} 
	}
	if (document.myform.MPhone.value !="" && !checkUSPhone(document.myform.MPhone)) {
		document.myform.MPhone.focus();
		return false;
	}
	if (document.myform.MLocationID){
		if (document.myform.MLocationID.checked==true)
		radio_choice = true; 

		for (counter = 0;  counter < document.myform.MLocationID.length; counter++)
		{
			if (document.myform.MLocationID[counter].checked)
			radio_choice = true; 
		}
	}
//	if (!radio_choice)
//	{
//	     alert("Please check Version of Newsletter to Receive!");
//		return (false);
//	}	

		 return true;

}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEMailing      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEMailing() {
	var radio_choice = false;
	if (isWhitespace(document.myform.MEmail.value)) 
	{
	     alert("Please enter Email ! ");
	     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 (document.myform.MEmail.value.length>0){ 
		document.myform.MEmail.value = NonSpace(document.myform.MEmail.value);
		myext = getEmail(document.myform.MEmail.value);
		if (myext=="aol.com"){ 
				alert("Texans Can sincerely appreciates your interest in our Academy.\n\n Due to high turnover of Aol accounts, \n we would appreciate your entering another email address.");
			document.myform.MEmail.focus();
			return false;
		}	
	}	
	if (!isWhitespace(document.myform.MZip.value)) { 
	 if (validateZIP(document.myform.MZip)==false) {
				document.myform.MZip.focus();
				return false;
	} 
	}
	if (document.myform.MPhone.value !="" && !checkUSPhone(document.myform.MPhone)) {
		document.myform.MPhone.focus();
		return false;
	}	
	if (document.myform.MLocationID){
		if (document.myform.MLocationID.checked==true)
		radio_choice = true; 

		for (counter = 0;  counter < document.myform.MLocationID.length; counter++)
		{
			if (document.myform.MLocationID[counter].checked)
			radio_choice = true; 
		}
	}
	if (!radio_choice)
	{
	     alert("Please check Version of Newsletter to Receive!");
		return (false);
	}	
return true;

}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmail      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmail() {
	if (isWhitespace(document.frmEmail.email.value)) 
	{
	     alert("Please enter Email ! ");
	     document.frmEmail.email.focus();
	     return false;
	} 
	if (document.frmEmail.email.value.length>0){ 
	document.frmEmail.email.value = NonSpace(document.frmEmail.email.value);
	if (isEmail(document.frmEmail.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmEmail.email.focus();
			return false;
	}  
	}		
	if (document.frmEmail.email.value.length>0){ 
		document.frmEmail.email.value = NonSpace(document.frmEmail.email.value);
		myext = getEmail(document.frmEmail.email.value);
		if (myext=="aol.com"){ 
				alert("Texans Can sincerely appreciates your interest in our Academy.\n\n Due to high turnover of Aol accounts, \n we would appreciate your entering another email address.");
			document.frmEmail.email.focus();
			return false;
		}	
	}	
	document.frmEmail.submit();
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmailR      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmailR() {
	if (isWhitespace(document.frmFriend.email.value)) 
	{
	     alert("Please enter Email ! ");
	     document.frmFriend.email.focus();
	     return false;
	} 
	if (document.frmFriend.email.value.length>0){ 
	document.frmFriend.email.value = NonSpace(document.frmFriend.email.value);
	if (isEmail(document.frmFriend.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmFriend.email.focus();
			return false;
	}  
	}		

	document.frmFriend.submit();
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmailNew      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmailNew() {
	if (isWhitespace(document.frmEmail.email.value)) 	{
	     alert("Please enter Email ! ");
	     document.frmEmail.email.focus();
	     return false;
	} 
	if (document.frmEmail.email.value.length>0){ 
	document.frmEmail.email.value = NonSpace(document.frmEmail.email.value);
	if (isEmail(document.frmEmail.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmEmail.email.focus();
			return false;
	}  
	}	
	if (document.frmEmail.email.value.length>0){ 
		document.frmEmail.email.value = NonSpace(document.frmEmail.email.value);
		myext = getEmail(document.frmEmail.email.value);
		if (myext=="aol.com"){ 
				alert("Texans Can sincerely appreciates your interest in our Academy.\n\n Due to high turnover of Aol accounts, \n we would appreciate your entering another email address.");
			document.frmEmail.email.focus();
			return false;
		}	
	}			
	document.frmEmail.submit();
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmailx      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmailx() {
	if (document.frmEmail.email.value.length>0){ 
	document.frmEmail.email.value = NonSpace(document.frmEmail.email.value);
	if (isEmail(document.frmEmail.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmEmail.email.focus();
			return false;
	}  
	}		
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmailUns      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmailUns() {
	if (isWhitespace(document.frmUns.email.value)) 
	{
	     alert("Please enter Email ! ");
	     document.frmUns.email.focus();
	     return false;
	} 
	if (document.frmUns.email.value.length>0){ 
	document.frmUns.email.value = NonSpace(document.frmUns.email.value);
	if (isEmail(document.frmUns.email.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmUns.email.focus();
			return false;
	}  
	}		
	
	document.frmUns.submit();
	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;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidEmp    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmp() {
	if (isWhitespace(document.myform.EmpTitle.value)) 	{
	     alert("Please enter Title!");
	     document.myform.EmpTitle.focus();
	     return false;
	}  
	if ( (document.myform.EmpDepartmentID.options[document.myform.EmpDepartmentID.options.selectedIndex].value)=="0")	{
			alert("Please enter Department!");
			document.myform.EmpDepartmentID.focus();
			return false;
	}
	if (isWhitespace(document.myform.EmpLocation.value)) {
	     alert("Please enter Location!");
	     document.myform.EmpLocation.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.EmpDescription.value)) 	{
	     alert("Please enter Description!");
	     document.myform.EmpDescription.focus();
	     return false;
	}  
	
	if (isWhitespace(document.myform.EmpQualifications.value)) 	{
	     alert("Please enter Qualifications!");
	     document.myform.EmpQualifications.focus();
	     return false;
	}  
	if ( (document.myform.EmpTypeID.options[document.myform.EmpTypeID.options.selectedIndex].value)=="0")	{
			alert("Please enter Type!");
			document.myform.EmpTypeID.focus();
			return false;
	}
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidBoard    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidBoard() {
	if (isWhitespace(document.myform.BDFirstName.value)) 	{
	     alert("Please enter First Name!");
	     document.myform.BDFirstName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.BDLastName.value)) 	{
	     alert("Please enter Last Name!");
	     document.myform.BDLastName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.BDTitle.value)) 	{
	     alert("Please enter Title!");
	     document.myform.BDTitle.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.BDBiography.value)) 	{
	     alert("Please enter Biography!");
	     document.myform.BDBiography.focus();
	     return false;
	}  
//	if (isWhitespace(document.myform.BDPhone.value)) 	{
//	     alert("Please enter Phone!");
//	     document.myform.BDPhone.focus();
//	     return false;
//	} 
	if (!(isWhitespace(document.myform.BDPhone.value))) 	{ 
	if (document.myform.BDPhone.value !="" && !checkUSPhone(document.myform.BDPhone)) {
		document.myform.BDPhone.focus();
		return false;
	}
	}
	
	if (isWhitespace(document.myform.BDEmail.value)) 
	{
	     alert("Please enter email ");
	     document.myform.BDEmail.focus();
	     return false;
	}  
	if (isEmail(document.myform.BDEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.BDEmail.focus();
			return false;
	}  
	
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}		
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Large Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	

	
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidNewsletter     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNewsletter() {
	if (isWhitespace(document.myform.NLEmailFrom.value)) 
	{
	     alert("Please enter Email From Address");
	     document.myform.NLEmailFrom.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.NLSubject.value)) 
	{
	     alert("Please enter Email Subject");
	     document.myform.NLSubject.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter Email Message");
	     document.myform.xText.focus();
	     return false;
	}  
	document.myform.sCMD.value="upd";
	return true;
}





//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidNewsletterLoc     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNewsletterLoc() {
	if ( (document.myform.LocationID.options[document.myform.LocationID.options.selectedIndex].value)=="0")	{
			alert("Please enter Location!");
			document.myform.LocationID.focus();
			return false;
	}
	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter Email Message");
	     document.myform.xText.focus();
	     return false;
	}  
	document.myform.sCMD.value="upd";
	return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidContent     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidContent() {
	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter Page Content! ");
	     document.myform.xText.focus();
	     return false;
	}  
	
	 return true;
}

		  
	
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidPress      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPress() {

	if (isWhitespace(document.myform.PressTitle.value)) 
	{
	     alert("Please enter Title!");
	     document.myform.PressTitle.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.PressSubTitle.value)) 
	{
	     alert("Please enter SubTitle!");
	     document.myform.PressSubTitle.focus();
	     return false;
	}
	if (isWhitespace(document.myform.PressCity.value)) 
	{
	     alert("Please enter City!");
	     document.myform.PressCity.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.PressDate.value)) 
	{
	     alert("Please enter Date!");
	     document.myform.PressDate.focus();
	     return false;
	}  			
	
	var strCMs = window.parent.frames[0].window.frames[0].document.body.innerHTML
	strCMs = strCMs.toLowerCase()
	strCMs = strCMs.replace(/ /g, "").replace(/&nbsp;/g, "").replace( /<p>/g, "").replace( /<\/p>/g, "").replace( /<br>/g, "").replace( /<br\/>/g, "").replace( /<br \/>/g, "")
	
	if (isWhitespace(strCMs)) 
	{
	    alert("Please enter Main Text!");
	    return false;
	} 
	
	return true; 	
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidSelect     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidSelect() {

	if (!(isWhitespace(document.myform1.PLFOrder.value))) 	{
		if (isNumber1(document.myform1.PLFOrder.value)==false) {
			document.myform1.PLFOrder.focus();
			return false;
		}
	}  
	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidTAG     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidTAG() {

//	 document.myform.sCMD.value="upd";
	 return true;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidFunction    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFunction() {
	if (isWhitespace(document.myform.FunctionName.value)) 
	{
	     alert("Please enter Name! ");
	     document.myform.FunctionName.focus();
	     return false;
	}  

	if (!(isWhitespace(document.myform.FunctionOrder.value))) 
	{
		if (isNumber1(document.myform.FunctionOrder.value)==false) {
			document.myform.FunctionOrder.focus();
			return false;
		}
	}
	 return true;
}


//____________________________________________________________________________________
//_____________     ValidMessage      ________________________________________________

function ValidMessage() {
	if (isWhitespace(document.myform.Subject.value)) 
	{
	     alert("Please enter Subject! ");
	     document.myform.Subject.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter Message Text! ");
	     document.myform.xText.focus();
	     return false;
	}  
	 return true;
}



//____________________________________________________________________________________
//_____________     Search Application      ________________________________________________

function SearchApp(){

	if (isWhitespace(document.myform.searchApp.value)) 
	{
		alert("Please enter search text!");
		document.myform.searchApp.focus();
		return false;
	} 
	
	document.myform.submit();
	return true;
}
        
        

//____________________________________________________________________________________
//___________    ValidForum    _______________________________________________________

function ValidForum() {
	if (isWhitespace(document.myform.ForumName.value)) 
	{
	     alert("Please enter Forum Name!");
	     document.myform.ForumName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ForumDescription.value)) 
	{
	     alert("Please enter Forum Description!");
	     document.myform.ForumDescription.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.ForumStartDate.value)) 
	{
	     alert("Please enter Forum Start Date!");
	     document.myform.ForumStartDate.focus();
	     return false;
	}  	
	
	if (document.myform.ID.value==0) {
	if (isWhitespace(document.myform.Subject.value)) 
	{
	     alert("Please enter Subject! ");
	     document.myform.Subject.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.xText.value)) 
	{
	     alert("Please enter Message Text! ");
	     document.myform.xText.focus();
	     return false;
	}  
	if ( (document.myform.Moderator.options[document.myform.Moderator.options.selectedIndex].value)=="0")
	{
			alert("Please enter Moderator");
			document.myform.Moderator.focus();
			return false;
	}
	}
	
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidContactUs    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidContactUs() {

	if (isWhitespace(document.frmContactUs.CFirstName.value)) 
	{
	     alert("Please enter First Name");
	     document.frmContactUs.CFirstName.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.CLastName.value)) 
	{
	     alert("Please enter Last Name");
	     document.frmContactUs.CLastName.focus();
	     return false;
	}  

	if (isWhitespace(document.frmContactUs.CAddress.value)) 
	{
	     alert("Please enter Address ");
	     document.frmContactUs.CAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.CCity.value)) 
	{
	     alert("Please enter City");
	     document.frmContactUs.CCity.focus();
	     return false;
	}  
	if ( (document.frmContactUs.CStateID.options[document.frmContactUs.CStateID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter State");
	     document.frmContactUs.CStateID.focus();
	     return false;
	}  
	if (!(isWhitespace(document.frmContactUs.CZip.value))) {
	if (validateZIP(document.frmContactUs.CZip)==false) {
				document.frmContactUs.CZip.focus();
				return false;
	} 
	} 
	
	if (!check3Phone( 'phone1', 'phone2', 'phone3', true )) return false;
	if (!check3Phone( 'fax1', 'fax2', 'fax3', false )) return false;
	
	if (isWhitespace(document.frmContactUs.CEmail.value)) 
	{
	     alert("Please enter email ");
	     document.frmContactUs.CEmail.focus();
	     return false;
	}  
	if (isEmail(document.frmContactUs.CEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmContactUs.CEmail.focus();
			return false;
	}  
	if (isWhitespace(document.frmContactUs.CComents.value)) 
	{
	     alert("Please enter Suggestions ");
	     document.frmContactUs.CComents.focus();
	     return false;
	}  
	 return true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidContactUpd    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidContactUpd() {

	if (isWhitespace(document.frmContactUs.CFirstName.value)) 
	{
	     alert("Please enter First Name!");
	     document.frmContactUs.CFirstName.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.CLastName.value)) 
	{
	     alert("Please enter Last Name!");
	     document.frmContactUs.CLastName.focus();
	     return false;
	}  

	if (isWhitespace(document.frmContactUs.CAddress.value)) 
	{
	     alert("Please enter Address! ");
	     document.frmContactUs.CAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.CCity.value)) 
	{
	     alert("Please enter City");
	     document.frmContactUs.CCity.focus();
	     return false;
	}  
	if ( (document.frmContactUs.CStateID.options[document.frmContactUs.CStateID.options.selectedIndex].value)=="0")
	{
	     alert("Please enter State");
	     document.frmContactUs.CStateID.focus();
	     return false;
	}  
	if (isWhitespace(document.frmContactUs.CZip.value)) 
	{
	    alert("Please enter Zip");
	     document.frmContactUs.CZip.focus();
	     return false;
	}
	if (!(isWhitespace(document.frmContactUs.CZip.value))) {
	if (validateZIP(document.frmContactUs.CZip)==false) {
				document.frmContactUs.CZip.focus();
				return false;
	} 
	} 
/*	if (isWhitespace(document.frmContactUs.CPhone.value)) 
	{
	     alert("Please enter Telephone! ");
	     document.frmContactUs.CPhone.focus();
	     return false;
	}  */
	if (!(isWhitespace(document.frmContactUs.CPhone.value))) {
	if (frmContactUs.CPhone.value !="" && !checkUSPhone(frmContactUs.CPhone)) {
		frmContactUs.CPhone.focus();
		return false;
	}
	}
/*	if (isWhitespace(document.frmContactUs.CEmail.value)) 
	{
	     alert("Please enter Email!");
	     document.frmContactUs.CEmail.focus();
	     return false;
	}  */
	if (!(isWhitespace(document.frmContactUs.CEmail.value))) {
	if (isEmail(document.frmContactUs.CEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.frmContactUs.CEmail.focus();
			return false;
	}  
	}  
	if (!(isWhitespace(document.frmContactUs.CCZip.value))) {
	if (validateZIP(document.frmContactUs.CCZip)==false) {
				document.frmContactUs.CCZip.focus();
				return false;
	} 
	} 
	if (!(isWhitespace(document.frmContactUs.CCPhone.value))) {
	if (frmContactUs.CCPhone.value !="" && !checkUSPhone(frmContactUs.CCPhone)) {
		frmContactUs.CCPhone.focus();
		return false;
	}
	}
	if (!(isWhitespace(document.frmContactUs.CCEmail.value))) {
	if (isEmail(document.frmContactUs.CCEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com !");
			document.frmContactUs.CCEmail.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.address.value)) 
	{
	     alert("Please enter Address ");
	     document.frmContactUs.address.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.zip.value)) 
	{
	     alert("Please enter Zip");
	     document.frmContactUs.zip.focus();
	     return false;
	}  
	 if (validateZIP(document.frmContactUs.zip)==false) {
				document.frmContactUs.zip.focus();
				return false;
	} 
	
	if (isWhitespace(document.frmContactUs.phone.value)) 
	{
	     alert("Please enter Telephone ");
	     document.frmContactUs.phone.focus();
	     return false;
	}  
	if (document.frmContactUs.phone.value !="" && !checkUSPhone(document.frmContactUs.phone)) {
		document.frmContactUs.phone.focus();
		return false;
	}
	
	if (document.frmContactUs.fax.value !="" && !checkUSPhone(document.frmContactUs.fax)) {
		document.frmContactUs.fax.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;
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~  ValidContact   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidContact() {
	var radio_choice = false;
	if (isWhitespace(document.myform.fname.value)) 
	{
	     alert("Please enter Your Name  ");
	     document.myform.fname.focus();
	     return false;
	}  
	if (document.myform.telephone.value.length > 0){ 
	if (IsPhone(document.myform.telephone.value)==false) {
		document.myform.telephone.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.subject){
		if (document.myform.subject.checked==true)
		radio_choice = true; 

		for (counter = 0;  counter < document.myform.subject.length; counter++)
		{
			if (document.myform.subject[counter].checked)
			radio_choice = true; 
		}
	}
	if (!radio_choice)
	{
		alert("Please select mail subject")
		return (false);
	}
*/	

	if (isWhitespace(document.myform.comments.value)) 
	{
	     alert("Please enter your comments! ");
	     document.myform.comments.focus();
	     return false;
	} 
	document.myform.sCMD.value = "upd";
	return true;
}


 
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidFAQ()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidFAQ() {

	if (isWhitespace(document.myform.FAQsQ.value)) 
	{
	     alert("Please enter Question! ");
	     document.myform.FAQsQ.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.FAQsA.value)) 
	{
	     alert("Please enter Answer! ");
	     document.myform.FAQsA.focus();
	     return false;
	} 

	 return true;
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidLocation     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidLocation() {
	if (isWhitespace(document.myform.LocationName.value)) 
	{
	     alert("Please enter Location Name");
	     document.myform.LocationName.focus();
	     return false;
	}  

	if (!(isWhitespace(document.myform.LocationZip.value))){
	 if (validateZIP(document.myform.LocationZip)==false) {
				document.myform.LocationZip.focus();
				return false;
	} 
	}
	if (document.myform.LocationPhone.value !="" && !checkUSPhone(document.myform.LocationPhone)) {
		document.myform.LocationPhone.focus();
		return false;
	}
}




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidLocationS     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidLocationS() {

//	if ( (document.myform.SLLocationID.options[document.myform.SLLocationID.options.selectedIndex].value)=="0")
//	{
//	     alert("Please enter Location! ");
//	     document.myform.SLLocationID.focus();
//	     return false;
//	}  
	if (isWhitespace(document.myform.SLAcademy.value)) 
	{
	     alert("Please enter Academy Name!");
	     document.myform.SLAcademy.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SLAddress.value)) 
	{
	     alert("Please enter Address!");
	     document.myform.SLAddress.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SLCity.value)) 
	{
	     alert("Please enter City!");
	     document.myform.SLCity.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.SLZip.value)) 
	{
	     alert("Please enter Zip!");
	     document.myform.SLZip.focus();
	     return false;
	}  
	if (!(isWhitespace(document.myform.SLZip.value))){
	 if (validateZIP(document.myform.SLZip)==false) {
				document.myform.SLZip.focus();
				return false;
	} 
	}
	if (isWhitespace(document.myform.SLPhone.value)) 
	{
	     alert("Please enter Phone!");
	     document.myform.SLPhone.focus();
	     return false;
	}  
	if (document.myform.SLPhone.value !="" && !checkUSPhone(document.myform.SLPhone)) {
		document.myform.SLPhone.focus();
		return false;
	}
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidPersonnel     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidPersonnel() {

	if (isWhitespace(document.myform.PACFName.value)) 
	{
	     alert("Please enter First Name!");
	     document.myform.PACFName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.PACLName.value)) 
	{
	     alert("Please enter Last Name!");
	     document.myform.PACLName.focus();
	     return false;
	}  
	if (isWhitespace(document.myform.PACEmail.value)) 
	{
	     alert("Please enter Email!");
	     document.myform.PACEmail.focus();
	     return false;
	}  
	if (isEmail(document.myform.PACEmail.value)==false) {
			alert("Please enter a valid E-Mail address, like: name@companyname.com ");
			document.myform.PACEmail.focus();
			return false;
	}  
}



 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidList     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidList() {
//	if ( (document.myform.LocationID.options[document.myform.LocationID.options.selectedIndex].value)=="0")
//	{
//	     alert("Please enter Location!");
//	     document.myform.LocationID.focus();
//	     return false;
//	}  
	if (document.myform.typeFile[0].checked) {
		if (isWhitespace(document.myform.UploadFile.value)) 
		{
		     alert("Please select Upload File!");
		     document.myform.UploadFile.focus();
		     return false;
		}  
	}

	if (document.myform.UploadFile.value!="")	{
		myext = getExtension(document.myform.UploadFile.value);
		if ((myext != "xls") && (myext != "XLS") ){
				alert ("Please Upload a XLS File !");
				document.myform.UploadFile.value.focus;
		return false; 
		}
	}
	
}

 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidContact     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidContact() {
	if (document.myform.typeFile[0].checked) {
		if (isWhitespace(document.myform.UploadFile.value)) 
		{
		     alert("Please select Upload File!");
		     document.myform.UploadFile.focus();
		     return false;
		}  
	}
	
	if (document.myform.UploadFile.value!="")	{
		myext = getExtension(document.myform.UploadFile.value);
		if ((myext != "xls") && (myext != "XLS") ){
				alert ("Please Upload a XLS File !");
				document.myform.UploadFile.value.focus;
		return false; 
		}
	}
}



 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidNsOrder     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNsOrder() {
	var theForm = document.myform;
	var nr = theForm.length;
	
	for (i=0; i<nr; i++){
		if (theForm.elements[i].name == "NsImgOrder" ){
			if (isNumber1(theForm.elements[i].value)==false) {
				theForm.elements[i].focus();
				return false;}
		}
	}
}


 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEvOrder     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEvOrder() {
	var theForm = document.myform;
	var nr = theForm.length;
	
	for (i=0; i<nr; i++){
		if (theForm.elements[i].name == "EvImgOrder" ){
			if (isNumber1(theForm.elements[i].value)==false) {
				theForm.elements[i].focus();
				return false;}
		}
	}
}


 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidOrder     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidOrder() {
	var theForm = document.myform;
	var nr = theForm.length;
	
	document.myform.sCMD.value = "";
	
	for (i=0; i<nr; i++){
		if (theForm.elements[i].name == "FunctionOrder" ){
			if (isNumber1(theForm.elements[i].value)==false) {
				theForm.elements[i].focus();
				return false;}
		}
	}
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidGo     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidGo() {
	if (isWhitespace(document.myform.KeySearch.value)) {
	     alert("Please enter Search Key! ");
	     document.myform.KeySearch.focus();
	     return false;
	}  
	document.myform.GoSearch.value =1;
	 return true;
}

//________________________________________________________________________________________________
//_____________________      goSubmM     _____________________________________________________________

function goSubmM(url,page,groupCrt,sSortBy,sSortOrd){
		document.myform.page.value = page;
		document.myform.sCMD.value = "";
		document.myform.groupCrt.value = groupCrt;
		document.myform.SortBy.value = sSortBy;
		document.myform.SortOrd.value = sSortOrd;
		document.myform.action = url;
		document.myform.submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      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;
		}
	}
	var xx =field.substring(xlen+xpos, xlen).toLowerCase();

	return (xx);


//	return (field.substring(xlen+xpos, xlen));
	
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      getEmail      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function getEmail(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;
		}
	}
	var xx =field.substring(xlen+xpos, xlen).toLowerCase();
	return (xx);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      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_Date444(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;
                }       
        }
}        
}


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;
}


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));
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goRefresh      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goRefresh(url)   
{

		document.forms[0].sCMD.value = "";
		document.forms[0].action = url;
		document.forms[0].submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goUpd     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goUpd(url)   
{
		document.forms[0].sCMD.value = "XX";
		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();
		}
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDelP      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDelP(url,ID)   
{
	if (confirm("This Personnel will be deleted from all Locations! Are you sure !?"))
		{
		document.forms[0].sCMD.value = "del";
		document.forms[0].ID.value = ID;
		document.forms[0].action = url;
		document.forms[0].submit();
		}
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goDelCheck      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goDelCheck(url)   
{
	if (confirm("All the checked records will be deleted! Are you sure !?"))
		{
		document.myform1.action = url;
		document.myform1.submit();
		}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goMod      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goMod(url,ID)   
{
		document.myform.sCMD.value = "edit";
		document.myform.action = url;
		document.myform.ID.value = ID;
		document.myform.submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goModL      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goModL(url,ID,xLoca)   
{
		document.myform.sCMD.value = "edit";
		document.myform.action = url;
		document.myform.ID.value = ID;
		document.myform.Loca.value = xLoca;
		document.myform.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();
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSort      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSort(url,sSortBy,sSortOrd)
{
		document.forms[0].sCMD.value = "";
		document.forms[0].action = url;
		document.forms[0].SortBy.value  = sSortBy;
		document.forms[0].SortOrd.value = sSortOrd;

		document.forms[0].submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSorts      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSorts(url,sSortBy,sSortOrd)
{
//		document.myform.sCMD.value = "sort";
		document.myform.action = url;
		document.myform.SortBy.value  = sSortBy;
		document.myform.SortOrd.value = sSortOrd;
		document.myform.submit( );
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     goSubm     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function goSubm(xID)
{
		document.forms[0].sCMD.value = "edit";
		document.forms[0].ID.value = xID;
		document.forms[0].submit();
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


function checkDim1(loc) {
	loc = "amd_include/Images1.htm?" + loc;
	windowprops = 'menubar=0,toolbar=0,status=0,location=0,width=500,height=500';
	popupWindow = open(loc, 'previewWin', windowprops);
	if (popupWindow.opener == null) 
	popupWindow.opener = self;
}

function checkDim2(loc) {
	loc = "amd_include/Images2.htm?" + loc;
	windowprops = 'menubar=0,toolbar=0,status=0,location=0,width=500,height=500';
	popupWindow = open(loc, 'previewWin', windowprops);
	if (popupWindow.opener == null) 
	popupWindow.opener = self;
}

function checkDim3(loc) {
	loc = "amd_include/Images3.htm?" + loc;
	windowprops = 'menubar=0,toolbar=0,status=0,location=0,width=500,height=500';
	popupWindow = open(loc, 'previewWin', windowprops);
	if (popupWindow.opener == null) 
	popupWindow.opener = self;
}




function checkImage(loc) {
	loc = "amd_include/image-popup.html?" + loc;
	windowprops = 'menubar=0,toolbar=0,status=0,location=0';
	popupWindow = open(loc, 'previewWin', windowprops);
	if (popupWindow.opener == null) 
	popupWindow.opener = self;
}


function checkImageSm(loc) {
	loc = "amd_include/image-popupSm.html?" + loc;
	windowprops = 'menubar=0,toolbar=0,status=0,location=0';
	popupWindow = open(loc, 'previewWin', windowprops);
	if (popupWindow.opener == null) 
	popupWindow.opener = self;
}

/*** FILE UPLOADING Utilities ***/

// FILE EXT CHECK
function validFile(fileName, sExtension) {
	var bext = checkFileExtension(fileName, sExtension);
	if (!bext){
		document.frm.fBrowseFile.focus();
		document.getElementById("btnUpload").style.display = "none";
		return false; 
	}
	else{
		document.getElementById("btnUpload").style.display = "block";
		return true;
	}
}


// IMAGE CHECK
function validImage(imgName) {
	var bext = checkImageExtension(imgName);
	if (!bext){
		document.frm.fBrowseFile.focus();
		document.getElementById("btnUpload").style.display = "none";
		return false; 
	}
	else{
		document.getElementById("btnUpload").style.display = "block";
		return true;
	}
}

// FILE EXT CHECK
function validVideo(fileName) {
	var bext = checkVideoExtension(fileName);
	if (!bext){
		document.frm.fBrowseFile.focus();
		document.getElementById("btnUpload").style.display = "none";
		return false; 
	}
	else{
		document.getElementById("btnUpload").style.display = "block";
		return true;
	}
}
// DO UPLOAD  IMAGE
function doUploadImage(oUpldID, oToolsID, oToolView, imgNameID, imgWidthID, imgHeightID, iMaxWidth, iMaxHeight, sComparisionType){
	document.frm.action = "imgCheck.asp?imgNID=" + imgNameID + "&imgWID=" + imgWidthID + "&imgHID=" + imgHeightID + "&imgWMax=" + iMaxWidth + "&imgHMax=" + iMaxHeight + "&action=upld" + "&imgCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView;
	document.frm.submit();
}
// DO UPLOAD FILE
function doUploadFile(oUpldID, oToolsID, oToolView, sfNameID, ifMaxWeight, sfType, sComparisionType){
	document.frm.action = "fileCheck.asp?fNID=" + sfNameID + "&fWMax=" + ifMaxWeight + "&fType=" + sfType + "&fCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView + "&action=upld";
	document.frm.submit();
}

// DO UPLOAD  VIDEO
function doUploadVideo(oUpldID, oToolsID, oToolView, sfNameID, ifMaxWeight, sfType, sComparisionType){
	document.frm.action = "videoCheck.asp?fNID=" + sfNameID + "&fWMax=" + ifMaxWeight + "&fType=" + sfType + "&fCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView + "&action=upld";
	document.frm.submit();
}


// IMAGE UPLD WINDOW
function upldImage(oUpldID, oToolsID, oToolView, imgNameID, imgWidthID, imgHeightID, iMaxWidth, iMaxHeight, sComparisionType) {
	var wSpace = 418;
	var hSpace = 250;
	var width = (screen.availWidth - wSpace)/2;
	var height = (screen.availHeight - hSpace)/2;
	
	//loc = "amd_include/imgCheck.asp?imgNID=" + imgNameID + "&imgWID=" + imgWidthID + "&imgHID=" + imgHeightID + "&imgWMax=" + iMaxWidth + "&imgHMax=" + iMaxHeight + "&imgCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView;
	loc = "uploader/imgCheck.asp?imgNID=" + imgNameID + "&imgWID=" + imgWidthID + "&imgHID=" + imgHeightID + "&imgWMax=" + iMaxWidth + "&imgHMax=" + iMaxHeight + "&imgCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView;	

	windowprops = 'left=' + width + ',top=' + height + ',width=' + wSpace + ',height=' + hSpace + ',menubar=0,toolbar=0,status=0,location=0,scrollbars=0,resizable=0';
	popupWindow = open(loc, 'uploadImage', windowprops);
	if (popupWindow.opener == null) 
			popupWindow.opener = self;
}

// FILE UPLD WINDOW
function upldFile(oUpldID, oToolsID, oToolView, sfNameID, ifMaxWeight, sfType, sComparisionType) {
	var wSpace = 418;
	var hSpace = 250;
	var width = (screen.availWidth - wSpace)/2;
	var height = (screen.availHeight - hSpace)/2;
	
	loc = "amd_include/fileCheck.asp?fNID=" + sfNameID + "&fWMax=" + ifMaxWeight + "&fType=" + sfType + "&fCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView;
	windowprops = 'left=' + width + ',top=' + height + ',width=' + wSpace + ',height=' + hSpace + ',menubar=0,toolbar=0,status=0,location=0,scrollbars=0,resizable=0';
	popupWindow = open(loc, 'uploadFile', windowprops);
	if (popupWindow.opener == null) 
			popupWindow.opener = self;
}

// VIDEO UPLD WINDOW
// FILE UPLD WINDOW
function upldVideo(oUpldID, oToolsID, oToolView, sfNameID, ifMaxWeight, sfType, sComparisionType) {
	var wSpace = 418;
	var hSpace = 250;
	var width = (screen.availWidth - wSpace)/2;
	var height = (screen.availHeight - hSpace)/2;
	
	loc = "amd_include/videoCheck.asp?fNID=" + sfNameID + "&fWMax=" + ifMaxWeight + "&fType=" + sfType + "&fCT=" + sComparisionType + "&oupldid=" + oUpldID + "&otoolsid=" + oToolsID + "&oviewid=" + oToolView;
	windowprops = 'left=' + width + ',top=' + height + ',width=' + wSpace + ',height=' + hSpace + ',menubar=0,toolbar=0,status=0,location=0,scrollbars=0,resizable=0';
	popupWindow = open(loc, 'uploadVideo', windowprops);
	if (popupWindow.opener == null) 
			popupWindow.opener = self;
}


// SHOW / HIDE UPLOAD BTN
function checkUpload(){
	if(document.getElementById("btnUpload")){
		if (document.getElementById("fBrowseFile").value == ""){
			document.getElementById("btnUpload").style.display = "none";
		}
		else{
			document.getElementById("btnUpload").style.display = "block";
		}
	}
}

// small image - NEWS page
function checkSmallImg(loc) {
	var bext = checkImageExtension(loc);
	if (!bext){
		document.myform.ImageSm.focus();
		return false; 
	}
	
		loc = "amd_include/imgCheck.asp?img=" + loc;
		windowprops = 'menubar=0,toolbar=0,status=0,location=0';
		popupWindow = open(loc, 'previewWin', windowprops);
		if (popupWindow.opener == null) 
			popupWindow.opener = self;
	
	return true;
}


// images extension check
function checkImageExtension(imageName){
	var myext = getExtension(imageName);
	myext = myext.toLowerCase();
	
	if ((myext != "gif") && (myext != "jpg") && (myext != "jpeg")  && (myext != "jpe") && (myext != "png")){
		alert ("Please Upload an Image with GIF, JPEG, JPG or PNG extension !");
		return false; 
	}
	else{
		return true;
	}
}
// pdf extension check
function checkFileExtension(fileName, sExtension){
	var myext = getExtension(fileName);
	if (myext.toLowerCase() != sExtension.toLowerCase()) {
		alert ("Please upload a file with \"" + sExtension.toUpperCase() + "\" extension !");
		return false; 
	}
	else{
		return true;
	}
}


// images extension check
function checkVideoExtension(imageName){
	var myext = getExtension(imageName);
	myext = myext.toLowerCase();

	if ((myext != "mov") && (myext != "avi") && (myext != "vmw")  && (myext != "jpe") && (myext != "png")){
		alert ("Please Upload a Video  with WMV, AVI or MOV extension !");
		return false; 
	}
	else{
		return true;
	}
}

/*** ***/

function Start(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=550,height=250,top=50,left=50");
}

function Open(page) {
	OpenWin = this.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=750,height=450,top=10,left=10");
	return true;
}
function OpenPage(page) {
	OpenWin = window.open(page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,width=650,height=660,top=10,left=10");
	return true;
}


//function goUpload(page) {
 //Open(page);
//	 document.myform.sCMD.value="edit";
//	 document.myform.action = "ContentManager.asp";
//	 document.myform.submit();
//}




function submitonce(theform) {
	// if IE 4+ or NS 6+
	if (document.all || document.getElementById) {
		// hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++) {
			var tempobj=theform.elements[i];
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset") {
				//disable it
				tempobj.disabled=true;
			}
		}
	}
}



//---------------- valid phone ----------------
// VARIABLE DECLARATIONS

var digits = "0123456789";

// whitespace characters
var whitespace = " \t\n\r";

// decimal point character differs by language and culture
var decimalPointDelimiter = "."

// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()-./ ";

// characters which are allowed in US phone numbers
var validUSPhoneChars = digits + phoneNumberDelimiters;

// U.S. phone numbers have 10 digits.
// They are formatted as 123 456 7890 or (123) 456-7890.
var digitsInUSPhoneNumber = 10;

// CONSTANT STRING DECLARATIONS

// m = "missing"

var mPrefix = "You did not enter a value into the "
var mSuffix = " field. This is a required field. Please enter it now."

// s --- "string"

var sPhone = "Phone Number"

// i is an abbreviation for "invalid"
var iUSPhone = "This field must be a 10 digit U.S. phone number (like 415 555 1212). Please reenter it now."
// p is an abbreviation for "prompt"
var pEntryPrompt = "Please enter a "
var pUSPhone = "10 digit U.S. phone number (like 415 555 1212)."
var defaultEmptyOK = false
// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}function stripCharsInBag (s, bag)

{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }

    return returnString;
}function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}
function isInteger (s)

{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    // Search through string's characters one by one
    // until we find a non-numeric character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);

        if (!isDigit(c)) return false;
    }

    // All characters are numbers.
    return true;
}
function reformat (s)

{   var arg;
    var sPos = 0;
    var resultString = "";

    for (var i = 1; i < reformat.arguments.length; i++) {
       arg = reformat.arguments[i];
       if (i % 2 == 1) resultString += arg;
       else {
           resultString += s.substring(sPos, sPos + arg);
           sPos += arg;
       }
    }
    return resultString;
}


function isUSPhoneNumber (s)
{   if (isEmpty(s)) 
       if (isUSPhoneNumber.arguments.length == 1) return defaultEmptyOK;
       else return (isUSPhoneNumber.arguments[1] == true);
    return (isInteger(s) && s.length == digitsInUSPhoneNumber)
}

// Notify user that contents of field theField are invalid.
// String s describes expected contents of theField.value.
// Put select theField, pu focus in it, and return false.

function warnInvalid (theField, s)
{   theField.focus()
    theField.select()
    alert(s)
    return false
}

function reformatUSPhone (USPhone)
{   return (reformat (USPhone, "", 3, "-", 3, "-", 4))
}

function checkUSPhone (theField, emptyOK)
{   if (checkUSPhone.arguments.length == 1) emptyOK = defaultEmptyOK;
    if ((emptyOK == true) && (isEmpty(theField.value))) return true;
    else
    {  var normalizedPhone = stripCharsInBag(theField.value, phoneNumberDelimiters)
       if (!isUSPhoneNumber(normalizedPhone, false)) 
          return warnInvalid (theField, iUSPhone);
       else 
       {  // if you don't want to reformat as (123) 456-789, comment next line out
          theField.value = reformatUSPhone(normalizedPhone)
          return true;
       }
    }
}


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function valid_xdatex() {

	//var xdate = new Date(document.myform.nowdate.value);
	var xDate = new Date();
	var zDate = new Date(document.myform.HitDate.value);
	//alert(xDate)
	if (xDate < zDate) {
		alert("The Hits Date must be earlier than today!");
		document.myform.HitDate.focus();
		return false;
	} 
	return true;
}


function ValidFriendlyName() {
	if (isWhitespace(document.forms[0].TrafficFileName.value)) 
	{
	     alert("Please enter Traffic Name  ");
	     document.forms[0].TrafficFileName.focus();
	     return false;
	} 
	if (isWhitespace(document.forms[0].FileName.value)) 
	{
	     alert("Please enter Friendly Name  ");
	     document.forms[0].FileName.focus();
	     return false;
	}
	return true; 
}

/* OLD
function ValidEEmployment() {
	if (isWhitespace(document.myform.EmplResFName.value)) 
	{
	     alert("Please enter First Name  ");
	     document.myform.EmplResFName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResLName.value)) 
	{
	     alert("Please enter Last Name  ");
	     document.myform.EmplResLName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResEmail.value)) 
	{
	     alert("Please enter Email  ");
	     document.myform.EmplResEmail.focus();
	     return false;
	}
	if (isEmail(document.myform.EmplResEmail.value)==false) {
		 alert("Please enter a valid E-Mail address, like: name@companyname.com! ");
		 document.myform.EmplResEmail.focus();
		 return false;
	} 
	if (!isWhitespace(document.myform.EmplResZip.value)) { 
	 if (validateZIP(document.myform.EmplResZip)==false) {
		 document.myform.EmplResZip.focus();
		 return false;
	} 
	}
	if (isWhitespace(document.myform.EmplResVersion.value)) 
	{
	     alert("Please enter Version of Newsletter to Receive");
	     document.myform.EmplResVersion.focus();
	     return false;
	}
	if (document.myform.EmplResPhone.value.length > 0){ 
	if (IsPhone(document.myform.EmplResPhone.value)==false) {
		document.myform.EmplResPhone.focus();
			return false;
	}
	}
	return true;
}
*/

function ValidEEmployment() {
	if (isWhitespace(document.myform.EmplResFName.value)) 
	{
	     alert("Please enter First Name  ");
	     document.myform.EmplResFName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResLName.value)) 
	{
	     alert("Please enter Last Name  ");
	     document.myform.EmplResLName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResAddress.value)) 
	{
	     alert("Please enter Address  ");
	     document.myform.EmplResAddress.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResCity.value)) 
	{
	     alert("Please enter City  ");
	     document.myform.EmplResCity.focus();
	     return false;
	}
	if (document.myform.EmplResState.value==0) 
	{
	     alert("Please enter State  ");
	     document.myform.EmplResState.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResZip.value)) {
		alert("Please enter Zip code  ");
	     document.myform.EmplResZip.focus(); 
		 return false;
	} 
	if (validateZIP(document.myform.EmplResZip)==false) {
		 document.myform.EmplResZip.focus();
		 return false;
	}
	if (isWhitespace(document.myform.EmplResFile.value)) 
	{
	     alert("Please upload your resume ");
	     document.myform.EmplResFile.focus();
	     return false;
	}
	if (document.myform.EmplResPhone.value.length > 0){ 
	if (IsPhone(document.myform.EmplResPhone.value)==false) {
		document.myform.EmplResPhone.focus();
			return false;
	}
	}
	return true;
}

function ValidEmplResume() {
	if (isWhitespace(document.myform.EmplResFName.value)) 
	{
	     alert("Please enter First Name");
	     document.myform.EmplResFName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResLName.value)) 
	{
	     alert("Please enter Last Name");
	     document.myform.EmplResLName.focus();
	     return false;
	}
	if (isWhitespace(document.myform.EmplResEmail.value)) 
	{
	     alert("Please enter Email");
	     document.myform.EmplResEmail.focus();
	     return false;
	}
	if (isEmail(document.myform.EmplResEmail.value)==false) {
		 alert("Please enter a valid E-Mail address, like: name@companyname.com! ");
		 document.myform.EmplResEmail.focus();
		 return false;
	} 
	if (!isWhitespace(document.myform.EmplResZip.value)) { 
	if (validateZIP(document.myform.EmplResZip)==false) {
		 document.myform.EmplResZip.focus();
		 return false;
	} 
	}
	if (document.myform.EmplResPhone.value.length > 0){ 
	if (IsPhone(document.myform.EmplResPhone.value)==false) {
		document.myform.EmplResPhone.focus();
		return false;
	}
	}

  return true;
}


 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEG     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEG() {
	if ((isWhitespace(document.myform.xImage.value)) && (isWhitespace(document.myform.hidImg.value)))
	{
	     alert("Please upload Image!");
	     return false;
	}  
	/*
	if (isWhitespace(document.myform.Image.value) && isWhitespace(document.myform.xImage.value) )
	{
	     alert("Please upload Image!");
	     document.myform.Image.focus();
	     return false;
	}  
	if (document.myform.Image.value!="")	{
		myext = getExtension(document.myform.Image.value);
		if ((myext != "gif") && (myext != "jpg") && (myext != "jpe") && (myext != "jpeg") && (myext != "bmp")){
				alert ("Please Upload an Image with GIF,JPEG,BMP or JPG extension !");
				document.myform.Image.value.focus;
		return false; 
		}
	}
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.width.value > 600) {
	     alert("The Large Image's  width is too big! ");
	     document.myform.width.focus();
	     return false;
		}
	}  
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value ==0) {
	     alert("Please, push the button 'Check Image dimensions' ! ");
	     document.myform.height.focus();
	     return false;
		}
	}  	
	if (document.myform.Image.value!="")	{
		if (document.myform.height.value > 600) {
	     alert("The Large Image's height is too big!");
	     document.myform.height.focus();
	     return false;
		}
	}  */		
	if (!(isWhitespace(document.myform.EvImgOrder.value))) 	{
		if (isNumber1(document.myform.EvImgOrder.value)==false) {
			document.myform.EvImgOrder.focus();
			return false;
		}
	}  
}


function ValidStories() {
	if (isWhitespace(document.myform.txtTitle.value)){
		alert("Please enter Title  ! ");
	    document.myform.txtTitle.focus();
	    return false;
	}  	
	if (isWhitespace(document.myform.txtDescription.value)){
		alert("Please enter description ! ");
	    document.myform.txtDescription.focus();
	    return false;
	} 
	if (!(isWhitespace(document.myform.txtOrder.value))) 	{
		if (isNumber1(document.myform.txtOrder.value)==false) {
			document.myform.txtOrder.focus();
			return false;
		}
	}  
}


function ValidSuccessStories() {
	if (isWhitespace(document.myform.Story_Title.value)){
		alert("Please enter Title ! ");
	    document.myform.Story_Title.focus();
	    return false;
	} 
	if (isWhitespace(document.myform.txtShortDescription.value)){
		alert("Please enter description ! ");
	    document.myform.txtShortDescription.focus();
	    return false;
	} 		
	if(document.myform.txtCounter.value < 0 ){
		alert('Please do not exceed the limit of 250 characters!');
		document.myform.txtShortDescription.focus();
		return false;
	}	
	if (isWhitespace(document.myform.Story_Description.value)){
		alert("Please enter description ! ");
	    document.myform.Story_Description.focus();
	    return false;
	} 	

	
	return true;
}


function ValidLifeChangedStories() {
	if (isWhitespace(document.myform.txtTitle.value)){
		alert("Please enter Short Description  ! ");
	    document.myform.txtTitle.focus();
	    return false;
	}  	
	if (isWhitespace(document.myform.txtDescription.value)){
		alert("Please enter Long Description ! ");
	    document.myform.txtDescription.focus();
	    return false;
	} 
}


function checkLimit(iLimit, txtLimitArea, txtCounter) {
	
	var oCounter = document.getElementById(txtCounter);
	var oText = document.getElementById(txtLimitArea);
	
	if(oCounter == null || oText == null) return;
	 
	var prevCounter = iLimit - oCounter.value;
	oCounter.value = iLimit - oText.value.length;
	if(oCounter.value < 0){
		oCounter.value=0;
		alert('The limit of ' + iLimit + ' characters is exceeded!');
		oText.value = oText.value.substring(0,iLimit);
		return false;
	}
	return true;
}

//____________________________________________________________________________________
//_____________     Search Application      ________________________________________________

function SearchApp(){

	if (isWhitespace(document.myform.searchApp.value)) 
	{
		alert("Please enter search text!");
		document.myform.searchApp.focus();
		return false;
	} 
	
	document.myform.submit();
	return true;
}
     
     function changeBox(obj) {
//	obj.checked = !obj.checked;
	obj.checked = true;
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidEmailAF()      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidEmailAF() {
	if (isWhitespace(document.myform.UserName.value) && isWhitespace(document.myform.UserEmail.value)   ) 
	{
			alert("Please enter User Name or Email Address!");
			document.myform.UserName.focus();
			return false;
	}	
	if (!isWhitespace(document.myform.UserEmail.value)) 
	{
		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;
		}
	}
	 return true;
}


//________________________________________________________________________________________________
//_____________________      getExtension     _____________________________________________________________

function getExtensionVideo(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;
		}
	}
	var myext =field.substring(xlen+xpos, xlen).toLowerCase();
		if ( (myext != "swf") && (myext != "wmv")&& (myext != "mov") && (myext != "avi") ){
				alert ("Please Upload a Video  with WMV, AVI or MOV extension !");
		return false; }
		else
		{ return true;}
}



//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~      ValidVideo     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidVideo() {
	if ((isWhitespace(document.myform.xImage.value)) && (isWhitespace(document.myform.hidPDFFile.value)))
	{
	     alert("Please upload Video File!");
	     return false;
	}   
	if (!(isWhitespace(document.myform.VideoOrder.value))){
		if (isNumber1(document.myform.VideoOrder.value)==false) {
			document.myform.VideoOrder.focus();
			return false;
		}
	}		
}	




//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~     ValidNewsOrder     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

function ValidNewsOrder() {

	var theForm = document.myform;
	var nr = theForm.NewsOrder.length;
	var x1 = 0;
	var x2 = 0;
	var x3 = 0;
	var x4 = 0;
	
	for (i=0; i<nr; i++){
		if ((theForm.NewsOrder[i].value)!="0"){

				if ((theForm.NewsOrder[i].value)=="1"){x1 =x1 + 1};
				if ((theForm.NewsOrder[i].value)=="2"){x2 =x2 + 1};
				if ((theForm.NewsOrder[i].value)=="3"){x3 =x3 + 1};
				if ((theForm.NewsOrder[i].value)=="4"){x4 =x4 + 1};
		}

	}
		if ( (x1 > 1) || (x2 > 1)|| (x3 > 1)|| (x4> 1))
		{
	     alert("Please, make sure the Order Numbers are correct! ");
	     return false;
		
		}
}


function ValidEventsOrder() {

	var theForm = document.myform;
	var nr = theForm.EventsOrder.length;
	var x1 = 0;
	var x2 = 0;
	var x3 = 0;
	var x4 = 0;
	
	for (i=0; i<nr; i++){
		if ((theForm.EventsOrder[i].value)!="0"){

				if ((theForm.EventsOrder[i].value)=="1"){x1 =x1 + 1};
				if ((theForm.EventsOrder[i].value)=="2"){x2 =x2 + 1};
				if ((theForm.EventsOrder[i].value)=="3"){x3 =x3 + 1};
				if ((theForm.EventsOrder[i].value)=="4"){x4 =x4 + 1};
		}

	}

		if ( (x1 > 1) || (x2 > 1)|| (x3 > 1)|| (x4> 1))
		{
	     alert("Please, make sure the Order Numbers are correct! ");
	     return false;
		
		}
}





//	**************  3 fields input PHONE format *****************

function clearCharacters( oCtrl ) {
	oCtrl.value = oCtrl.value.replace(/\D/g,'');
}
function focusNext( oCtrl, NextCtrlID ) {
	if(oCtrl.value.length==3)
	{
		if (document.getElementById(NextCtrlID))
			document.getElementById(NextCtrlID).focus();
	}
}

function check3Phone( PhoneFieldID1, PhoneFieldID2, PhoneFieldID3, isRequired )
{
	
	if( (document.getElementById(PhoneFieldID1)) && (document.getElementById(PhoneFieldID2)) && (document.getElementById(PhoneFieldID3)) )
	{
		var PhoneField1 = document.getElementById(PhoneFieldID1);
		var PhoneField2 = document.getElementById(PhoneFieldID2);
		var PhoneField3 = document.getElementById(PhoneFieldID3);
		
		if ((PhoneField1.value.length > 0 ) || (PhoneField2.value.length > 0) || (PhoneField3.value.length > 0)) {
			
			if (PhoneField1.value.length < 3 ) {
				alert('This field must be a 3 digit from an U.S. phone number (like 415-555-1212)');
				PhoneField1.focus();
				return false;
			}
			if (PhoneField2.value.length < 3) {
				alert('This field must be a 3 digit from an U.S. phone number (like 415-555-1212)');
				PhoneField2.focus();
				return false;
			}
			if (PhoneField3.value.length < 4) {
				alert('This field must be a 4 digit from an U.S. phone number (like 415-555-1212)');
				PhoneField3.focus();
				return false;
			}
		}
		else
		{
			if ( isRequired ) 
			{
				alert("Please enter Phone ");
				PhoneField1.focus();
				return false;
			}
		}
	}
	
	return true;
}
function ValidPayment() { return true;}
function changeClass(Elem, myClass) 
{
	if(document.getElementById(Elem))
		document.getElementById(Elem).className = myClass;
}
function ViewHistory( )
{
	if(document.getElementById('divHistoryDetails'))
	{
		if(document.getElementById('divHistoryDetails').className == 'elemShow')
		{
			document.getElementById('divHistoryDetails').className = 'elemHide';
		}
		else
		{
			document.getElementById('divHistoryDetails').className = 'elemShow';
		}
	}
}