
function validateForm() {
	  error = false;  
	
		first = $("#first").val();
		last = $("#last").val();
		email = $("#email").val();
		email_confirm = $("#email_confirm").val();
		company = $("#company").val();
		address = $("#address").val();
		city = $("#city").val();
		state = $("#state").val();
		zip = $("#zip").val();

		first_s = $("#s_first").val();
		last_s = $("#s_last").val();
		email_s = $("#s_email").val();
		email_confirm_s = $("#s_email_confirm").val();
		company_s = $("#s_company").val();
		address_s = $("#s_address").val();
		city_s = $("#s_city").val();
		state_s = $("#s_state").val();
		zip_s = $("#s_zip").val();		
		
		if(first == ""){
			alert("Please fill in First Name");
			error = true;
		}
		if(last == ""){
			alert("Please fill in Last Name");
			error = true;
		}
		if(email == ""){
			alert("Please fill in Email");
			error = true;
		}
		if(email_confirm == ""){
			alert("Please fill in Email Confirm");
			error = true;
		}
		if(email_confirm != email){
			alert("Email and Email Confirm should have data.");
			error = true;
		}
		if(company == ""){
			alert("Please fill in Company Name");
			error = true;
		}
		if(address == ""){
			alert("Please fill in Address");
			error = true;
		}
		if(city == ""){
			alert("Please fill in City");
			error = true;
		}
		if(state == ""){
			alert("Please fill in State");
			error = true;
		}
		if(zip == ""){
			alert("Please fill in Zip");
			error = true;
		}

		if(first_s == ""){
			alert("Please fill in Mailing First Name");
			error = true;
		}
		if(last_s == ""){
			alert("Please fill in Mailing Last Name");
			error = true;
		}
		if(company_s == ""){
			alert("Please fill in Mailing Company Name");
			error = true;
		}
		if(address_s == ""){
			alert("Please fill in Mailing Address");
			error = true;
		}
		if(city_s == ""){
			alert("Please fill in Mailing City");
			error = true;
		}
		if(state_s == ""){
			alert("Please fill in Mailing State");
			error = true;
		}
		if(zip_s == ""){
			alert("Please fill in Mailing Zip");
			error = true;
		}		

	if(error == true){
		return false;
	}
	
};

function mailingAddress(){
		first = $("#first").val();
		last = $("#last").val();
		email = $("#email").val();
		email_confirm = $("#email_confirm").val();
		company = $("#company").val();
		address = $("#address").val();
		city = $("#city").val();
		state = $("#state").val();
		zip = $("#zip").val();
		country = $("select#country").val();
		
		var val = [];
    $(':checkbox:checked').each(function(i){
      val[i] = $(this).val();
    });
    
	if(val[1] == "on"){
		$("#s_first").val(first);
		$("#s_last").val(last);
		$("#s_company").val(company);
		$("#s_address").val(address);
		$("#s_city").val(city);
		$("#s_state").val(state);
		$("#s_zip").val(zip);
		$("select#s_country").val(country);
	}else{
		$("#s_first").val("");
		$("#s_last").val("");
		$("#s_company").val("");
		$("#s_address").val("");
		$("#s_city").val("");
		$("#s_state").val("");
		$("#s_zip").val("");
		$("select#s_country").val("USA");
	}
}
