 ch=0;
	function change()
	{
		data = cha.innerHTML;
		ch=1;
		cha.innerHTML="";
	}

	function change1(){
		if (ch)
		{
			cha.innerHTML=data;
		}
	}
	

function search()
{
document.form1.method="POST"
document.form1.action="/cgi-bin/sitesearch.cgi"
document.form1.submit()
}

function Validate1(x)
 {
 

 var retValue=false;
 var invalidChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%^&*(){}|\':;?/<>,.@-+=[]~`_ ";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
 }


function Validate2(x)
 {
 

 var retValue=false;
 var invalidChars="0123456789!#$%^&*(){}|\':;?/<>";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
 }


function Validate3(x)
 {
 

 var retValue=false;
 var invalidChars=".@";
 var i;
  
for(i=0;i<invalidChars.length;i++)
 {
  if(x.indexOf(invalidChars.charAt(i))>-1)
  {
     retValue=true;
     break;
   }
 }
 
return retValue;
}

function validate_short1()
{
	if (document.form1.loan.value=="not")
{
alert("Please Select Loan Type ");
document.form1.loan.focus();
return false;
}

 if(document.form1.fname.value=="")
	{
		alert("Please Enter Your First Name. ");
		document.form1.fname.focus();
		document.form1.fname.select();
		return false;
	}
	if(!(document.form1.fname.value ==""))
	{
	if(!(isNaN(document.form1.fname.value)))
		{
		alert("Please Enter a Valid First Name");
		document.form1.fname.focus();
		document.form1.fname.select();
		return false;
		}
	}
if(document.form1.lname.value=="")
	{
		alert("Please Enter Your Last Name. ");
		document.form1.lname.focus();
		document.form1.lname.select();
		return false;
	}
	if(!(document.form1.lname.value ==""))
	{
	if(!(isNaN(document.form1.lname.value)))
		{
		alert("Please Enter a Valid Last Name");
		document.form1.lname.focus();
		document.form1.lname.select();
		return false;
		}
	}
/*	if( document.form1.h_phone.value == '' &&  document.form1.h_phone_1.value == '' && document.form1.h_phone_2.value == '' )
{
alert("Please Enter Your Phone Number");
document.form1.h_phone.select();
return false;
}
if ( Validate1(document.form1.h_phone.value) || document.form1.h_phone.value.length < 3)
		{
	alert("Please Enter Valid Phone Number");
        document.form1.h_phone.select();
		return false;
		}
	
if ( Validate1(document.form1.h_phone_1.value) || document.form1.h_phone_1.value.length < 3)
		{
	alert("Please Enter Valid Phone Number");
        document.form1.h_phone_1.select();
		return false;
		}
		
if ( Validate1(document.form1.h_phone_2.value) || document.form1.h_phone_2.value.length < 4)
		{
	alert("Please Enter Valid Phone Number");
        document.form1.h_phone_2.select();
		return false;
		}*/
		if(document.form1.zip_code.value == "" )
{
	alert(" Please include your Zip Code. ");
    document.form1.zip_code.select();
	document.form1.zip_code.focus();
	return false;
	}
	if(isNaN(document.form1.zip_code.value))
	{
		alert(" Please enter a valid Zip Code.");
		document.form1.zip_code.select();
		document.form1.zip_code.focus();
		return false;
	}
var pattern2 = /^\d{5}$/ ;
if(!pattern2.test(document.form1.zip_code.value))
{
if(!pattern2.test(document.form1.zip_code.value) ==true)
{
alert(' Please enter a valid Zip Code.');
document.form1.zip_code.select();
document.form1.zip_code.focus();
return false;
}
}
if(!(document.form1.zip_code.value== ""))
	{
	if(document.form1.zip_code.value == "00000")
	{	{
	alert("Please Enter Valid Zip");
	document.form1.zip_code.select();
	document.form1.zip_code.focus();
	return false;
	}
	}
}
		
if(document.form1.state.value=="not")
	{
		alert("Please Select State. ");
		document.form1.state.focus();
		return false;
	}
if(document.form1.credit_rating.value=="not")
	{
		alert("Please Select Estimated Credit Rating. ");
		document.form1.credit_rating.focus();
		return false;
	}
	document.form1.method="POST";
//document.form1.action="http://www.nymortgagedepo.com/test/form.php";
//document.form1.action="http://optionrefi.com/refinance-form.php";
document.form1.submit();
}
function PhoneMove(nLength, sMoveFrom, sMoveTo) {
	if (sMoveTo != '') {
		if (document.form1[sMoveFrom].value.length >= nLength) {
			document.form1[sMoveTo].focus();
		}

	}
}


function call(str){
	if(str=="ref"){
		document.getElementById("chang").innerHTML="<table width=\"973\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">  <tr><td width=\"433\"><a href='http://www.illinoismortgagedepo.com/illinois-form.php' title='Illinois Mortgage Quotes'><img src=\"images/homerefinance_img.jpg\" width=\"433\" height=\"199\" border='0'/></a></td><td  background=\"images/bg_points.jpg\"  width=\"273\" height=\"199\"><table width=\"270\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">  <tr><td width=\"16\"><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td width=\"242\" class=\"points_main\">Get Cash Out Fast! </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td class=\"points_main\">Lower Your Monthly Payments </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td><p><span class=\"points_main\">Lower Your Rate</span><br /></p>  </td>  </tr>  <tr><td>&nbsp;</td><td class=\"points_main\">&nbsp;</td>  </tr>  <tr><td>&nbsp;</td><td>&nbsp;</td>  </tr></table></td><td width=\"267\" ><img src=\"images/refinance_imgh.jpg\" width=\"265\" height=\"199\" /></td>  </tr></table>";
}
if(str=="home"){
		document.getElementById("chang").innerHTML="<table width=\"973\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">  <tr><td width=\"433\"><a href='http://www.illinoismortgagedepo.com/illinois-form.php' title='Illinois Mortgage Quotes'><img src=\"images/purchase.jpg\" width=\"433\" height=\"199\" border='0' /></a></td><td  background=\"images/bg_points.jpg\"  width=\"273\" height=\"199\"><table width=\"270\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">  <tr><td width=\"16\"><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td width=\"242\" class=\"points_main\">100% Financing Available</td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td class=\"points_main\">Expedited Closings! </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td><p><span class=\"points_main\">Easy Qualify Programs  </span><br /></p>  </td>  </tr>  <tr><td>&nbsp;</td><td class=\"points_main\">&nbsp;</td>  </tr>  <tr><td>&nbsp;</td><td>&nbsp;</td>  </tr></table></td><td width=\"267\" ><img src=\"images/main_purchase.jpg\" width=\"265\" height=\"199\" /></td>  </tr></table>";
}
if(str=="fha"){
		document.getElementById("chang").innerHTML="<table width=\"973\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">  <tr><td width=\"433\"><a href='http://www.illinoismortgagedepo.com/illinois-form.php' title='Illinois Mortgage Quotes'><img src=\"images/fha_img.jpg\" width=\"433\" height=\"199\" border='0' /></a></td><td  background=\"images/bg_points.jpg\"  width=\"273\" height=\"199\"><table width=\"270\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">  <tr><td width=\"16\"><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td width=\"242\" class=\"points_main\">Qualify For A Larger Loan </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td class=\"points_main\">Flexible Down Payment</td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td><p><span class=\"points_main\">Flexible Closing Costs</span><br /></p>  </td>  </tr>  <tr><td>&nbsp;</td><td class=\"points_main\">&nbsp;</td>  </tr>  <tr><td>&nbsp;</td><td>&nbsp;</td>  </tr></table></td><td width=\"267\" ><img src=\"images/fhamortgage_img.jpg\" width=\"265\" height=\"199\" /></td>  </tr></table>";
}
if(str=="debt"){
		document.getElementById("chang").innerHTML="<table width=\"973\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">  <tr><td width=\"433\"><a href='http://www.illinoismortgagedepo.com/illinois-form.php' title='Illinois Mortgage Quotes'><img src=\"images/reverse_img.jpg\" width=\"433\" height=\"199\" border='0' /></a></td><td  background=\"images/bg_points.jpg\"  width=\"273\" height=\"199\"><table width=\"270\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">  <tr><td width=\"16\"><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td width=\"242\" class=\"points_main\">No Taxes On Proceeds </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td class=\"points_main\">No Monthly Payments</td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td><p><span class=\"points_main\">No Transfer Of Title </span><br /></p>  </td>  </tr>  <tr><td>&nbsp;</td><td class=\"points_main\">&nbsp;</td>  </tr>  <tr><td>&nbsp;</td><td>&nbsp;</td>  </tr></table></td><td width=\"267\" ><img src=\"images/reversemain_img.jpg\" width=\"265\" height=\"199\" /></td>  </tr></table>";
}
if((str=="cal")||(str=="metro")){
	document.getElementById("chang").innerHTML="<table width=\"973\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">  <tr><td width=\"433\"><a href='http://www.illinoismortgagedepo.com/illinois-form.php' title='Illinois Mortgage Quotes'><img src=\"images/home_img.jpg\" width=\"433\" height=\"199\" border='0' /></a></td><td  background=\"images/bg_points.jpg\"  width=\"273\" height=\"199\"><table width=\"270\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\">  <tr><td width=\"16\"><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td width=\"242\" class=\"points_main\">Get started with low rates.</td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td class=\"points_main\">No Hidden cost. </td>  </tr>  <tr><td><img src=\"images/arrow_img1.jpg\" width=\"13\" height=\"11\" /></td><td><p><span class=\"points_main\">Fast and Easy approvals.</span><br /></p>  </td>  </tr>  <tr><td>&nbsp;</td><td class=\"points_main\">&nbsp;</td>  </tr>  <tr><td>&nbsp;</td><td>&nbsp;</td>  </tr></table></td><td width=\"267\" ><img src=\"images/main_img.jpg\" width=\"265\" height=\"199\" /></td>  </tr></table>";
}
}