
function verify()
{
     s=document.form1.zip.value;
    // Check for correct zip code
     reZip = new RegExp(/(^\d{5}$)|(^\d{5}-\d{4}$)/);

     if (!reZip.test(s)) {
          alert("Zip Code Is Not Valid");
		  document.form1.zip.focus();
          return false;
     }

	return true;
}
function postform(theForm)
{
	var zipcode = document.form1.zip.value;
	var type = document.form1.type.value;
	var tid = document.form1.tid.value;
if (verify()){
	var mine = window.open('http://usgeneralinsurance.com/quotes.php?tid=' + tid + '&zip=' + zipcode + '&type=' + type);
	if(mine){}
	else{
		window.location.href='http://usgeneralinsurance.com/quotes.php?tid=' + tid + '&zip=' + zipcode + '&type=' + type;
		return false ;
		mine.close()

	 	}
	return true;
} else{ return false;}
}
function sure(theForm)
{
	var zipcode = document.form1.zip.value;
	var type = document.form1.type.value;
	var tid = document.form1.tid.value;
	window.location.href='http://usgeneralinsurance.com/feature.php?source=' + tid + '&zip=' + zipcode + '&type=' + type;
}

