// JavaScript Document


function HomeFinder()
{
    //window.open("http://valoanaustin.com/HomeFinder.aspx","","width=300,height=300,top=380,left=570,resizable=0");
    window.open("http://localhost/valoansaustin/HomeFinder.aspx","","width=300,height=300,top=380,left=570,resizable=0");
}
function refreshParent() 
{
  window.opener.location.href = "http://valoanaustin.com/va_resources.html";

}

function quickQuote()
{
var homeValue=document.getElementById("PV").value;
var downPayment=document.getElementById("PD").value;
var noOfYears=document.getElementById("LT").value;
var interestRate=document.getElementById("IR").value;
var errMsg='';
if(homeValue=='')
{
errMsg="Enter Property Value \n";
}
if(downPayment=='')
{
errMsg+="Enter Down Payment in % \n"
}
if(noOfYears=='')
{
errMsg+="select No Of Years \n";
}
if(interestRate=='')
{
errMsg+="Enter Interest Rate \n";
}
if(errMsg=='')
{
window.open("http://valoanaustin.com/LoanCal.aspx?PV="+homeValue+"&PD="+downPayment+"&LT="+noOfYears+"&IR="+interestRate,"","width=300,height=140,top=380,left=570,resizable=0");
}
else
{
alert(errMsg);
}


//window.open("http://www.google.com");
}

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 0 //set x offset of bar in pixels
var startY = 0 //set y offset of bar in pixels
var verticalpos="frombottom" //enter "fromtop" or "frombottom"
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}
function staticbar(){
	barheight=document.getElementById("topbar").offsetHeight
	var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
	var d = document;
	function ml(id){
		var el=d.getElementById(id);
		if (!persistclose || persistclose && get_cookie("remainclosed")=="")
		el.style.visibility="visible"
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.right=x+"px";this.style.top=y+"px";};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function(){
					if (verticalpos=="fromtop"){
									var pY = ns ? pageYOffset : iecompattest().scrollTop;
									ftlObj.y += (pY + startY - ftlObj.y)/3;
					}
					else
					{
									var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
									ftlObj.y += Math.ceil(pY - startY - ftlObj.y)/3;
					}
					ftlObj.sP(ftlObj.x, ftlObj.y);
					setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("topbar");
	stayTopLeft();
}
if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar





 function requ_clear()
 {
   document.Requ.PL_Tb.value = "";
   document.Requ.PL_Tb2.value = "";
   document.Requ.PL_Tb3.value = "";
   document.Requ.PL_Sel.value = 0;
   document.Requ.PL_Sel2.value = 0;
 }



 function Gets_clear()
 {
   document.GetS.PL_Sel3.value = 0;
   document.GetS.PL_Sel4.value = 0;
 }



 function New_user()
 {
	window.open("NewUser.aspx");
 }



function validate_requ()
{
  if(document.Requ.PL_Tb.value == "")
  {
	alert("Entry Name");
		return false;
  }

  if(document.Requ.PL_Tb2.value == "")
  {
	alert("Entry Email");
		return false;
  }

  if(document.Requ.PL_Tb3.value == "")
  {
	alert("Entry Phone");
		return false;
  }

  if(document.Requ.PL_Sel.value == 0)
  {
	alert("Select Loan Type");
		return false;
  }

  if(document.Requ.PL_Sel2.value == 0)
  {
	alert("Select Credit Rating");
	return false;
  }

  }  



 function validate_login()
{
  if(document.SignIn.PL_Tb4.value == "")
  {
	alert("Entry User Name");
	return false;
  }

  if(document.SignIn.PL_Tb5.value == "")
  {
	alert("Entry Password");
	return false;
  }

 }



  function validate_GetS()
  {
   if(document.GetS.PL_Sel3.value == 0)
  {
	alert("Select State");
	return false;
  }

  if(document.GetS.PL_Sel4.value == 0)
  {
	alert("Select Credit Rating");
	return false;
  }

  }



  function validate_Subr()
  {
   if(document.Subr.PL_Tb6.value == "")
  {
	alert("Entry Email Id");
	return false;
  }  
  }

function validate_Veteran()
{
  if(document.Veteran.VL_Name.value == "")
  {
	alert("Entry Name");
		return false;
  }  
  if(document.Veteran.VL_Address.value == "")
  {
	alert("Entry Address");
		return false;
  }
  if(document.Veteran.VL_City.value == "")
  {
	alert("Entry City");
		return false;
  }
  if(document.Veteran.VL_State_Sel.value == 0)
  {
	alert("Select State");
		return false;
  }
  if(document.Veteran.VL_Phone_No.value == "")
  {
	alert("Entry Phone Number");
		return false;
  }
  if(document.Veteran.VL_Email_Address.value == "")
  {
	alert("Entry Email Id");
	return false;
  }
  if(document.Veteran.VL_Value_of_Home_Sel.value == 0)
  {
	alert("Select Approximate value of home");
	return false;
  }

  }  

function requ_Veteran_clear()
 {
   document.Veteran.VL_Name.value = "";
   document.Veteran.VL_Address.value = "";
   document.Veteran.VL_City.value = "";
   document.Veteran.VL_State_Sel.value = "select";
   document.Veteran.VL_Phone_No.value = "";
   document.Veteran.VL_Email_Address.value = "";
   document.Veteran.VL_Value_of_Home_Sel.value = "select";
 }