// *****************************************************************
// *****************************************************************
// *****************************************************************
function highlight(field) {
field.focus();
  field.value="";
}

// *****************************************************************
// *****************************************************************
// *****************************************************************
function help(div)
{
	var target = document.getElementById(div);
	
	$(target).slideToggle("slow");
}

// *****************************************************************
// *****************************************************************
// *****************************************************************
function popitup(url) {
	newwindow=window.open(url,'name','height=650,width=650');
	if (window.focus) {newwindow.focus()}
	return false;
}

// *****************************************************************
// *****************************************************************
// *****************************************************************
function Changeaction(){
	var Loanvalue = document.getElementById('typeLoan').value;

	switch(Loanvalue)
	{
	case 'conventional':
	  var actionURL = '/index.cfm?fuseaction=forms.purchase';
	  break;    
	case 'refinance':
	  var actionURL = '/index.cfm?fuseaction=forms.relowerrate';
	  break;
	case 'homeimprovement':
	  var actionURL = '/index.cfm?fuseaction=forms.rehomeimprove';
	  break; 
	case 'debtconsolidation':
	  var actionURL = '/index.cfm?fuseaction=forms.reconsolidate';
	  break;    
	case 'fhapurchase':
	  var actionURL = '/index.cfm?fuseaction=forms.fhapurchase';
	  break;
	case 'fharefinance':
	  var actionURL = '/index.cfm?fuseaction=forms.fhare';
	  break;    
	default:
	  var actionURL = '/index.cfm?fuseaction=forms.purchase';
	}

  document.getElementById('quickForm').action = actionURL;  
  document.getElementById('quickForm').submit();
}		

// *****************************************************************
// *****************************************************************
// *****************************************************************
function grossIncomeCheck(formName) {

	js_missinginfo = "";
	
	if (eval('document.' + formName + '.grossincome.value') > 10000) {
		js_missinginfo += "\n     -  Please make sure this is your MONTHLY INCOME! ";
	}
	
	
	if (js_missinginfo != "") {
		js_missinginfo =
		"______________________________________________________________\n" +
		"\tIMPORTANT:\n" +
		js_missinginfo + "\n______________________________________________________________" ;
		alert(js_missinginfo);
	}
}
