// JavaScript Document - If chkBox is checked, then call function calculate
function ChkFunc1()
{
 {
 document.getElementById('box2A').value=document.getElementById('build1').value;
 }
}
/* ================================================================================= */
function ChkFunc2()
{
 {
  document.getElementById('box2B').value=document.getElementById('Closing').value;
 }
}
/* ================================================================================= */
function ChkFunc3()
{
 {
  document.getElementById('box2C').value=document.getElementById('sim').value;  
 }
}
/* ================================================================================= */
function ChkFunc4()
{
 {
  document.getElementById('box2D').value=document.getElementById('ref').value;  
 }
}
/* ================================================================================= */
function ChkFunc5()
{
 {
  document.getElementById('box2E').value=document.getElementById('exp').value;  
 }
}
/* ================================================================================= */
function ChkFunc6()
{
 {
  document.getElementById('box2F').value=document.getElementById('wire').value;  
 }
}
/* ================================================================================= */
function ChkFunc7()
{
 {
 document.getElementById('box2G').value=document.getElementById('purge').value;;  
 }
}
/* ================================================================================= */
function ChkFunc8()
{
 {
  document.getElementById('box2H').value=document.getElementById('tax').value;  
 }
}
/* ========================== 10% Calculation ======================================= */
function ChkFunc9()
{
 if (document.FormName.refinance.value > 1)
  {
   document.FormName.form_9.value =  Math.round(r*.10).toFixed(2);
  }
  else if (document.FormName.loan.value < 1369999)
  {
  document.FormName.form_9.value =  Math.round(l*.10).toFixed(2);  
  }
  else if (document.FormName.loan.value > 1370000)
  {
  document.FormName.form_9.value =  300 + ".00";
  }
 else
  {
   alert("ERROR:\nThis figure is calculated using a Loan Amount or\na Refinanced Loan Amount.\nPlease correct to continue.");
  }
}
/* ============================== 10% Calculation =================================== */
function ChkFunc10()
{
 if (document.FormName.refinance.value > 1)
  {
  document.FormName.form_10.value = Math.round(r*.10).toFixed(2);
  }
  else if (document.FormName.loan.value > 1)
  {
  document.FormName.form_10.value =  Math.round(l*.10).toFixed(2);  
  }
  else if (document.FormName.loan.value > 1370000)
  {
  document.FormName.form_9.value =  300 + ".00";
  }
 else
 {
  alert("ERROR:\nThis figure is calculated using a Loan Amount or\na Refinanced Loan Amount.\nPlease correct to continue.");
 }
}
/* ================================ 10% Calculation ================================= */
function ChkFunc11()
{
 if (document.FormName.refinance.value > 1)
  {
  document.FormName.form_11.value = Math.round(r*.10).toFixed(2);
  }
  else if (document.FormName.loan.value > 1)
  {
  document.FormName.form_11.value =  Math.round(l*.10).toFixed(2);  
  }
 else
 {
  alert("ERROR:\nThis figure is calculated using a Loan Amount or\na Refinanced Loan Amount.\nPlease correct to continue.");
 }
}
/* ================================================================================= */
function ChkFunc12()
{
  {
  document.getElementById('box2K').value=document.getElementById('res').value;  
  }
}
/* ================================================================================= */
function ChkFunc13()
{
  {
  document.getElementById('box2M').value=document.getElementById('comp').value;  
  }
}
/* ============================ 10% Calculation =================================== */
function ChkFunc14()
{
 if (document.FormName.refinance.value > 1)
  {
  document.FormName.form_14.value = Math.round(r*.10).toFixed(2);
  }
  else if (document.FormName.loan.value > 1)
  {
  document.FormName.form_14.value =  Math.round(l*.10).toFixed(2);  
  }
 else
 {
 alert("ERROR:\nThis figure is calculated using a Loan Amount or\na Refinanced Loan Amount.\nPlease correct to continue.");
 }
}
/* ================================================================================= */
function ChkFunc15()
{
 {
  document.getElementById('box2O').value = document.getElementById('Own130').value;
 }
}
/* ================================================================================= */
function ChkFunc16()
{
  {
  document.getElementById('box2P').value=document.getElementById('lend').value;  
  }
}
/* ================================================================================= */
function ChkFunc17()
{
  {
  document.getElementById('box2Q').value=document.getElementById('DesImprv').value;  
  }
}
/* ================================================================================= */
function EnDis(){
var disable = true;
var arglen = arguments.length;
var startIndex = 0;
var frm = document.FormName;//change appropriate form name
if (arglen>0){
if (typeof arguments[0]=="boolean") {
disable=arguments[0];
if (arglen>1) startIndex=1;
}
for (var i=startIndex;i<arglen;i++){
obj = eval("frm."+arguments[i]);
if (typeof obj=="object"){
if (document.layers) {
if (disable){
obj.onfocus=new 

Function("this.blur()");
if (obj.type=="text") obj.onchange=new 

Function("this.value=this.defaultValue");
}
else {
obj.onfocus=new 

Function("return");
if (obj.type=="text") obj.onchange=new 

Function("return");
}
}
else obj.disabled=disable;
}
}
}
}





