function check_sign_up_to_vote_form(){
	var error="0";
	var error_msg="";
	var firstname = document.sign_up_to_vote_form.firstname;
	var lastname = document.sign_up_to_vote_form.lastname;
	var address = document.sign_up_to_vote_form.address;
	var address2 = document.sign_up_to_vote_form.address2;
	var email1 = document.sign_up_to_vote_form.email;
	
	var city = document.sign_up_to_vote_form.city;
	var state = document.sign_up_to_vote_form.state;
	var zip = document.sign_up_to_vote_form.zip;
	var phone1 = document.sign_up_to_vote_form.phone1;
	var phone2 = document.sign_up_to_vote_form.phone2;
	var phone3 = document.sign_up_to_vote_form.phone3;
//	alert(phone1.value);
	var birth_ym_y = document.sign_up_to_vote_form.birth_ym_y;
	var birth_ym_m = document.sign_up_to_vote_form.birth_ym_m;
	//var birth_ym_d = document.sign_up_to_vote_form.birth_ym_d;
	var chiled=document.getElementById("chiled");
	
	var email = document.sign_up_to_vote_form.child_email;
	var title = document.sign_up_to_vote_form.title;
	var password = document.sign_up_to_vote_form.password; 
	var passcheck = document.sign_up_to_vote_form.passcheck; 
	
	var parent_email = document.sign_up_to_vote_form.parent_email;
	var parent_firstname = document.sign_up_to_vote_form.parent_firstname;
	var parent_lastname = document.sign_up_to_vote_form.parent_lastname; 
	var  pattern   =   /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;  
	var patterns   =/ {0,9}\d{2,3}-\d{5,9}|0\d{2,3}-\d{5,9}/;
	if(firstname.value.trim()=="")
	{
		alert("First Name Can not be empty");
		firstname.focus();
		return false;
	}
	if(lastname.value.trim()=="")
	{
		alert("Last Name Can not be empty");
		lastname.focus();
		return false;
	}
	if(email1.value.trim()=="")
	{
		alert("Email Address Can not be empty");
		email1.focus(); 
		return false;
	}
	 if(email1.value.trim()!="" && pattern.test(email1.value)==false)
	 {
		alert("non-standard email");
		email1.focus(); 
		return false;
	 }
	 if(birth_ym_y.value=="")
	 {
		alert("Please select Date Of Birth"); 
		return false;
	 }
	 if(birth_ym_m.value=="")
	 {
		alert("Please select Date Of month"); 
		return false;
	 }
	 if(chiled.style.display=="block")
	 { 
		 if(parent_firstname.value.trim()=="")
		 {
			alert("Parent's First Name Can not be empty");
			parent_firstname.focus(); 
			return false;
		 }
		 if(parent_lastname.value.trim()=="")
		 {
			alert("Parent's Last Name Can not be empty");
			parent_lastname.focus(); 
			return false;
		 }
		 if(parent_email.value.trim()=="")
		 {
			alert("Parent's Email Address Can not be empty");
			parent_email.focus(); 
			return false;
		 }
		 else
		 {
			 if(parent_email.value.trim()!="" && pattern.test(parent_email.value)==false)
			 {
				alert("non-standard parent_email");
				parent_email.focus(); 
				return false;
			 }
		 }
	 	  
	 }	 
	if(address.value.trim()=="")
	{
		alert("Address Can not be empty");
		address.focus();
		return false;
	}
/*
	if(address2.value.trim()=="")
	{
		alert("Address 2 Can not be empty");
		address2.focus();
		return false;
	}*/
	if(city.value.trim()=="")
	{
		alert("city Can not be empty");
		city.focus();
		return false;
	}
	if(zip.value.trim()=="")
	{
		alert("zip Can not be empty");
		zip.focus();
		return false;
	}
	

	if(phone1.value.length != 3 )
	{
		alert("Telephone format not correct, such 555-583-9609");
		phone1.focus();
		return false;
	}
	
		if(phone2.value.length != 3 )
	{
		alert("Telephone format not correct, such 555-583-9609");
		phone2.focus();
		return false;
	}
	
		if( phone3.value.length != 4)
	{
		alert("Telephone format not correct, such 555-583-9609");
		phone3.focus();
		return false;
	}

	if(title.value=="")
	{
		alert("Please Select Gender"); 
		return false;
	}
 
	if(password.value.trim()=="")
	{
		alert("password Can not be empty");
		password.focus();
		return false;
	}
	if(passcheck.value!=password.value)
	{
		alert("Not the same password twice, please re-enter");
		passcheck.focus();
		return false;
	} 
	//alert("Register for success!");
	//document.sign_up_to_vote_form.submit();
}


	 function is_chield(obj)
	 {
	 	 
		 if(obj>1998)
		 {
			document.getElementById("chiled").style.display="block"; 
		 }
		 else
		 {
			document.getElementById("chiled").style.display="none"; 
		 }
	 }
	 
	 
	 function show_cc_email(o){
	//alert(email_html)
		$.get("email_to_friend.asp", "", function(result){$(o).wBoxx({html:result});}, "text");

	}
