//<!--
/*
	Validation 3
	============
	Billing Check
	Phone Number is not required
	ZipCode Vs State AJAX Check
*/
function checkInfo()
{
	if(is_this_being_used == true)
	{
		return false;
	}

	if(checkQuantity() == false)
	{
		return false;	
	}
	
	//var_checkProductid = checkProductid(document.getElementById("productid"));

	
	var_checkFName = checkFName(document.getElementById("bill_fname"));
	if(var_checkFName != undefined)
	{
		alert(var_checkFName);
		return false;
	}
	
	var_checkLName = checkLName(document.getElementById("bill_lname"));
	if(var_checkLName != undefined)
	{
		alert(var_checkLName);
		return false;
	}

	var_checkAddress = checkAddress(document.getElementById("bill_address1"));
	if(var_checkAddress != undefined)
	{
		alert(var_checkAddress);
		return false;
	}
	
	var_checkCity = checkCity(document.getElementById("bill_city"));
	if(var_checkCity != undefined)
	{
		alert(var_checkCity);
		return false;
	}

	var_checkState = checkState2(document.getElementById("bill_state"));
	if(var_checkState != undefined)
	{
		alert(var_checkState);
		return false;
	}

	var_checkZip = checkZip(document.getElementById("bill_zip"), document.getElementById("bill_country"))
	if(var_checkZip != undefined)
	{
		alert(var_checkZip);
		return false;
	}else{
		
		if(document.getElementById("bill_country").value == "US"){
			var whichzip = document.getElementById("bill_zip").value;
			var whichstate = document.getElementById("bill_state").value;
			var stop = 0;
			$.ajax({
			  type: "POST",
			  url: "js/checkZip.php?state="+whichstate+"&zip="+whichzip,
			  data: "state="+whichstate+"&zip="+whichzip,
			  async: false,
			  success: function(msg){
			    if(msg == "1"){
			    	alert("Your ZipCode is not a valid match for your State");
				stop = 1;
			    }
			  }
			});	
			if(stop == 1)
				return false;
		}
	}
	
	var_checkEmail = checkEmail(document.getElementById("bill_email"))
	if(var_checkEmail != undefined)
	{
		alert(var_checkEmail);
		return false;
	}
	
	var_checkPhoneNR = checkPhoneNR(document.getElementById("bill_phone1"), document.getElementById("bill_phone2"), document.getElementById("bill_phone3"));
	if(var_checkPhoneNR != undefined)
	{
		alert(var_checkPhoneNR);
		return false;
	}
	
	var_checkCC = checkCC(document.getElementById("cc_type"), document.getElementById("cc_date"), document.getElementById("cc_year"), document.getElementById("cc_num"));
	if(var_checkCC != undefined)
	{
		alert(var_checkCC);
		return false;
	}
}
//-->
