function openGlossary(pLinkName) {
	var wAPP;
	wAPP = window.open("../resources/glossary.htm#" + pLinkName, "APP", "menubar=no,status,scrollbars,resizable=no,width=580,height=300,left=0,top=0");
}

function GetEstimateButton_onclick(){
// modified by Sherry Chen on 8/21/02 to control a user entry which must be a number, 
// but allow a $ or . or , entry.
// the function SubmitCheck() no longer used. Add a new function validateNum() 
// and call the function on this click event.
    var result = validateNum();
    // below will only submit form if SubmitCheck returned True    
    if (result){
       document.GeneralQuestForm.submit();
		}
 }
 
 
function validateNum() {
var ele=document.GeneralQuestForm;
var aFlag=true;
for (i=0;i<7;i++){
	if (i!=3 && i!=0 && i!=1){
		if (i==2) fieldName = "Gross Income";
		else if (i==4) fieldName = "Minimum Credit Card Payment";
		else if (i==5) fieldName = "Car Payment";
		else if (i==6) fieldName = "Other Monthly Obligations";
		if (ele.elements[i].value!=""){
		     var msg="";		     
			  var temp = ele.elements[i].value;
			  var out = "."; com = ",";
			  var dol = "$";
			  var add = "";			  
			  while (temp.indexOf(out)>-1) {
					pos= temp.indexOf(out);
					temp = "" + (temp.substring(0, pos) + add +	temp.substring((pos + out.length), temp.length));	
					}
			  while (temp.indexOf(com)>-1) {
					pos= temp.indexOf(com);
					temp = "" + (temp.substring(0, pos) + add +	temp.substring((pos + com.length), temp.length));	
					}					
			  while (temp.indexOf(dol)>-1) {
					pos= temp.indexOf(dol);
					temp = "" + (temp.substring(0, pos) + add +	temp.substring((pos + dol.length), temp.length));	
					}			  
			if (isNaN(temp)!=false) {			    
				alert ("Please enter numbers only for the field: \n" + fieldName + "."); 
				ele.elements[i].focus();
				aFlag=false;
				return false;
					}
				}
		else {
			alert ("Please enter a value for the field: \n" + fieldName + ".");
			ele.elements[i].focus();
			aFlag=false;
			return false;			
				}
		}
	}	
return aFlag;
}

function sdffaGetEstimateButton_onclick(){
// modified by Sherry Chen on 8/21/02 to control a user entry must be a number, 
// but allow a $ or . entry.
// the function SubmitCheck() no longer used. Add a new function validateNum() 
// and call the function on this click funciton.
    var result = SubmitCheck();
    // below will only submit form if SubmitCheck returned True    
    if (result){
       document.GeneralQuestForm.submit();
		}
 }

function Veteran_onclick() {
// below will change 'Disabled Veteran' to 'No' if changing 'Veteran' to 'No'
    if (document.GeneralQuestForm.rdoDisabledVet[0].checked){
       document.GeneralQuestForm.rdoDisabledVet[1].checked = true;
    }   
 }

function DisabledVet_onclick() {
// below will put up an alert if choose DisabledVet and not chosen Veteran
    if (! document.GeneralQuestForm.rdoVeteran[0].checked){
       document.GeneralQuestForm.rdoDisabledVet[1].checked = true;
       alert("Can't select 'Yes' for 'Disabled Veteran' status, without first selecting 'Yes' for 'Veteran' status");
    }   
 }

function SubmitCheck(){
    if (document.GeneralQuestForm.txtGrossIncomeTot.value == "") {
        alert("Please Enter Value for Gross Income");
        document.GeneralQuestForm.txtGrossIncomeTot.focus();
        return false;
    }  
    else if (document.GeneralQuestForm.txtCreditCardDebt.value == "") {
        alert("Please Enter Value for Minimum Credit Card Payment");
        document.GeneralQuestForm.txtCreditCardDebt.focus();
        return false;
    }  
    else if (document.GeneralQuestForm.txtCarPaymentDebt.value == "") {
        alert("Please Enter Value for Car Payment");
        document.GeneralQuestForm.txtCarPaymentDebt.focus();
        return false;
    }  
    else if (document.GeneralQuestForm.txtOtherDebt.value == "") {
        alert("Please Enter Value for Other Monthly Obligations");
        document.GeneralQuestForm.txtOtherDebt.focus();
        return false;
    }  
    return true;   
    
 } 