// Primary zip box quote start

function NewQuote(theQuote)
{
 	var strSITE = "";
 
  	//strSITE = "https://aboutsr22insurance.com/ia/auto";
	//strSITE = strSITE + "?zip=" + document.getElementById('zip').value;
	
	//strSITE = "https://aboutsr22insurance.com/car-insurance-quote/auto-form.php?afftrack=ABOUT";
	//strSITE = strSITE + "&zip=" + document.getElementById('zip').value;
  
 
  	strSITE = "https://aboutsr22insurance.com/results.html";
	strSITE = strSITE + "?zipcode=" + document.getElementById('zip').value;
   
   	window.open(strSITE,null,"fullscreen=yes, toolbars=yes, scrollbars=yes, menubar=yes, location=yes");
     
}

function splitpage(theQuote) 
{    
	var strError = "";

	if(document.getElementById('zip').value=="")

	{
		strError = strError + "We need your zip code to get quotes.\n";

		theQuote.ZipCode.focus();
	}
     if (strError != "")
     {
           alert(strError);

           return false;
     }
     else
    {
         //window.location="http://aboutsr22insurance.com/results.html?zipcode=" + document.getElementById('zip').value;
		 //window.location="http://aboutsr22insurance.com/faq.html";
		 window.location.reload
     }
}

function ErrorCheck(theQuote)

{
	var strError = "";

	if(theQuote.ZipCode.value=="")

	{
		strError = strError + "We need your zip code to get quotes.\n";

		theQuote.ZipCode.focus();
	}
	else
        {        
          if(theQuote.ZipCode.value.length!=5)
        	{

          		strError = strError + "Zip code should only be 5 digits, please re-enter zip code.\n";

        		theQuote.ZipCode.focus();
        	}
        }

     if (strError != "")
     {
           alert(strError);
           return false;
     }
     else
    {
      NewQuote(theQuote);
     }
}	
