function ValidateForm () {
	var errorMsg = "";
		
	if (document.customer_submit.firstName.value == "") 
		{
			errorMsg += "\n Please enter your first name.";
		}
		
	if (document.customer_submit.lastName.value == "") 
		{
			errorMsg += "\n Please enter your last name.";
		}
	
	if (document.customer_submit.address1.value == "") 
		{
			errorMsg += "\n Please enter your address.";
		}
		
	if (document.customer_submit.company)
	{
		if (document.customer_submit.company.value == "") 
			{
				errorMsg += "\n Please enter your company.";
			}
	}
	
	if (document.customer_submit.city.value == "") 
		{
			errorMsg += "\n Please enter your city.";
		}
		
	if (document.customer_submit.state.value == "") 
		{
			errorMsg += "\n Please select your state.";
		}
		
	if (document.customer_submit.zipCode.value == "") 
		{
			errorMsg += "\n Please enter your zip code.";
		}

	if (document.customer_submit.countryCode.value == "") 
		{
			errorMsg += "\n Please select your Country.";
		}
	
	if (document.customer_submit.phone1_area.value && document.customer_submit.phone1_pre.value 
    	&&document.customer_submit.phone1_suff.value)
		{
			if (isNaN(document.customer_submit.phone1_area.value) || isNaN(document.customer_submit.phone1_pre.value)
	    	|| isNaN(document.customer_submit.phone1_suff.value))
				{
					errorMsg += "\n Please enter a valid Phone Number";
				}
	   	}
		else
			{
				errorMsg += "\n Please enter your Phone Number";
			}
			
	if (isNaN(document.customer_submit.phone2_area.value) || isNaN(document.customer_submit.phone2_pre.value)
	    	|| isNaN(document.customer_submit.phone2_suff.value))
				{
					errorMsg += "\n Please enter a valid Phone Number for Phone 2";
				}
				
	if (document.customer_submit.emailAddress.value.length == 0)
		{
			errorMsg += "\n Please enter an Email Address.";
		}
		else
			{
				//var field = form.Email;
				var str = document.customer_submit.emailAddress.value;
				var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
				var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
				if (reg1.test(str) || !reg2.test(str))
					errorMsg += "\n Please enter a valid email address";
			}



	if (errorMsg != "")
		{
			alert(errorMsg);
			return false;
		} 
		else
		{
			return true;
		}
}

function trim(strText) { 
   	// this will get rid of leading spaces 
  		 while (strText.substring(0,1) == ' ') 
  	     strText = strText.substring(1, strText.length);	
  		 // this will get rid of trailing spaces 
	 while (strText.substring(strText.length-1,strText.length) == ' ')
   		    strText = strText.substring(0, strText.length-1);
	 return strText;
} 

function MoveField(current, form) {
	 if(current == "area")
	    if(form.phone1_area.value.length == 3)
	      form.phone1_pre.focus();
	      
	  if(current == "prefix")
	    if(form.phone1_pre.value.length == 3)
	      form.phone1_suff.focus();
		  
	  if(current == "suffix")
	     if(form.phone1_suff.value.length == 4)
		    form.phone1_ext.focus();
	}

function MoveField2(current, form) {
	 if(current == "area")
	    if(form.phone2_area.value.length == 3)
	      form.phone2_pre.focus();
	      
	  if(current == "prefix")
	    if(form.phone2_pre.value.length == 3)
	      form.phone2_suff.focus();
		  
	  if(current == "suffix")
	     if(form.phone2_suff.value.length == 4)
		    form.phone2_ext.focus();
	 
	}
