// JavaScript Document
function estimated(str)
{
	//alert(str);
		if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("val").innerHTML=xmlhttp.responseText;
				}
			  }
			  if (str=="")
			  {ortg
			  document.getElementById("val").innerHTML="";
			  return;
			  } 
			  
			xmlhttp.open("GET","getvalue.php?valu="+str,true);
			xmlhttp.send(null);
			
}
function estimateddebt(str)
{
	//alert(str);
		if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("val7").innerHTML=xmlhttp.responseText;
				}
			  }
			  if (str=="")
			  {
			  document.getElementById("val7").innerHTML="";
			  return;
			  } 
			  
			xmlhttp.open("GET","getvalue.php?debt="+str,true);
			xmlhttp.send(null);
			
}
function baldisp(shr)
{
if (shr=="")
			  {
			  document.getElementById("dsp").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("dsp").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?dsp="+shr,true);
			xmlhttp.send();
			document.getElementById('dsp1').style.display='block';
			document.getElementById('dsp').style.display='block';
}
function mortage(shir)
{
if (shir=="")
			  {
			  document.getElementById("secmor").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("secmor").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?mor="+shir,true);
			xmlhttp.send();
			document.getElementById('secmor').style.display='block';
			document.getElementById('mort').style.display='block';
}
function mortage7(shir)
{
if (shir=="")
			  {
			  document.getElementById("secmord").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("secmord").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?mord="+shir,true);
			xmlhttp.send();
			document.getElementById('secmord').style.display='block';
			document.getElementById('mortd').style.display='block';
}
function addional(psd)
{
if(psd=='25000')
{
			document.getElementById('dsp1').style.display='none';
			document.getElementById('dsp').style.display='none';
}
}
function mortage2()
{
document.getElementById('secmor').style.display='none';
			document.getElementById('mort').style.display='none';
}
function mortage27()
{
document.getElementById('secmord').style.display='none';
			document.getElementById('mortd').style.display='none';
}
function homeestimated(str)
{
			if (str=="")
			  {
			  document.getElementById("hme").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("hme").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?hme="+str,true);
			xmlhttp.send();
}
function baldisphme(shr)
{
if (shr=="")
			  {
			  document.getElementById("dsphme").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("dsphme").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?dsphme="+shr,true);
			xmlhttp.send();
			document.getElementById('dsphme1').style.display='block';
			document.getElementById('dsphme').style.display='block';
}
function mortagehme(shir)
{
	//alert(shir);
if (shir=="")
			  {
			  document.getElementById("secmor").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("secmor").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?morhme="+shir,true);
			//alert("getvalue.php?morhme="+shir);
			xmlhttp.send();
			document.getElementById('secmor').style.display='block';
			document.getElementById('mort').style.display='block';
}
function eqmortagehme(shir)
{
	//alert(shir);
if (shir=="")
			  {
			  document.getElementById("secmoreq").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("secmoreq").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?morhmeeq="+shir,true);
			//alert("getvalue.php?morhme="+shir);
			xmlhttp.send();
			document.getElementById('secmoreq').style.display='block';
			document.getElementById('morteq').style.display='block';
}
function mortagehme2()
{
document.getElementById('secmor').style.display='none';
			document.getElementById('mort').style.display='none';
}
function mortagehme2eq()
{
document.getElementById('secmoreq').style.display='none';
			document.getElementById('morteq').style.display='none';
}
function wanthome(str)
{
if(str=='yes')
{
document.getElementById('found').style.display='block';
document.getElementById('found1').style.display='block';
}
if(str=='no')
{
document.getElementById('found').style.display='none';
document.getElementById('found1').style.display='none';
}
}
function agent(shir)
{
	//alert(shir);
if(shir=='yes')
{
if (shir=="")
			  {
			  document.getElementById("agentdisp").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("agentdisp").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?agent="+shir,true);
			xmlhttp.send();
			document.getElementById('agentdisp').style.display='block';
			document.getElementById('agname').style.display='block';
			document.getElementById('agphone').style.display='block';
			document.getElementById('agcomp').style.display='block';
			}
			else
			{
						document.getElementById('agentdisp').style.display='none';
			document.getElementById('agname').style.display='none';
			document.getElementById('agphone').style.display='none';
			document.getElementById('agcomp').style.display='none';
			}
}
function deptdisp(shr)
{
if (shr=="")
			  {
			  document.getElementById("dspd").innerHTML="";
			  return;
			  }  
			if (window.XMLHttpRequest)
			  {// code for IE7+, Firefox, Chrome, Opera, Safari
			  xmlhttp=new XMLHttpRequest();
			  }
			else
			  {// code for IE6, IE5
			  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			xmlhttp.onreadystatechange=function()
			  {
			  if (xmlhttp.readyState==4 && xmlhttp.status==200)
				{
				document.getElementById("dspd").innerHTML=xmlhttp.responseText;
				}
			  }
			xmlhttp.open("GET","getvalue.php?dspd="+shr,true);
			xmlhttp.send();
			document.getElementById('dsp1d').style.display='block';
			document.getElementById('dspd').style.display='block';
}

function validate()
{

if(document.form1.product.value=="")
{
alert("Please Select Type Of Loan");
document.form1.product.focus();
return false;
}
if(document.form1.prop_st.value=="")
{
alert("Please Select Property Location");
document.form1.prop_st.focus();
return false;
}
if(document.form1.prop_desc.value=="")
{
alert("Please Select Type Of Home");
document.form1.prop_desc.focus();
return false;
}
document.form1.action="apply-online.php";
}
