// JavaScript Document

// validate the contact us form before submitting it
function ValidateForm(frm) {
	// contactform
	// name and id must be the same for each input
	//validate for empty fileds and reurn to the empty field without submitting the form
	// only validate REQUIRED FIELDS
	
//	<input name="realname" 
//	input name="telephone"
//	<input name="address1" 
//	<input name="address2"
//	<input name="towncity"
//	<input name="countystate"
//	<input name="postzipcode" 
//	<input name="country" 
//	<input name="email" 
//	<textarea name="comments"   10 inputs


// check email address first !
 if (!frm.email.value)	{
		alert ("Please enter a value for the EMAIL field");
	 	frm.email.focus();
	  	frm.email.select();
		return false;
	
	 } else {
					if (frm.email.value.indexOf("@") > 0) // check for @ character 
					{				
					} else {
							alert ("Please enter a VALID Email address in the EMAIL field");
									frm.email.focus();
									frm.email.select();
						return false;
					}
	
	}

if (!frm.realname.value)	{
		alert ("Please enter a value for the NAME field");
	 	frm.realname.focus();
	  	frm.realname.select();
		return false;
	 }
	 
	 if (!frm.telephone.value)	{
		alert ("Please enter a value for the TELEPHONE field");
	 	frm.telephone.focus();
	  	frm.telephone.select();
		return false;
	 }
	 if (!frm.address1.value)	{
		alert ("Please enter a value for the ADDRESS 1 field");
	 	frm.address1.focus();
	  	frm.address1.select();
		return false;
	 }
	 
//	 if (!frm.address2.value)	{
//		alert ("Please enter a value for the ADDRESS 2 field");
//	 	frm.address2.focus();
//	  	frm.address2.select();
//		return false;
//	 }

	 if (!frm.towncity.value)	{
		alert ("Please enter a value for the TOWN / CITY field");
	 	frm.towncity.focus();
	  	frm.towncity.select();
		return false;
	 }
	 if (!frm.countystate.value)	{
		alert ("Please enter a value for the COUNTY / STATE field");
	 	frm.countystate.focus();
	  	frm.countystate.select();
		return false;
	 }
	 if (!frm.postzipcode.value)	{
		alert ("Please enter a value for the POST / ZIP CODE field");
	 	frm.postzipcode.focus();
	  	frm.postzipcode.select();
		return false;
	 }
	 if (!frm.country.value)	{
		alert ("Please enter a value for the COUNTRY field");
	 	frm.country.focus();
	  	frm.country.select();
		return false;
	 }
		
//	if (!frm.comments.value)	{
//		alert ("Please enter a value for the COMMENTS field");
//	 	frm.comments.focus();
//	  	frm.comments.select();
//		return false;
//	 }
		if (frm.foundwebsite.value=="default")	{
		alert ("Please select a value from the 'How Did You Find The Web Site' List");
	 	frm.foundwebsite.focus();
	  	//frm.foundwebsite.select();
		return false;
	 }
	
	if (frm.contactreason.value=="default")	{
		alert ("Please select a value from the 'Reason For Contact' List");
	 	frm.contactreason.focus();
	 	//frm.contactreason.select();
		return false;
	 }	
	
		
		// submit=true calls the formmail script
return true;	
}

