// homepage estimeate form submit handler
function estimate_form(){
	var hReturnInfo;
	var tbFromZip = document.getElementById("tbFromZip");
	var lbFromZip = document.getElementById("lbFromZip"); 
	hReturnInfo = IsValidZipCode(tbFromZip.value, false); 
	
	var fromZipValue,fromCityValue,fromStateValue,toZipValue,toCityValue,toStateValue;
	
	if (hReturnInfo.ReturnCode > 0){
		tbFromZip.className += " error";
		lbFromZip.className += " error";
		return false;
	}else{
		tbFromZip.className = tbFromZip.className.replace(" error","");
		lbFromZip.className = lbFromZip.className.replace(" error","");
		
		fromZipValue = tbFromZip.value;
	}
	
	var tbFromCity = document.getElementById("tbFromCity");
	var lbFromCity = document.getElementById("lbFromCity");
	if(tbFromCity.value.length==0){
		tbFromCity.className += " error";
		lbFromCity.className += " error";
		return false;
	}else{
		tbFromCity.className = tbFromCity.className.replace(" error","");
		lbFromCity.className = lbFromCity.className.replace(" error","");
		
		fromCityValue = tbFromCity.value;
	}
	
	var tbToZip = document.getElementById("tbToZip");
	var lbToZip = document.getElementById("lbToZip"); 
	hReturnInfo = IsValidZipCode(tbToZip.value, false); 
	if (hReturnInfo.ReturnCode > 0){
		tbToZip.className += " error";
		lbToZip.className += " error";
		return false;
	}else{
		tbToZip.className = tbToZip.className.replace(" error","");
		lbToZip.className = lbToZip.className.replace(" error","");
		
		toZipValue = tbToZip.value;
	}
	
	var tbToCity = document.getElementById("tbToCity");
	var lbToCity = document.getElementById("lbToCity");
	if(tbToCity.value.length==0){
		tbToCity.className += " error";
		lbToCity.className += " error";
		return false;
	}else{
		tbToCity.className = tbToCity.className.replace(" error","");
		lbToCity.className = lbToCity.className.replace(" error","");
		
		toCityValue = tbToCity.value;
	}
	
	fromStateValue = document.getElementById("listboxFromState").selectedIndex;
	toStateValue = document.getElementById("listboxToState").selectedIndex;
	var params="fromZip="+fromZipValue+"&fromCity="+fromCityValue+"&fromState="+fromStateValue+"&toZip="+toZipValue+"&toCity="+toCityValue+"&toState="+toStateValue;
	location.href="estimate-step-1.php?"+params;
	
	
}