//
//Override submit - require ship name
//

//------------------
//SUPPORTER.ASP page
//------------------
if (document.location.href.indexOf("supporter.asp") > 0) {
	
	//override onsubmit function
	document.getElementById('FormSupporter').onsubmit = function(){return CheckFormNew(document.SUPPORTER);};
    $('input[name=ShiptoProvince]').parent().parent().parent().attr("style","display:none");
	$('select[name=ShiptoCountry]').parent().parent().parent().attr("style","display:none");
	
}
//override default field check
function CheckFormNew(thisform) {
	focus_field = "";
	warning = "";
	warning=checkField(thisform.first_name,"First Name",warning);
    warning=checkField(thisform.last_name,"Last Name",warning);
    warning=checkField(thisform.email_address,"Email",warning);
    warning=checkField(thisform.address_line_1,"Address Line 1",warning);warning=checkField(thisform.city,"City",warning);
    warning=checkSelect(thisform.state,"State",warning);
    warning=checkField(thisform.zip,"ZIP/Postal Code",warning);
    warning=checkField(thisform.county,"County",warning);
    warning=checkField(thisform.phone_number,"Phone",warning);
    warning=checkField(thisform.ShiptoName,"Shipping Name",warning);    
    warning=checkField(thisform.ShiptoAddress1,"Shipping Address Line 1",warning);
    warning=checkField(thisform.ShiptoCity,"Shipping City",warning);
    warning=checkSelect(thisform.ShiptoState,"Shipping State",warning);
    warning=checkField(thisform.ShiptoZip,"Shipping ZIP/Postal Code",warning);
    warning=checkSelect(thisform.ShiptoCountry,"Shipping ",warning);
	if (warning!="") {
		warning="Please enter the following fields to continue:\n- "+warning+"";
		alert(warning);
		if (focus_field != "")
			focus_field.focus();
		return false;
	}
	

	if ((thisform.ShiptoZip != null) && (thisform.ShiptoCountry != null)) { 
		if (checkCountryZip(thisform.ShiptoZip,thisform.ShiptoCountry) == false) {
			thisform.ShiptoZip.focus();
			return false;
		}
	}
	if (thisform.email_address!=null)
		if (thisform.email_address.value!="")
			if (validEmail(thisform.email_address.value) == false)  {
				thisform.email_address.focus();
				return false;
			}
	if ((thisform.zip != null) && (thisform.country != null))
		if (checkCountryZip(thisform.zip,thisform.country) == false) {
			//alert("Please enter a valid zip code");
			thisform.zip.focus();
			return false;
		}

	if ((thisform.BillZip != null) && (thisform.BillCountry != null))
		if (checkCountryZip(thisform.BillZip,thisform.BillCountry) == false) {
			//alert("Please enter a valid zip code");
			thisform.BillZip.focus();
			return false;
		}
	
	thisform.action="supporteradd.asp?c=ddKDIMNtEqG&b=4366337&en=8rKFKROvE5KFKRPCImLTL2OHJbLPL8PPIrL5F"; 
	return true;
 }

