﻿function stripnumb(numb) {var lespercent;var lesdollar;var lesspace;var lescomma;var lesnumamt = numb.length;if(lesnumamt > 0) {numb=numb.toString();lespercent = numb.indexOf("%");if(lespercent >= 0) {numb=numb.substring(0,lespercent) + "" + numb.substring(lespercent + 1,lesnumamt);lesnumamt=numb.length;}lesdollar = numb.indexOf("$");if(lesdollar >= 0) {numb=numb.substring(0,lesdollar) + "" + numb.substring(lesdollar + 1,lesnumamt);lesnumamt=numb.length;}lesspace = numb.indexOf(" ");if(lesspace >= 0) {numb=numb.substring(0,lesspace) + "" + numb.substring(lesspace + 1,lesnumamt);lesnumamt=numb.length;}lescomma = numb.indexOf(",");if(lescomma >= 0) {while(lescomma >=1) {numb=numb.substring(0,lescomma) + "" + numb.substring(lescomma + 1,lesnumamt);lesnumamt=numb.length;lescomma = numb.indexOf(",");}}numb = eval(numb);} else {numb = 0;}return numb;}function formatnumb(numb) {var negative=0;if(numb < 0) {numb=numb*-1;negative=1;}zeronumb=Math.round(numb*100)/100;integer=Math.floor(zeronumb);if (Math.ceil(zeronumb) == integer) {decimal="00";} else{decimal=Math.round((zeronumb-integer)*100)}decimal=decimal.toString();if (decimal.length<2) decimal="0"+decimal;integer=integer.toString();var tempnumb="";var tempinteger="";var x=0;for (z=integer.length;z>0;z--) {tempnumb=tempnumb+integer.charAt(z-1);x=x+1;if (x==3 & z>1) {tempnumb=tempnumb+",";x=0;}}for (z=tempnumb.length;z>0;z--) {tempinteger=tempinteger+tempnumb.charAt(z-1);}finalnumb=tempinteger+"."+decimal;if(negative == 1) {finalnumb = "-" + finalnumb;}return finalnumb;}function calculateform(form) {if(form.prop_price.value == "" || form.prop_price.value == 0) {alert("Please enter the purchase price of the home.");form.prop_price.focus();} else if(form.loan_per.value == "" || form.loan_per.value == 0) {alert("Please your number of years you are financing the home for.");form.loan_per.focus();} else if(form.m_rate.value == "" || form.m_rate.value == 0) {alert("Please enter the mortgage's annual interest rate.");form.m_rate.focus();} else if(form.livintime.value == "" || form.livintime.value == 0) {alert("Please enter the number of years you plan to stay in this property.");form.m_rate.focus();} else {var monrentvar = stripnumb(form.monrent.value);var totalrentvar = 0;var monrentinsvar = stripnumb(form.monrentins.value);if(monrentinsvar == "" || monrentinsvar == 0) {monrentinsvar = 0}var anninflationvar = stripnumb(form.anninflation.value);if(anninflationvar == "" || anninflationvar == 0) {anninflationvar = 0} else if(anninflationvar >= 1) {anninflationvar = anninflationvar / 100;}anninflationvar = eval(anninflationvar) + eval(1);var livintimevar = stripnumb(form.livintime.value);var livinmonvar = livintimevar * 12;var countit = 0;var int = stripnumb(form.m_rate.value);if (int > 1.0) {int = int / 100.0;}int /= 12;var prop_pricevar = stripnumb(form.prop_price.value);var loan_pervar = stripnumb(form.loan_per.value);var dwn_pymtvar = stripnumb(form.dwn_pymt.value);var loanprincvar = eval(prop_pricevar) - eval(dwn_pymtvar);form.loanprincvar.value = formatnumb(loanprincvar);var orig_loan_ratio=(((loanprincvar)/(prop_pricevar)));form.orig_loan_ratio.value = formatnumb(orig_loan_ratio) * (100) + "%";var intamt = 0;var intamtnew = 0;var accumintvar = 0;var accumintnew = 0;var prinamt = 0;var prinamtnew = 0;var principal = loanprincvar;var htc = stripnumb(form.htc.value);if(htc == 0 || htc == "") {htc = 0;} else if(htc >= 1 ) {htc = htc / 100;}var hta=(htc)*(prop_pricevar);var cur_yrs = stripnumb(form.cur_yrs.value);if (prop_pricevar > 800000){hta = 0;} else if (cur_yrs == 1 || cur_yrs == 2 || cur_yrs == 3 || cur_yrs == 4){hta = 0;} else if (cur_yrs >= 5 && hta > 6500 && prop_pricevar <= 800000){hta = 6500;} else if (cur_yrs == 0 && hta >= 8000 && prop_pricevar <= 800000){hta = 8000;} else if (cur_yrs >= 5 && hta < 6500 && prop_pricevar <= 800000){hta = htc * prop_pricevar;}form.hta.value = formatnumb(hta);if(hta == 0 || hta == ""){hta = 0;}else if(hta >= .01) {principal = principal - hta;}form.principal.value = formatnumb(principal);var principal_dif=(((loanprincvar) - (principal)));form.principal_dif.value = formatnumb(principal_dif);var loan_ratio=(((principal)/(prop_pricevar)));form.loan_ratio.value = formatnumb(loan_ratio) * (100) + "%";var loan_ratio_dif=(((orig_loan_ratio) - (loan_ratio)));form.loan_ratio_dif.value = formatnumb(loan_ratio_dif) + "%";var numbmon = loan_pervar * 12;var pow = 1;for (var k = 0; k < numbmon; k++)pow = pow * (1 + int);var m_pymt = (loanprincvar * pow * int) / (pow - 1);var annual_pymt = (loanprincvar * pow * int) / (pow - 1) * (12);form.annual_pymt.value = formatnumb(annual_pymt);var m_pymt_htc = (principal * pow * int) / (pow - 1);form.m_pymt_htc.value = formatnumb(m_pymt_htc);var m_pymt_dif=(((m_pymt) - (m_pymt_htc)));form.m_pymt_dif.value = formatnumb(m_pymt_dif);var an_pymt_htc = (principal * pow * int) / (pow - 1) * (12);form.an_pymt_htc.value = formatnumb(an_pymt_htc);var m_pymt_tot = annual_pymt * livintimevar;form.m_pymt_tot.value = formatnumb(m_pymt_tot);var an_pymt_htc_tot = an_pymt_htc * livintimevar;form.an_pymt_htc_tot.value = formatnumb(an_pymt_htc_tot);var m_pymt_tot_dif=(((m_pymt_tot) - (an_pymt_htc_tot)));form.m_pymt_tot_dif.value = formatnumb(m_pymt_tot_dif);var an_pymt_tot_dif = (((annual_pymt) - (an_pymt_htc)));form.an_pymt_tot_dif.value = formatnumb(an_pymt_tot_dif);var apprevar = stripnumb(form.appre.value);if(apprevar == "" || apprevar == 0) {apprevar = 0;} else if(apprevar >= 0) {apprevar = apprevar / 100;}apprevar = eval(apprevar) + eval(1);var accumappvar = prop_pricevar * apprevar;var mtginsvar = stripnumb(form.mtgins.value);if(mtginsvar == 0 || mtginsvar == "") {mtginsvar = 0;} else if(mtginsvar >= .01) {mtginsvar = mtginsvar / 100;}mtginsvar = mtginsvar / 12;var mtginskt = 0;var accunmtginsvar = 0;var newaccunmtginsvar = 0;var mon_mtgins = 0;var mon_mtgins_var = 0;var annual_mtgins = 0;var annual_mtgins_var = 0;var dppercentage = dwn_pymtvar / prop_pricevar;if(dppercentage < .20) {mtginskt = 1;accunmtginsvar = 0;newaccunmtginsvar = 0;mon_mtgins = 0;mon_mtgins_var = 0;annual_mtgins = 0;annual_mtgins_var = 0;}var origfeevar = stripnumb(form.origfee.value);if(origfeevar == 0 || origfeevar == "") {origfeevar = 0;} else if(origfeevar >= 1 ) {origfeevar = origfeevar / 100;}var feeamtvar = loanprincvar * origfeevar;var discpointvar = stripnumb(form.discpoint.value);if(discpointvar == 0 || discpointvar == "") {discpointvar = 0;} else if(discpointvar >= 1 ) {discpointvar = discpointvar / 100;}var discpointamtvar = loanprincvar * discpointvar;var othercostvar= stripnumb(form.othercost.value);if(othercostvar == 0 || othercostvar == "") {othercostvar = 0;}var othercost = othercostvar;form.othercost.value = othercost;var closecostvar = eval(discpointamtvar) + eval(feeamtvar) + eval(othercostvar);var invinterestvar = 0;var invprincipalvar = eval(dwn_pymtvar) + eval(closecostvar);form.invprincipalvar.value = formatnumb(invprincipalvar);var invprincipalnew = eval(dwn_pymtvar) + eval(closecostvar)+ eval(hta);form.invprincipalnew.value = formatnumb(invprincipalnew);var invprincipal_dif=(((invprincipalnew) - (invprincipalvar)));form.invprincipal_dif.value = formatnumb(invprincipal_dif);var earnedinterest = stripnumb(form.savintrate.value);if (earnedinterest >= 1.0) {earnedinterest = earnedinterest / 100.0;}earnedinterest /= 12;var inflatinterestvar = 1;while(countit < livinmonvar) {if(countit > 0 && countit % 12 == 0) {accumappvar = accumappvar * apprevar;monrentvar = monrentvar * anninflationvar;inflatinterestvar = inflatinterestvar * anninflationvar;}totalrentvar = eval(totalrentvar) + eval(monrentvar);totalrentvar_an = eval(totalrentvar) * eval(12);totalrentvar = eval(totalrentvar) + eval(monrentinsvar);if(countit < numbmon) {intamt = loanprincvar * int;intamtnew = principal * int;var intamt_dif=(((intamt) - (intamtnew)));accumintvar = eval(accumintvar) + eval(intamt);accumintnew = eval(accumintnew) + eval(intamtnew);var accumint_dif=(((accumintvar) - (accumintnew)));form.accumint_dif.value = formatnumb(accumint_dif);prinamt = eval(m_pymt) - eval(intamt);prinamtnew = eval(m_pymt_htc) - eval(intamtnew);principalold = eval(loanprincvar) - eval(prinamt);principalnew = eval(principal) - eval(prinamtnew);}if(mtginskt == 1) {accunmtginsvar = eval(accunmtginsvar) + eval(mtginsvar * principalold);newaccunmtginsvar = eval(newaccunmtginsvar) + eval(mtginsvar * principalnew);mon_mtgins = eval(newaccunmtginsvar / livinmonvar);mon_mtgins_var = eval(accunmtginsvar / livinmonvar);annual_mtgins = eval(newaccunmtginsvar / livintimevar);annual_mtgins_var = eval(accunmtginsvar / livintimevar);mtgins_dif = eval(accunmtginsvar - newaccunmtginsvar);}form.mon_mtgins.value = formatnumb(mon_mtgins);form.mon_mtgins_var.value = formatnumb(mon_mtgins_var);var mon_mtgins_dif=(((mon_mtgins_var) - (mon_mtgins)));form.mon_mtgins_dif.value = formatnumb(mon_mtgins_dif);invinterestvar = earnedinterest * invprincipalvar;invprincipalvar = eval(invprincipalvar) + eval(invinterestvar);invinterestnew = earnedinterest * invprincipalnew;invprincipalnew = eval(invprincipalnew) + eval(invinterestnew);countit = eval(countit) + eval(1);}var assocduesvar = stripnumb(form.associationdues.value);if(assocduesvar == "" || assocduesvar == 0) {assocduesvar = 0;}annual_assoc_due = assocduesvar * 12;var assocduetot = assocduesvar * 12 * livintimevar * inflatinterestvar;var proptaxvar = stripnumb(form.prop_tax_rt.value);if(proptaxvar == "" || proptaxvar == 0) {proptaxvar = 0;}var monproptaxvar = proptaxvar / 12;form.monproptax.value = formatnumb(monproptaxvar);var totproptaxvar = proptaxvar * livintimevar * inflatinterestvar;form.totproptax.value = formatnumb(totproptaxvar);var maintenvar = form.monmainten.value;if(maintenvar == "" || maintenvar == 0) {maintenvar = 0;}annual_maintcost = maintenvar * 12;var totmaintcostvar = maintenvar * 12 * livintimevar * inflatinterestvar;var op_exp = stripnumb(form.op_exp.value);if(op_exp == "" || op_exp == 0) {op_exp = 0;}var mon_op_exp=((op_exp)/(12));var tot_op_exp=((op_exp)*(livintimevar));var hminsratevar = stripnumb(form.hminsrate.value);if(hminsratevar == "" || hminsratevar == 0) {hminsratevar = 0;} else if(hminsratevar >= .01) {hminsratevar = hminsratevar / 100;}var mon_hmins = hminsratevar * prop_pricevar / 12;var annual_hmins = hminsratevar * prop_pricevar;var hminstotvar = hminsratevar * prop_pricevar * livintimevar * inflatinterestvar;var homenetgainvar = eval(accumappvar) - eval(prop_pricevar);var homenetgainnew = eval(accumappvar) + eval(hta) - eval(prop_pricevar);var homenetgain_dif=(((homenetgainnew) - (homenetgainvar)));form.homenetgain_dif.value = formatnumb(homenetgain_dif);var tottaxdedvar = eval(accumintvar) + eval(totproptaxvar) + eval(feeamtvar);var incomtaxvar = stripnumb(form.incomtax.value);if(incomtaxvar == "" || incomtaxvar == 0) {incomtaxvar = 0;} else if(incomtaxvar >= 1) {incomtaxvar = incomtaxvar / 100;}var tottaxsavvar = incomtaxvar * tottaxdedvar;var tottaxdednew = eval(accumintnew) + eval(totproptaxvar) + eval(feeamtvar);var tottaxsavnew = incomtaxvar * tottaxdednew;var taxsav_dif=(((tottaxsavvar) - (tottaxsavnew)));form.taxsav_dif.value = formatnumb(taxsav_dif);var investedearnvar = eval(invprincipalvar) - eval(dwn_pymtvar) - eval(closecostvar);var investedearnnew = eval(invprincipalnew) - eval(dwn_pymtvar) - eval(closecostvar) - eval(hta);form.investedearnnew.value = formatnumb(investedearnnew);var investedearn_dif=(((investedearnnew) - (investedearnvar)));form.investedearn_dif.value = formatnumb(investedearn_dif);form.renttot.value = totalrentvar;form.m_pymt.value = formatnumb(m_pymt);form.accum_int.value = accumintvar;form.accum_intnew.value = accumintnew;form.close_cost.value = closecostvar;form.totprop_tax.value = totproptaxvar;form.totmain_cost.value = formatnumb(totmaintcostvar);form.tothmins_cost.value = hminstotvar;form.home_netgain.value = homenetgainvar;form.home_netgainnew.value = homenetgainnew;form.mtgins_costnew.value = formatnumb(newaccunmtginsvar);form.mtgins_cost.value = formatnumb(accunmtginsvar);form.invested_earn.value = formatnumb(investedearnvar);form.aasoc_duetot.value = assocduetot;form.tottax_sav.value = tottaxsavvar;form.tottax_savnew.value = tottaxsavnew;var totrent_costvar = totalrentvar;form.totrent_cost.value = formatnumb(totrent_costvar);var totrent_benevar = investedearnvar;form.totrent_bene.value = formatnumb(totrent_benevar);var netrent_costvar = eval(totalrentvar) - eval(investedearnvar);var totbuy_costvar = eval(accumintvar) + eval(closecostvar) + eval(totproptaxvar) + eval(totmaintcostvar) + eval(hminstotvar) + eval(accunmtginsvar) + eval(assocduetot) + eval(tot_op_exp);form.totbuy_cost.value = totbuy_costvar;var totbuy_costnew = eval(accumintnew) + eval(closecostvar) + eval(totproptaxvar) + eval(totmaintcostvar) + eval(hminstotvar) + eval(newaccunmtginsvar) + eval(assocduetot) + eval(tot_op_exp) - eval(hta);form.totbuy_costnew.value = (totbuy_costnew);var totbuy_dif=(((totbuy_costvar) - (totbuy_costnew)));form.totbuy_dif.value = formatnumb(totbuy_dif);var totbuy_benevar = eval(homenetgainvar) + eval(tottaxsavvar);form.totbuy_bene.value = formatnumb(totbuy_benevar);var totbuy_benenew = eval(homenetgainnew) + eval(tottaxsavnew) + eval(mtgins_dif) + eval(m_pymt_tot_dif);form.totbuy_benenew.value = formatnumb(totbuy_benenew);var totbuy_bene_dif=(((totbuy_benenew) - (totbuy_benevar)));form.totbuy_bene_dif.value = formatnumb(totbuy_bene_dif);var netbuy_costvar = eval(totbuy_costvar) - eval(totbuy_benevar);form.netbuy_cost.value = "$" + formatnumb(netbuy_costvar);var netbuy_costvarnew = eval(totbuy_costnew) - eval(totbuy_benenew);form.netbuy_costnew.value = formatnumb(netbuy_costvarnew);var netbuy_dif=(((netbuy_costvar) - (netbuy_costvarnew)));form.netbuy_dif.value = formatnumb(netbuy_dif);form.netrent_cost.value = formatnumb(netrent_costvar);var totacqcost = eval(prop_pricevar)+eval(closecostvar)+eval(dwn_pymtvar)+eval(proptaxvar)+eval(annual_hmins)+eval(annual_mtgins)+eval(annual_assoc_due);form.totacqcost.value = formatnumb(totacqcost);var newacqcost = eval(prop_pricevar)+eval(closecostvar)+eval(dwn_pymtvar)+eval(proptaxvar)+eval(annual_hmins)+eval(annual_mtgins)+eval(annual_assoc_due)-eval(hta);form.newacqcost.value = formatnumb(newacqcost);var acqcost_dif=(((totacqcost) - (newacqcost)));form.acqcost_dif.value = formatnumb(acqcost_dif);var costtovalue = eval(totacqcost)/eval(homenetgainvar);form.costtovalue.value = formatnumb(costtovalue) + "%";var costtovaluenew = eval(newacqcost)/eval(homenetgainnew);form.costtovaluenew.value = formatnumb(costtovaluenew) + "%";var costtovalue_dif=(((costtovalue) - (costtovaluenew)));form.costtovalue_dif.value = formatnumb(costtovalue_dif);var inv_cost=(prop_pricevar)+(closecostvar)+(dwn_pymtvar);form.inv_cost.value = formatnumb(inv_cost);var t_in_cost=(prop_pricevar)+(closecostvar)+(dwn_pymtvar)-(hta);form.t_in_cost.value = formatnumb(t_in_cost);var inv_cost_dif=(((inv_cost) - (t_in_cost)));form.inv_cost_dif.value = formatnumb(inv_cost_dif);var t_sq_ft = stripnumb(form.t_sq_ft.value);var p_sq_ft=(((inv_cost)/(t_sq_ft)));form.p_sq_ft.value = formatnumb(p_sq_ft);var p_sq_ft_new=(((t_in_cost)/(t_sq_ft)));form.p_sq_ft_new.value = formatnumb(p_sq_ft_new);var p_sq_ft_dif=(((p_sq_ft) - (p_sq_ft_new)));form.p_sq_ft_dif.value = formatnumb(p_sq_ft_dif);var totcashreq = eval(closecostvar)+eval(dwn_pymtvar)+eval(proptaxvar)+eval(annual_hmins)+eval(annual_mtgins)+eval(annual_assoc_due);form.totcashreq.value = formatnumb(totcashreq);var per_down=(((dwn_pymtvar)/(prop_pricevar)));form.per_down.value = formatnumb(per_down)* (100) + "%";var totmoncost =  eval(m_pymt) + eval(maintenvar) + eval(mon_op_exp) + eval(assocduesvar) + eval(monproptaxvar) + eval(mon_mtgins_var) + eval(mon_hmins);form.totmoncost.value = formatnumb(totmoncost);var newtotmoncost =  eval(m_pymt_htc) + eval(maintenvar) + eval(mon_op_exp) + eval(assocduesvar) + eval(monproptaxvar) + eval(mon_mtgins) + eval(mon_hmins);form.newtotmoncost.value = formatnumb(newtotmoncost);var totmoncost_dif=(((totmoncost) - (newtotmoncost)));form.totmoncost_dif.value = formatnumb(totmoncost_dif);var totanncost=(((totmoncost) * (12)));form.totanncost.value = formatnumb(totanncost);var newtotanncost=(((newtotmoncost) * (12)));form.newtotanncost.value = formatnumb(newtotanncost);var totanncost_dif=(((totanncost) - (newtotanncost)));form.totanncost_dif.value = formatnumb(totanncost_dif);var diff = 0;var summaryvar = "";if(netrent_costvar > netbuy_costvarnew) {diff = eval(netrent_costvar) - eval(netbuy_costvarnew);summaryvar = "You can save up to $" + formatnumb(diff) + " if you buy instead of rent."} else {diff = eval(netbuy_costvarnew) - eval(netrent_costvar);summaryvar = "You can save up to $" + formatnumb(diff) + " if you rent instead of buy."}form.summary.value = summaryvar;}}function de_tail(form) {calculateform(form);var part1 = ("<head><title>Home Buyer Tax Credit Detail</title><link rel='stylesheet' type='text/css' href='../home_buyer_tax_credit.css'></head>" + "<body bgcolor = '#FFFFFF'>");var part2 = ("<div align=center class='whitebackground' id='kt'><table width=550 border=0 cellspacing=0 cellpadding=0><tr><td><img src=img/box_top_left.gif width=11 height=11 border=0></td><td background=img/top.gif><img src=img/spacer.gif width='1' height='11' border='0' alt=''></td><td><img src=img/box_top_right.gif width='11' height='11' border='0' alt=''></td></tr><tr><td align='right' background=img/left.gif><img src=img/spacer.gif width='11' height='0' border='0' alt=''></td><td align='center'><center><table border=0 cellspacing=0 cellpadding=0>");var row1 = "<tr><td colspan=5><br><center><div class='kt_header'><font face='arial'><big><b>Home Buyer Tax Credit Detail</b></big></font></div><br><font face='arial'><small><small>Calculations are based upon a " + form.anninflation.value + " annual inflation rate over the course of " + form.livintime.value + " years (the time between now and when you estimate you would sell the home). Please allow for slight rounding differences.</small></small></font></center><br></td></tr>";var row2 = "<tr><td colspan=2></td><td> </td><td colspan=2></td></tr>";var row3 = "<tr><td><div align='left' class='kt_header5'><font face='arial'><small><b>Mortgage</b></small></font></div></td><td><div align='right' class='kt_header5'><font face='arial'><small><b>W/O Tax Credit</b></small></font></div></td><td><div align='left' class='kt_header5'>&nbsp;</div></td><td><div align='left' class='kt_header5'><font face='arial'><small><b>With Tax Credit</b></small></font></div></td><td><div align='right' class='kt_header5'><font face='arial'><small><b>Difference</b></small></font></div></td></tr>";var row4 = "<tr><td><font face='arial'><small>Loan Principal</small></font></td><td align=right><font face='arial'><small>$" + (form.loanprincvar.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.principal.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.principal_dif.value) + "</small></font></td></tr>";var row5 = "<tr><td><font face='arial'><small>Loan to Value</small></font></td><td align=right><font face='arial'><small>" + (form.orig_loan_ratio.value) + "</small></font></td><td> </td><td><font face='arial'><small>" + (form.loan_ratio.value) + "</small></font></td><td align=right><font face='arial'><small>" + (form.loan_ratio_dif.value) + "</small></font></td></tr>";var row6 = "<tr><td><font face='arial'><small>Monthly P/I Payment</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.m_pymt.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + formatnumb(form.m_pymt_htc.value) + "</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.m_pymt_dif.value) + "</small></font></td></tr>";var row7 = "<tr><td><font face='arial'><small>Annual P/I Payment</small></font></td><td align=right><font face='arial'><small>$" + (form.annual_pymt.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.an_pymt_htc.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.an_pymt_tot_dif.value) + "</small></font></td></tr>";var row8 = "<tr><td><font face='arial'><small>Total Monthly Payments</small></font></td><td align=right><font face='arial'><small>$" + (form.totmoncost.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.newtotmoncost.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.totmoncost_dif.value) + "</small></font></td></tr>";var row9 = "<tr><td><font face='arial'><small>Total Annual Payments</small></font></td><td align=right><font face='arial'><small>$" + (form.totanncost.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.newtotanncost.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.totanncost_dif.value) + "</small></font></td></tr>";var row10 = "<tr><td><font face='arial'><small>Total Principal/Interest</small></font></td><td align=right><font face='arial'><small>" + (form.m_pymt_tot.value) + "</small></font></td><td> </td><td><font face='arial'><small>" + (form.an_pymt_htc_tot.value) + "</small></font></td><td align=right><font face='arial'><small>" + (form.m_pymt_tot_dif.value) + "</small></font></td></tr>";var spacer1 = "<tr><td height='12' align=right> </td><td> </td><td> </td><td> </td><td align=right></td></tr>";var row11 = "<tr><td><div align='left' class='kt_header5'><font face='arial'><small><b>Investment</b></small></font></div></td><td colspan='2'><div align='center' class='kt_header5'><font face='arial'><small><b>W/O Tax Credit</b></small></font></div></td><td><div align='left' class='kt_header5'><font face='arial'><small><b>With Tax Credit</b></small></font></div></td><td><div align='right' class='kt_header5'><font face='arial'><small><b>Difference</b></small></font></div></td></tr>";var row12 = "<tr><td><font face='arial'><small>Invested Principal</small></font></td><td align=right><font face='arial'><small>$" + (form.invprincipalvar.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.invprincipalnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.invprincipal_dif.value) + "</small></font></td></tr>";var row13 = "<tr><td><font face='arial'><small>Investment Cost</small></font></td><td align=right><font face='arial'><small>$" + (form.inv_cost.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.t_in_cost.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.inv_cost_dif.value) + "</small></font></td></tr>";var row14 = "<tr><td><font face='arial'><small>Acquisition Cost</small></font></td><td align=right><font face='arial'><small>$" + (form.totacqcost.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.newacqcost.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.acqcost_dif.value) + "</small></font></td></tr>";var row15 = "<tr><td align=left><font face='arial'><small>Appreciated Value</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.home_netgain.value) + "</small></font></td><td> </td><td align=left><font face='arial'><small>$" + formatnumb(form.home_netgainnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.homenetgain_dif.value) + "</small></font></td></tr>";var row16 = "<tr><td><font face='arial'><small>Cost to Value</small></font></td><td align=right><font face='arial'><small>" + (form.costtovalue.value) + "</small></font></td><td> </td><td><font face='arial'><small>" + (form.costtovaluenew.value) + "</small></font></td><td align=right><font face='arial'><small>" + (form.costtovalue_dif.value) + "%</small></font></td></tr>";var row17 = "<tr><td><font face='arial'><small>Price Per Sq. Ft.</small></font></td><td align=right><font face='arial'><small>$" + (form.p_sq_ft.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.p_sq_ft_new.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.p_sq_ft_dif.value) + "</small></font></td></tr>";var row18 = "<tr><td><font face='arial'><small>Invested Earnings</small></font></td><td align=right><font face='arial'><small>$" + (form.invested_earn.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + (form.investedearnnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.investedearn_dif.value) + "</small></font></td></tr>";var row19 = "<tr><td><font face='arial'><small>Tax Savings</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.tottax_sav.value) + "</small></font></td><td> </td><td><font face='arial'><small>$" + formatnumb(form.tottax_savnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.taxsav_dif.value) + "</small></font></td></tr>";var row20 = "<tr><td><font face='arial'><small>Total Buy Costs</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.totbuy_cost.value) + "</small></font></td><td> </td><td><font face='arial'><small>" + formatnumb(form.totbuy_costnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.totbuy_dif.value) + "</small></font></td></tr>";var row21 = "<tr><td align=left><font face='arial'><small>Buying Net Cost</small></font></td><td align=right><font face='arial'><small>" + (form.netbuy_cost.value) + "</small></font></td><td> </td><td align=left><font face='arial'><small>" + (form.netbuy_costnew.value) + "</small></font></td><td align=right><font face='arial'><small>$" + (form.netbuy_dif.value) + "</small></font></td></tr>";var row22 = "<tr><td align=left><font face='arial'><small><b>Total Buy Benefits</b></small></font></td><td align=right><font face='arial'><small><b>$" + (form.totbuy_bene.value) + "</b></small></font></td><td> </td><td align=left><font face='arial'><small><b>$" + (form.totbuy_benenew.value) + "</b></small></font></td><td align=right><font face='arial'><small><b>$" + (form.totbuy_bene_dif.value) + "</b></small></font></td></tr>";var spacer2 = "<tr><td height='12' align=right> </td><td> </td><td> </td><td> </td><td align=right></td></tr>";var row23 = "<tr><td colspan=2><div align='center' class='kt_header5'><font face='arial'><big><b>Rent</b></big></font></div></td><td><div align='center' class='kt_header5'><font face='arial'><big><b>vs.</b></big></font></div></td><td colspan=2><div align='center' class='kt_header5'><font face='arial'><big><b>Buy</b></big></font></div></td></tr>";var row24 = "<tr><td><font face='arial'><small># of Years to Rent</small></font></td><td align=right><font face='arial'><small>" + (form.livintime.value) + "</small></font></td><td> </td><td><font face='arial'><small># of Years to Own</small></font></td><td align=right><font face='arial'><small>" + (form.livintime.value) + "</small></font></td></tr>";var row25 = "<tr><td><font face='arial'><small>Invested Annual Return</small></font></td><td align=right><font face='arial'><small>" + (form.savintrate.value) + "</small></font></td><td> </td><td><font face='arial'><small>Purchase Price</small></font></td><td align=right><font face='arial'><small>$" + (form.prop_price.value) + "</small></font></td></tr>";var row26 = "<tr><td><font face='arial'><small>Monthly Rent Payment</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.monrent.value) + "</small></font></td><td> </td><td><font face='arial'><small>Amortization Period</small></font></td><td align=right><font face='arial'><small>" + (form.loan_per.value) + " Years</small></font></td></tr>";var row27 = "<tr><td><font face='arial'><small>Total Rent/Insurance</small></font></td><td align=right><font face='arial'><small>$" + formatnumb(form.renttot.value) + "</small></font></td><td> </td><td><font face='arial'><small>Interest Rate</small></font></td><td align=right><font face='arial'><small>" + (form.m_rate.value) + "</small></font></td></tr>";var row28 = "<tr><td><font face='arial'><small>Total Rent Benefits</small></font></td><td align=right><font face='arial'><small>$" + (form.invested_earn.value) + "</small></font></td><td> </td><td><font face='arial'><small>Down Payment</small></font></td><td align=right><font face='arial'><small>$" + (form.dwn_pymt.value) + "</small></font></td></tr>";var row29 = "<tr><td><font face='arial'><small>Net Cost of Renting</small></font></td><td align=right><font face='arial'><small>" + (form.netrent_cost.value) + "</small></font></td><td> </td><td><font face='arial'><small>Homebuyer Tax Credit</small></font></td><td align=right><font face='arial'><small>$" + (form.hta.value) + "</small></font></td></tr><tr><td height='12' colspan=5></td></tr>";var summary = "<tr><td colspan=5><div align='center' class='kt_header5'><font face='arial'><small><b>Summary:</b> " + form.summary.value + "</small></font></div></td></tr>";var part4 = ("</table><br><center><form method='post'><input type=\'button\' value=\'close\' onclick=\'window.close()\'></form></center></td><td background=img/right.gif><img src=img/spacer.gif width=1 height=1 border=0 alt=''></td></tr><tr><td><img src=img/box_bottom_left.gif width=11 height=11 border=0 alt=''></td><td background=img/bottom.gif><img src=img/spacer.gif width=1 height=11 border=0 alt=''></td><td><img src=img/box_bottom_right.gif width=11 height=11 border=0 alt=''></td></tr></table></div></body></html>");var schedule = (part1 + "" + part2 + "" + row1 + "" + row2 + "" + row3 + "" + row4 + "" + row5 + "" + row6 + "" + row7 + "" + row8 + "" + row9 + "" + row10 + "" + spacer1 + "" + row11 + "" + row12 + "" + row13 + "" + row14 + "" + row15 + "" + row16 + "" + row17 + "" + row18 + "" + row19 + "" + row20 + "" + row21 + "" + row22 + "" + spacer2 + "" + row23 + "" + row24 + "" + row25 + "" + row26 + "" + row27 + "" + row28 + "" + row29 + "" + summary + "" + part4 + "");reportWin = window.open("","","width=600,height=700,toolbar=no,menubar=yes,scrollbars=yes");reportWin.document.write(schedule);reportWin.document.close();}function reCalculateKt(changedObj) {ktArray = new Array();refreshVariables();displayValues();}function displayValues() {for (var fieldId in ktArray["summary"]) {var fieldObj = document.getElementById(fieldId);}}var helpTexts = new Array();helpTexts["h_t_c"] = "The home buyer tax credit is equal to 10 percent of the home’s purchase price up to a maximum of $8,000 for first time buyers and $6,500 for repeat home buyers. Qualified first time buyers and move-up or repeat home buyers purchasing any kind of home are eligible to claim this credit. Any home that will be used as a principal residence will qualify for the credit, provided the home is purchased for $800,000 or less. This includes single-family detached homes, attached homes like townhouses and condominiums, mobile homes and houseboats. Homes are not eligible purchased from among other family members, parents, grandparents, children, grandchildren, or your spouse or your spouse’s family members. Income limits of $125,000 for individuals and $225,000 for married couples filing jointly apply to all sales occurring after Nov. 6, 2009. The income limits for sales occurring on or after January 1, 2009 and on or before November 6, 2009 are $75,000 for individual taxpayers and $150,000 for married couples filing jointly.";helpTexts["cur_own_yrs"] = "Repeat home buyers must have owned and resided in a home for at least five consecutive years of the eight years prior to the purchase date.";helpTexts["liv_in"] = "Enter the number of years you expect to own or rent the property you are considering. Typically, if you plan to move out of a home in less than 5 years from the date of purchase, you may be better off renting.";helpTexts["pur_price"] = "Total negotiated purchase price of the property to buy. If you are financing the loan costs on the property, then add the total cost of the loan to the price you pay for the property. Repeat home buyers do not have to purchase a home that is more expensive than their previous home to qualify for the tax credit. Purchases of homes priced above $800,000 are not eligible for the tax credit.";helpTexts["mtg_rate"] = "The annual mortgage interest rate used to finance the home.";helpTexts["mtg_mon"] = "This is the number of years you are financing the home for.";helpTexts["dp_amt"] = "FHA lenders can purchase a home buyer’s anticipated tax credit to pay closing costs and downpayment costs above the 3.5% downpayment that is required for FHA-insured homes. Anticipate having to put 3.5-20% cash into the transaction, regardless of the loan to value. Most lenders require you to have money in the deal.";helpTexts["orig_fee"] = "The percentage (often as high as 1% of the loan amount) that a lending institution charges for processing and originating a loan.";helpTexts["disc_point"] = "Discount points are paid up front in order to reduce the interest rate of your mortgage. Each point represents 1% of your mortgage balance.";helpTexts["other_cost"] = "The total of other loan related costs, such as title company and/or attorney closing fees, document review, recording, filing, stamp fees, credit report, appraiser fees, etc.";helpTexts["mtg_ins"] = "If your downpayment is less than 20% of the value of the home you are buying, you may be required to pay mortgage insurance of somewhere between 0.2% and 0.5% of your principal balance each month.";helpTexts["owner_ins"] = "Your homeowner's insurance rate -- entered as a percentage of your home's value. Typical rate is 0.5%.";helpTexts["assoc_due"] = "If there is a homeowner or condo association, enter the monthly dues in this field.";helpTexts["maint"] = "Enter the amount you expect to spend on repairing and maintaining the house each month.";helpTexts["op_expenses"] = "Annual operating expenses are costs incurred during the operation and maintenance of a property. They include repairs and maintenance, insurance, management fees, utilities, supplies, property taxes, etc. The following are not operating expenses: principal and interest, capital expenditures, depreciation, income taxes, and amortization of loan points. <em>*Do not include interest payments or property taxes. Your property taxes will be added to your annual expense automatically.";helpTexts["prop_tx_rate"] = "Enter the amount of property taxes required each year. Property Taxes are determined by the location of the property. To find out what your property taxes are, check with your local municipal or county Tax Assessor.";helpTexts["appre_ciation"] = "Appreciation is the increase in value of a property over time. Factors that influence the rate at which real estate appreciates include inflation, capital improvements, supply and demand. There are many factors that will cause real estate to appreciate or depreciate in value. When weighing the benefits of purchasing a home or renting, many people choose to buy in order to increase their net worth with property appreciation.";helpTexts["annual_inf"] = "Enter the annual inflation rate. This is used to inflate the costs of lease, insurance, maintenance, association dues and property taxes. Most times, this will be between 1-5%.";helpTexts["tot_sq_ft"] = "The Property's Total Square Feet is the property's living space and not garages, patios, sheds, etc.";helpTexts["earn_int"] = "Enter the annual interest rate you would expect to earn on the down payment, closing costs and or Home Buyer Tax Credit you will invest if you decide to rent instead of buy.";helpTexts["loan_ratio"] = "The Loan to Value or LTV is calculated by dividing the loan balance of a property by the market value. The LTV is the Loan Principle divided by the Purchase Price. Lenders may require mortgage insurance on loans with a loan to value greater than 80%. This means that the purchaser of a property will need to put a minimum of 20% down to avoid paying mortgage insurance premiums.";helpTexts["tot_mon_cost"] = "Total monthly cost of the principal and interest payment, maintenance, mortgage insurance, homeowners insurance, annual expenses, property taxes, and association fee.";helpTexts["incomtaxrate"] = "Enter your combined state and federal income tax percentage rate. A tax credit of up to $8,000 is available for first time home buyers purchasing on or after January 1, 2009 and on or before April 30, 2010. In cases where a binding sales contract is signed by April 30, 2010, a home purchase completed by June 30, 2010 will qualify. A tax credit of up to $6,500 is available for repeat home buyers who have owned a home for five consecutive years out of the prior eight years. The repeat home buyer tax credit applies to houses sold after November 6, 2009 and on or before April 30, 2010. In cases where a binding sales contract is signed by April 30, 2010, a home purchase completed by June 30, 2010 will qualify. Home purchases in 2010 may be claimed on an amended 2009 income tax return. Taxpayers must submit a copy of the HUD-1 settlement statement and IRS Form 5405 to claim either the first time home buyer tax credit or the repeat home buyer tax credit.";helpTexts["mo_rent"] = "Enter the amount of monthly rent payment comparables.";helpTexts["mo_rent_ins"] = "Enter the monthly rental insurance premium.";helpTexts["h_t_a"] = "The home buyer tax amount is equal to 10 percent of the home’s purchase price up to a maximum of $8,000 for first time buyers and $6,500 for repeat home buyers. Any home that will be used as a principal residence will qualify for the credit, provided the home is purchased for a price less than or equal to $800,000. This includes single-family detached homes, attached homes like townhouses and condominiums, mobile homes and houseboats. Homes are not eligible purchased from family members.";helpTexts["tot_acqcost"] = "Aquisition cost includes the purchase price, down payment, loan fees, closing costs, loan points, and escrow for mortgage insurance, homeowner insurance, property tax and association fee. With some mortgage types you will be able to finance some of the aquisition costs.";helpTexts["new_acqcost"] = "New aquisition cost includes the purchase price, down payment, loan fees, closing costs, loan points, and escrow for mortgage insurance, homeowner insurance, property tax and association fee minus the home buyer tax credit. With some mortgage types you will be able to finance some of the aquisition costs.";helpTexts["orig_inv_cost"] = "The investment cost is equal to purchase price plus closing costs plus down payment.";helpTexts["tot_in_cost"] = "The new investment cost is equal to purchase price plus closing costs plus down payment minus home buyer tax credit.";helpTexts["mortprin"] = "The loan principle is the purchase price minus the down payment. As you make payments overtime, you will pay down the loan principal. Equity is built-up by paying down loan principal.";helpTexts["newprincipal"] = "The loan principle is the purchase price minus the down payment and home buyer tax credit. As you make payments overtime, you will pay down the loan principal. Equity is built-up by paying down loan principal.";helpTexts["annual_mort"] = "The annual payments are equal to the monthly principal and interest payments times twelve.";helpTexts["anpymthtc"] = "The new annual payments are equal to the monthly principal and interest payments with the home buyer tax credit applied times twelve.";helpTexts["m_py_mt"] = "The monthly payment is the amount of your principal and interest payment each month.";helpTexts["m_pymt_h_t_c"] = "The new monthly payment is the amount of your principal and interest payment with the home buyer tax credit applied each month.";helpTexts["tot_mon_cost"] = "The total monthly cost is the amount of your principal and interest payment plus maintenance, expenses, mortgage insurance, homeowner insurance, property tax and association fee each month.";helpTexts["new_tot_mon_cost"] = "The new total monthly cost is the amount of your principal and interest payment with the home buyer tax credit applied plus maintenance, expenses, mortgage insurance, homeowner insurance, property tax and association fee each month.";helpTexts["orig_ln_ratio"] = "The loan to value or LTV is calculated by dividing the loan balance of a property by the purchase price. Lenders may require mortgage insurance on loans with a loan to value greater than 80%. This means that the purchaser of a property will need to put a minimum of 20% down to avoid paying mortgage insurance premiums.";helpTexts["loan_ratio"] = "The new loan to value or LTV is calculated by dividing the loan balance of a property by the purchase price minus the home buyer tax credit. Lenders may require mortgage insurance on loans with a loan to value greater than 80%. This means that the purchaser of a property will need to put a minimum of 20% down to avoid paying mortgage insurance premiums.";helpTexts["pr_sq_ft"] = "The price per square foot of the property. This amount is determined by dividing the investment cost by the total square feet.";helpTexts["p_sq_ftnew"] = "The new price per square foot of the property is determined by dividing the investment cost minus the home buyer tax credit by the total square feet.";helpTexts["cost_t_value"] = "Cost to value equals acquisition cost divided by appreciated value.";helpTexts["cost_tovalue_new"] = "The new cost to value equals acquisition cost minus home buyer tax credit divided by appreciated value";helpTexts["dn_pmt"] = "Down Payment Percent is equal to the purchase price minus the down payment divided by 100.";helpTexts["tot_cash_req"] = "The total cash required is equal to the closing cost, down payment, annual property taxes, annual homeowners insurance, annual mortgage insurance and annual association fees.";helpTexts["netRentCost"] = "The cost of renting is the total rent and rental insurance plus inflation minus what you would have made on investing the down payment and closing cost funds over the number of years specified.";helpTexts["netBuyCost"] = "The cost of buying is total principal, interest, closing cost, property taxes, homeowners insurance, mortgage insurance, association fees, maintenance fees and expenses minus the home buyer tax credit, appreciation and propety tax benefits over the number of years specified.";var ktArray = new Array();function kt_init() {var kt = document.getElementById("kt");if (kt) {var inputs=kt.getElementsByTagName("input"), selects=kt.getElementsByTagName("select"), el, int=0;while (el = inputs[int++]) {el.onchange = function () {reCalculateKt(this);}}int = 0;while (el = selects[int++]) {el.onchange = function () {reCalculateKt(this);}}}refreshVariables();reCalculateKt();applyHelpPopups();}function refreshVariables() {var kt = document.getElementById("kt");if (kt) {var inputs=kt.getElementsByTagName("input"), selects=kt.getElementsByTagName("select"), el, int=0;ktArray["vars"] = new Array();while (el = inputs[int++]) {if (el.id) {ktArray["vars"][el.id] = $(el.id, el.getAttribute("valuetype"));if (el.getAttribute("valuetype")!="raw") {el.value = numberFormat(ktArray["vars"][el.id], el.getAttribute("valuetype"), el.getAttribute("valueformat"));}}}int = 0;while (el = selects[int++]) {if (el.id) ktArray["vars"][el.id] = $(el.id, el.getAttribute("valuetype"));}}}function numberFormat(value, valuetype, valueformat) {if (value || value==0) {var formatparts = new Array();if (valueformat) formatparts = valueformat.split(".");var decimals = formatparts[1] ? formatparts[1] : 2;switch(valuetype) {case "money":if (value===0) {value = "";for (iii=0; iii<decimals; iii++) {if (!value) value += ".";value += "0";}value = "$0"+value;} else {value = value.toFixed(decimals);value = addCommas(value);value = "$"+value;}break;case "percent":value = value.toFixed(decimals)+"%";break;case "number":if (value===0) {value = "";for (iii=0; iii<decimals; iii++) {if (!value) value += ".";value += "0";}value = "0"+value;} else {value = value.toFixed(decimals);value = value;}break;}} else {value = "";}return value;}function $(id, type) {if (!type) type = "number";var returnVar = document.getElementById(id).value;if (type!="raw") {returnVar = returnVar.replace("$", "");returnVar = returnVar.replace("%", "");returnVar = returnVar.replace(/,/g, "");}if (type!="date" && type!="raw") returnVar = parseFloat(returnVar);return returnVar;}function addCommas(nStr){nStr += '';z = nStr.split('.');x1 = z[0];x2 = z.length > 1 ? '.' + z[1] : '';var rgx = /(\d+)(\d{3})/;while (rgx.test(x1)) {x1 = x1.replace(rgx, '$1' + ',' + '$2');}return x1 + x2;}function applyHelpPopups() {if (!helpTexts) return 0;for (var fieldId in helpTexts) {var fieldObj = document.getElementById(fieldId);fieldObj.onmouseover = function () {hideHelp();};if (!fieldObj) continue;if (fieldId.indexOf("help_")==0) {var prevSibling = fieldObj;} else {if (fieldObj.tagName=="INPUT" || fieldObj.tagName=="SELECT") {var fieldParent = fieldObj.parentNode;} else {var fieldParent = fieldObj;}if (!fieldParent) continue;var prevSibling = fieldParent.previousSibling;if (!prevSibling) continue;if (prevSibling.tagName!="DIV") prevSibling = prevSibling.previousSibling;if (!prevSibling) continue;}prevSibling.style.position = "relative";if (fieldId.indexOf("help_")==0) {var reddot = document.createElement("img");reddot.src="../media/question_icon.gif";reddot.className = "kt_reddot_img";} else {var reddot = document.createElement("div");reddot.className = "kt_reddot";}prevSibling.appendChild(reddot);prevSibling.setAttribute("help_id", fieldId);prevSibling.onclick = function () {showHelp(this, this.getAttribute("help_id"));};prevSibling.onmouseout = function () {setTimeout("hideHelp('"+this.getAttribute('help_id')+"')", 500);}}return 1;}var overHelp = 0;function showHelp(fieldObj, help_id) {if (!fieldObj || !help_id || !helpTexts[help_id]) return 0;var help_box = document.getElementById("help_box");if (!help_box) {help_box = document.createElement("div");help_box.id = "help_box";help_box.className = "help_box";help_box.onmouseover = function () {overHelp = 1;};help_box.onmouseout = function () {overHelp = 0;};document.body.appendChild(help_box);help_box = document.getElementById("help_box");}var field_top = findPosY(fieldObj);var field_left = findPosX(fieldObj);help_box.innerHTML = helpTexts[help_id];help_box.style.top = (field_top+10)+"px";help_box.style.left = (field_left+50)+"px";help_box.style.display = "block";help_box.setAttribute("help_id", help_id);}function hideHelp(help_id) {if (overHelp) return 1;var help_box = document.getElementById("help_box");if (help_box) {if (help_id && help_box.getAttribute("help_id")!=help_id) return 0;help_box.style.display = "none";}return 1;}function findPosX(obj) {var curleft = 0;if (obj.offsetParent) {while (obj.offsetParent) {curleft += obj.offsetLeft;obj = obj.offsetParent;}} else if (obj.z) curleft += obj.z;return curleft;}function findPosY(obj) {var curtop = 0;if (obj.offsetParent) {while (obj.offsetParent) {curtop += obj.offsetTop;obj = obj.offsetParent;}} else if (obj.x) curtop += obj.x;return curtop;}