<!--
function check_form() {
	for (var i = 0; i < document.forms['genInfo'].elements.length; i++) {
		var FormElement = document.forms['genInfo'].elements[i].name
		 
		if (FormElement == "realname") {
			if (document.forms['genInfo'].elements[i].value.length == 0)
			{
				alert("You must provide your name!")
				return false
			}
		}
			
		if (FormElement == "Originstate") {
			if (document.forms['genInfo'].elements[i].selectedIndex == 0)
			{
				alert("You must select a from state!");
				return false
			}
		}	
		if (FormElement == "Destinationstate") {
			if (document.forms['genInfo'].elements[i].selectedIndex == 0)
			{
				alert("You must select a to state!");
				return false
			}
		}		
		if (FormElement =="email") {
			var vlength
    			vlength=document.forms['genInfo'].elements[i].value.length-1
			if (document.forms['genInfo'].elements[i].value.length == 0)
			{
				alert("You must enter a valid email address.  Example:  name@movingplace.com")
				return false
			}

			if (document.forms['genInfo'].elements['email'].value != document.forms['genInfo'].elements['confEmail'].value)
			{
				alert("Your confirmation email must equal your email address!");
				return false
			}
  			// Check for a valid email address (Does it contain a "@" and ".")
  			if(document.forms['genInfo'].elements[i].value.indexOf('@', 0) == -1 || document.forms['genInfo'].elements[i].value.indexOf('.',0)==-1)
			{
				alert("You must enter a valid email address.  Example:  name@movingplace.com")
				return false
			}
 			// Check for a valid email address ("@" or "." cannot be first character)
			if(document.forms['genInfo'].elements[i].value.charAt(0)=='@' || document.forms['genInfo'].elements[i].value.charAt(0)=='.')
			{
				alert("You must enter a valid email address.  Example:  name@movingplace.com")
				return false
			}
			// Check for a valid email address ("@" or "." cannot be last character)
			if(document.forms['genInfo'].elements[i].value.charAt(vlength)=='@' || document.forms['genInfo'].elements[i].value.charAt(vlength)=='.')
			{
				alert("You must enter a valid email address.  Example:  name@movingplace.com")
				return false
			}
  			// Check for a valid email address (Cannot have "@." or ".@")
			if(document.forms['genInfo'].elements[i].value.indexOf('@.')!=-1 || document.forms['genInfo'].elements[i].value.indexOf('.@')!=-1)
			{
				alert("You must enter a valid email address.  Example:  name@movingplace.com")
				return false
			}
		
		}
			
		if (FormElement =="confEmail") {
			var vlength
    			vlength=document.forms['genInfo'].elements[i].value.length-1
			if (document.forms['genInfo'].elements[i].value.length == 0)
			{
				alert("You must enter a valid confirmation email address.  Example:  name@movingplace.com")
				return false
			}

 			// Check for a valid email address (Does it contain a "@" and ".")
  			if(document.forms['genInfo'].elements[i].value.indexOf('@', 0) == -1 || document.forms['genInfo'].elements[i].value.indexOf('.',0)==-1)
			{
				alert("You must enter a valid confirmation email address.  Example:  name@movingplace.com")
				return false
			}
 			// Check for a valid email address ("@" or "." cannot be first character)
			if(document.forms['genInfo'].elements[i].value.charAt(0)=='@' || document.forms['genInfo'].elements[i].value.charAt(0)=='.')
			{
				alert("You must enter a valid confirmation email address.  Example:  name@movingplace.com")
				return false
			}
			// Check for a valid email address ("@" or "." cannot be last character)
			if(document.forms['genInfo'].elements[i].value.charAt(vlength)=='@' || document.forms['genInfo'].elements[i].value.charAt(vlength)=='.')
			{
				alert("You must enter a valid confirmation email address.  Example:  name@movingplace.com")
				return false
			}
  			// Check for a valid email address (Cannot have "@." or ".@")
			if(document.forms['genInfo'].elements[i].value.indexOf('@.')!=-1 || document.forms['genInfo'].elements[i].value.indexOf('.@')!=-1)
			{
				alert("You must enter a valid confirmation email address.  Example:  name@movingplace.com")
				return false
			}
			
		}
		
		if (FormElement =="couponCode") {
			if (document.forms['genInfo'].elements[i].value.length == 0)
			{ 
				alert('Please enter a valid coupon code.');
				return false;
			}
		}
	}
	return true	

}
//-->

