

function OpenNewForm(theForm)
{
		
	var strURL = "";
	  
	strURL = "https://www.insurancestep.com/auto/auto-form.php";
	strURL = strURL + "?zip=" + document.getElementById('zip').value;
	strURL = strURL + "&insured=" + document.getElementById('insured').value;
	strURL = strURL + "&afftrack=" + document.getElementById('afftrack').value;

	window.open(strURL,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes");
}

function redirect(theForm)
{

    var strURL = ""; 

    var source = document.getElementById('source').value;
    var zipcode = document.getElementById('zip').value;
    var afftrack = document.getElementById('afftrack').value;

    strURL = "https://www.insurancestep.com/auto/MM.html";

    strURL = strURL + "?afftrack=" + afftrack;
    strURL = strURL + "&zip=" + zipcode;    

    window.location=strURL;	
}


function ValidateForm(theForm)
{
	var strErr = "";

	if(theForm.zip.value=="")
	{
		strErr = strErr + "Please enter zip code.\n";
		theForm.ZipCode.focus();
	}
	else
	{
		if(theForm.zip.value.length!=5)
			{
				strErr = strErr + "Please enter valid zip code.\n";
				theForm.zip.focus();
			}
	}

	if (strErr != "")
	{
		alert(strErr);
		return false;
	}
	else
	{
		OpenNewForm(theForm);
	}
     }	
	 

$(document).ready(function(){
	$("input#submit_button").mouseover(function(){
		$("div#submit_bkg img#inner").css('top','-54px');
	}).mouseout(function(){
		$("div#submit_bkg img#inner").css('top','0px');
	})
})