<!-- hide scripts from crusty old browsers

//This function is called on the house_driven_1.tpl template to check the input data

/***********************************************************/
	// Check the inputs
	function checkInputs() {
		//with(document.input) THIS IS NOT WORKING!!!!!!!!!@WHY NOT??
		
		var smo_income = (document.input_variables.monthly_income.value * 1 );
		var sales_price = (document.input_variables.sales_price.value * 1);
		
		//with(this);
		if(document.input_variables.borrower_name.value == "") {
			alert("You must enter a Borrower Name");
			document.input_variables.borrower_name.focus();
			return false;
		} 
		
		else if(document.input_variables.location.value == "") {
			alert("You must enter a Location");
			document.input_variables.location.focus();
			return false;
		} 
		
		else if (smo_income == "") {
			alert("You must enter a value for your Monthly Income");
			document.input_variables.monthly_income.focus();
			return false;
		}

		else if (sales_price == "") {
			alert("You must enter a value for the Sales Price");
			document.input_variables.sales_price.focus();
			return false;
		}
			
		else if (document.input_variables.purchase_refi.value == "") {
				alert("You must select a value for Purchase or Refi");
				document.input_variables.purchase_refi.focus();
				return false;
			}
		
		
		else if (document.input_variables.interest_rate.value == ""){
			alert("You must enter a value for the Interest Rate");
				document.input_variables.interest_rate.focus();
				return false;
			
		}
		
		else if (document.input_variables.loan_amount.value == ""){
			alert("You must enter a value for the Loan Amount");
				document.input_variables.loan_amount.focus();
				return false;
			
		}
		
		else if (document.input_variables.loan_term.value == ""){
			alert("You must enter a value for the Loan Term");
				document.input_variables.loan_term.focus();
				return false;
			
		}
		
		else if (document.input_variables.loan_term.value > 480){
			alert("Your Loan Term cannot be greater than 480 months");
				document.input_variables.loan_term.focus();
				return false;
			
		}
		
		else if ((document.input_variables.sec_refi_loan_amount.value > 0) && (document.input_variables.sec_refi_est_pymnt.value == 0)){
			alert("You did not enter an amount in the Secondary Financing Monthly Payment box");
				document.input_variables.sec_refi_est_pymnt.focus();
				return false;
			
		}
	
	
		return true;
	}

/***********************************************************/
/***********************************************************/
// dreamweaver rolloverscript for templates
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null)
   {document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

		
/***********************************************************/	

/***********************************************************/
 	function comparePasswords() {
		//with (document.change_password);
		
		if (document.change_password.curr_password.value == "") {
		alert ("You must enter your current password.");
			return false;
		}
		
		else if (document.change_password.new_password_1.value != document.change_password.new_password_2.value) {
			alert ("The two password entries not the same, please re-enter your new password in both fields.");
			return false;
		}
		
		else if (document.change_password.new_password_1.value == "gppass@1"){
			alert ("You must update the default password");
			return false;
		}
		
		return true;
		
	
	}
 
 /*************************************************************/
 
 	function reloadMessage() {
	alert ("You will need to re-enter your Purchase County and City information");
	}
 
 
 /***********************************************************/
		//Useful pieces for the pop_up
//<a href="javascript:openWin('link.html', 'name');">here </a>
//<BODY onLoad="setTimeout(window.close, 5000)">
//<a href="javascript:window.close();">Close This Window</a>

var windowIsOpen = "false";

if (screen){
	rightPos = screen.width ;
}
if (document.all) {
  x = window.screenTop + 500;
  //y = window.screenLeft + 250;
}
else if (document.layers) {
  x = window.screenX + 500;
  //y = window.screenY + 250;
}


/***********************************************************/

function openW() {

  popupWin = window.open("gpmop_main.php", "Print Window", "menubar,resizable,scrollbars,width=500,height=450");
  windowIsOpen = "true";
  //window.focus();
}

/***********************************************************/

function openWin(url, name) {

  popupWin = window.open(url, name, "menubar,resizable,scrollbars,width=600,height=550");
  windowIsOpen = "true";
  //window.blur();
}

/***********************************************************/

function opennewWin(url) {

  popupWin = window.open(url,  "menubar,resizable,scrollbars,width=600,height=550");
  windowIsOpen = "true";
  //window.blur();
}


// End script hiding -->
