// JavaScript Document


function NewQuote(theQuote)
{
 	var strSITE = "";
 
	strSITE = "https://landlordinsuranceqts.com/ia/home/";
	strSITE = strSITE + "?zip=" + document.getElementById('zip').value;
	
	//strSITE = "https://landlordinsuranceqts.com/home-insurance-quote/home-form.php?afftrack=lndqts";
	//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 + "PLEASE ENTER YOUR ZIP CODE.\n";

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

           return false;
     }
     else
    {
	
         window.location="http://landlordinsuranceqts.com/results.html?zipcode=" + document.getElementById('zip').value;	
		 //window.location="http://landlordinsuranceqts.com/faqs/How-to-screen-tenants-credit-and-criminal-background.html";
     }
}

function ErrorCheck(theQuote)

{
	var strError = "";

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

	{
		strError = strError + "PLEASE ENTER YOUR ZIP CODE.\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);
     }
}	

