function check_form() {
	for (var i = 0; i < document.forms['genInfo'].elements.length; i++) {
		var FormElement = document.forms['genInfo'].elements[i].name
		 var j;
		 var radio_button_checked;
		 var radio_set;
		 
	  if (FormElement == "regType") {
    
    	radio_button_checked = false;
	    for(j=0;j<2;j++) {
		     radio_set = document.forms['genInfo'].regType[j];
		     if (radio_set.checked) radio_button_checked = true;
		    }
		    if(!radio_button_checked) {
		     alert('Please select your registration type.')
		     return false;
		    } 
	   }
	   
	   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 == "company") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your company!")
					return false
				}
			}	
			
		if (FormElement == "company") {
				if (document.forms['genInfo'].elements[i].value.length == 0)
				{
					alert("You must provide your company!")
					return false
				}
			}		
			
		

		if (FormElement == "birth_day") {
				if (document.forms['genInfo'].elements[i].selectedIndex == 0)
				{
					alert("You must select your birth day!");
					return false
				}
			}	

				
		if (FormElement == "phone1") {
				if (document.forms['genInfo'].elements[i].value.length < 3)
				{
					alert("You must provide your area code!")
					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 your state!");
					return false
				}
			}
		if (FormElement == "zip") {
				if (document.forms['genInfo'].elements[i].value.length < 5)
				{
					alert("You must provide your  5-digit  zip code!")
					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@anatomeco.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 email address.  Example:  Name@anatomeco.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@anatomeco.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@anatomeco.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@anatomeco.com")
					return false
				}
			
			}
			
	}
	return true	

}