// JavaScript Document

function checkEmail() {
     e=document.form1.email.value;
     reZipe = new RegExp(/^\w+([\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/);
    if (!reZipe.test(e)) {
          alert("E-Mail Is Not Valid");
		  document.form1.email.focus();
        return false;
    }
    return true;
}

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 cite = document.form1.cite.value;
	var tid = document.form1.tid.value;
if (verify()){
	var mine = window.open('/?page=quotes&zip=' + zipcode + '&type=' + type + '&tid=' + tid + '&cite=' + cite);
	if(mine){}
	else{
		window.location.href='/?page=quotes&zip=' + zipcode + '&type=' + type + '&tid=' + tid + '&cite=' + cite;
		return false ;
		mine.close()
	}
} else{ return false;}
}

function sure(theForm)
{
	var zipcode = document.form1.zip.value;
	var type = document.form1.type.value;
	var cite = document.form1.cite.value;
	var tid = document.form1.tid.value;
	window.location.href='/?page=feature&zip=' + zipcode + '&type=' + type + '&source=' + tid + '&cite=' + cite;
}

