<!--

function check_form() {
	for (var i = 0; i < document.forms['genInfo'].elements.length; i++) {
		var FormElement = document.forms['genInfo'].elements[i].name
		
		
		if (FormElement == "children") {
				//alert('checking 9 months');
				if (document.forms['genInfo'].children[1].checked && document.forms['genInfo'].pregnant[1].checked)
				{
					alert("Please select whether you are pregnant and / or if you have any children.")
					return false
				}
				//alert('validated');
				
			}
		
		if (FormElement == "child_1_geckoyear" || FormElement == "child_1_geckomonth" || FormElement == "child_1_geckoday") {
				//alert('checking 9 months');
				if (document.forms['genInfo'].children[0].checked && (document.forms['genInfo'].elements[i].options.selectedIndex < 1))
				{
					alert("Please enter your first child's birth date.")
					return false
				}
				//alert('validated');
				
			}
			
		if (FormElement == "phone_area") {
				//alert('checking 9 months');
				if (document.forms['genInfo'].chkOffer12.checked && (document.forms['genInfo'].elements[i].value.length < 3))
				{
					alert("For the Brighter Vision offer above that you selected, please enter your complete phone number with area code.  Thank you.")
					return false
				}
				//alert('validated');
				
			}
			
		if (FormElement == "phone_number") {
				//alert('checking 9 months');
				if (document.forms['genInfo'].chkOffer12.checked && (document.forms['genInfo'].elements[i].value.length < 7))
				{
					alert("For the Brighter Vision offer above that you selected, please enter your complete phone number with area code.  Thank you.")
					return false
				}
				//alert('validated');
				
			}
		 
		if (FormElement == "fname") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your first name!")
					return false
				}
			}
		if (FormElement == "lname") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your last name!")
					return false
				}
			}
		if (FormElement == "address") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your address!")
					return false
				}
			}
		if (FormElement == "city") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your city!")
					return false
				}
			}
		if (FormElement == "state") {
				if (document.forms['genInfo'].elements[i].selectedIndex == 0)
				{
					alert("You must select a state!");
					return false
				}
			}
			

		if (FormElement == "dueMth" && document.forms['genInfo'].pregnant[0].checked) {
				if (document.forms['genInfo'].elements[i].selectedIndex == 0)
				{
					alert("Please enter your estimated due date!");
					return false
				}
			}			
		if (FormElement == "dueDay" && document.forms['genInfo'].pregnant[0].checked) {
				if (document.forms['genInfo'].elements[i].selectedIndex == 0)
				{
					alert("Please enter your estimated due date!");
					return false
				}
			}			
		if (FormElement == "dueYear" && document.forms['genInfo'].pregnant[0].checked) {
				if (document.forms['genInfo'].elements[i].selectedIndex == 0)
				{
					alert("Please enter your estimated due date!");
					return false
				}
			}			

		if (FormElement == "zip") {
				if (document.forms['genInfo'].elements[i].value.length < 5)
				{
					alert("You must provide your zip!")
					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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.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@freebabyoffers.com")
					return false
				}
			
			}	
			
	
	}
	return true	

}

<!--
		function CSURLPopupShow(formName, popupName, target) {
		var popup = document[formName].elements[popupName];
		window.open(popup.options[popup.selectedIndex].value, target);
		popup.selectedIndex = 0;
		}
		function openScript(url, width, height) {
	        var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,status=no' );
		}
	// -->
//-->