/*
function fillpropertyAddress(){
	if(document.frmLoan.PropAddYN[0].checked){
		document.frmLoan.AppAddress.value = document.frmLoan.PropAddress.value;
		document.frmLoan.AppCity.value = document.frmLoan.PropCity.value;
		document.frmLoan.AppState.value = document.frmLoan.PropState.value;
		document.frmLoan.AppZip.value = document.frmLoan.PropZip.value;
		document.frmLoan.AppState.options[frmLoan.AppState.selectedIndex].value = document.frmLoan.PropState.options[frmLoan.PropState.selectedIndex].value;
	}
	if(document.frmLoan.PropAddYN[1].checked){
		document.frmLoan.AppAddress.value = "";
		document.frmLoan.AppCity.value = "";
		document.frmLoan.AppState.value = "";
		document.frmLoan.AppZip.value = "";
	}
}

function fillMortgageAddress(){
	if(document.frmLoan.CoAppAddYN[0].checked){
		document.frmLoan.CoAppAddress.value = document.frmLoan.AppAddress.value;
		document.frmLoan.CoAppCity.value = document.frmLoan.AppCity.value;
		document.frmLoan.CoAppState.value = document.frmLoan.AppState.value;
		document.frmLoan.CoAppZip.value = document.frmLoan.AppZip.value;
		document.frmLoan.CoAppState.options[frmLoan.CoAppState.selectedIndex].value = document.frmLoan.AppState.options[frmLoan.AppState.selectedIndex].value;
	}
	if(document.frmLoan.CoAppAddYN[1].checked){
		document.frmLoan.CoAppAddress.value = "";
		document.frmLoan.CoAppCity.value = "";
		document.frmLoan.CoAppState.value = "";
		document.frmLoan.CoAppZip.value = "";
	}
}

*/
 function fillpropertyAddress()
 {
	if(document.frmLoan.PropAddYN[0].checked){
            document.getElementById('divappAdd').style.display='none';
    }
	if(document.frmLoan.PropAddYN[1].checked){
            document.getElementById('divappAdd').style.display='block';
    }
}

 function fillappSelfEmp()
 {
	if(document.frmLoan.SelfEmpYN[0].checked){
            document.getElementById('divappEmp').style.display='none';
			document.getElementById('divappSelfEmp').style.display='block';			
    }
	if(document.frmLoan.SelfEmpYN[1].checked){
            document.getElementById('divappEmp').style.display='block';
			document.getElementById('divappSelfEmp').style.display='none';
    }
}

 function fillappSelfEmp1()
 {
	if(document.frmLoan.CoAppSelfEmpYN[0].checked){
            document.getElementById('divappEmp1').style.display='none';
			document.getElementById('divappSelfEmp1').style.display='block';			
    }
	if(document.frmLoan.CoAppSelfEmpYN[1].checked){
            document.getElementById('divappEmp1').style.display='block';
			document.getElementById('divappSelfEmp1').style.display='none';
    }
}

 function showIncomeDiv()
 {
	if(document.frmLoan.OtherIncomeYN[0].checked){
            document.getElementById('divapp').style.display='block';
    }
	if(document.frmLoan.OtherIncomeYN[1].checked){
            document.getElementById('divapp').style.display='none';
    }
}

 function showIncomeDiv1()
 {
	if(document.frmLoan.CoAppOtherIncomeYN[0].checked){
            document.getElementById('divCoapp1').style.display='block';
    }
	if(document.frmLoan.CoAppOtherIncomeYN[1].checked){
            document.getElementById('divCoapp1').style.display='none';
    }
}

 function showCoAppDiv()
 {
	if(document.frmLoan.CoAppYN[0].checked){
            document.getElementById('divcoapp').style.display='block';
            document.getElementById('divappEmp1').style.display='block';			
            document.getElementById('divCoappCredit').style.display='block';						
            document.getElementById('divCoappSelf1').style.display='block';			
    }
	if(document.frmLoan.CoAppYN[1].checked){
            document.getElementById('divcoapp').style.display='none';
            document.getElementById('divCoapp1').style.display='none';			
    	    document.getElementById('divappEmp1').style.display='none';			
	        document.getElementById('divCoappCredit').style.display='none';												
            document.getElementById('divCoappSelf1').style.display='none';			
            document.getElementById('divappSelfEmp1').style.display='none';						
            document.getElementById('divcoappAdd').style.display='none';
						
    }
}

 function fillMortgageAddress()
 {
	if(document.frmLoan.CoAppAddYN[0].checked){
            document.getElementById('divcoappAdd').style.display='none';
    }
	if(document.frmLoan.CoAppAddYN[1].checked){
            document.getElementById('divCoappAdd').style.display='block';			
    }
}

 function showSecondMortgageDiv()
 {
	if(document.frmLoan.SecondMorYN[0].checked){
            document.getElementById('divsecondMortgage').style.display='block';
			document.frmLoan.SecondMorYN[0].value = "1";
    }
	if(document.frmLoan.SecondMorYN[1].checked){
            document.getElementById('divsecondMortgage').style.display='none';
			document.frmLoan.SecondMorYN[1].value = "0";
    }
}

function setBlank(frmObj){

	frmObj.value = "";

}

function fillMe(){
	var nextYear = new Date(); // initialise Date object
	var count =1900;
	var incCnt = 0;
	for(count=1900;count<=nextYear.getYear();count++){ 
		var myNewOption = new Option(count,count);
		frmLoan.PropPurchaseYear.options[incCnt] = myNewOption;
		if(count==nextYear.getYear()){
			frmLoan.PropPurchaseYear.options[incCnt].selected = true;
		}
		incCnt++;
	}
}

function popup(varUrl,sWidth,sHeight){
	window.open(varUrl,'newwindow','width='+sWidth+' height='+sHeight+' top=150 left=250');
}

function takeAction(varId, varAction){
	
	if(confirm("Do you want to delete this record permanently from the site?")){
		var chngUrl = window.location.href;
		chngUrl = chngUrl + "?id="+varId+"&action="+varAction;
		window.location.href = chngUrl;
	}
}

function DelRecord(delpage,varId, varAction){
	
	if(confirm("Do you want to delete this record permanently from the site?")){
		//window.location.href = "section_link.php?id="+varId+"&action="+varAction;
		window.open("delete_section.php?delpage="+delpage+"&id="+varId+"&action="+varAction,"","width=200 height=100 left=250 top=150");
	}
}