// JavaScript Document

function NewQuote(theQuote)
{
 	var strSITE = "";
 
  	strSITE = "https://forms.insuranceagents.com/life/?a=99783&t=1065&c=life";
    
    strSITE = strSITE + "&zip=" + 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="results.html?zipcode=" + document.getElementById('zip').value;	
     }
}

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);
     }
}	
