﻿<!-- UNAUTHORIZED COPYING OF THIS DOCUMENT, AND/OR COPYRIGHT INFRINGEMENT IS PROHIBITED BY LAW. WE WILL VIGOROUSLY PROSECUTE THE OFFENDERS.-->
function reCalculateKt(changedObj) {ktArray = new Array();refreshVariables();ktArray["summary"] = new Array();displayValues();}function displayValues() {for (var fieldId in ktArray["summary"]) {var fieldObj = document.getElementById(fieldId);if (fieldObj && ktArray["summary"][fieldId]) {fieldObj.innerHTML = numberFormat(ktArray["summary"][fieldId], fieldObj.getAttribute("valuetype"), fieldObj.getAttribute("valueformat"));}}}function floor(number){return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);}function dosum(){var mon_ins = document.contract.interest_rate.value / 1200;var base = 1;var mbase = 1 + mon_ins;for (i=0; i<document.contract.loan_term.value * 12; i++){base = base * mbase}document.contract.prin_int.value = floor(document.contract.loan_amt.value * mon_ins / ( 1 - (1/base)));document.contract.mon_tax.value = floor(document.contract.an_tax.value / 12);document.contract.mon_ins.value = floor(document.contract.an_ins.value / 12);var dasum = document.contract.loan_amt.value * mon_ins / ( 1 - (1/base)) + document.contract.an_tax.value / 12 + document.contract.an_ins.value / 12;document.contract.loan_payment.value = floor(dasum);}function MM_preloadImages() {if (document.images) {var imgFiles = MM_preloadImages.arguments;var preloadArray = new Array();for (var i=0; i<imgFiles.length; i++) {preloadArray[i] = new Image;preloadArray[i].src = imgFiles[i];}}}function MM_swapImage() {var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];if ((objStr.indexOf('document.layers[')==0 && document.layers==null) || (objStr.indexOf('document.all[')   ==0 && document.all   ==null))objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);obj = eval(objStr);if (obj != null) {swapArray[j++] = obj;swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];obj.src = MM_swapImage.arguments[i+2];} }document.MM_swapImgData = swapArray;}var helpTexts = new Array();helpTexts["Y_R"] = "This is the number of years you are financing the property for. Buyers may be given the option of creating flexible payment terms. Buyers receive a deed to the property when the money due under the terms of the contract is paid.";helpTexts["I_R"] = "Interest rate is negotiable. There is no minimum interest rate imposed by most States. However, if the interest charged is less than the applicable federal rate published monthly by the Internal Revenue Service, the IRS can consider part of each payment to be interest rather than payment of principal on the land purchase.";helpTexts["L_A"] = "Owner financing of real estate in which the purchase price is to be paid in installments and no promissory note or mortgage is involved between the seller and the buyer. Land contract, land installment contract, agreement for deed and contract for deed are different ways of describing the same thing. In some States a land contract is more common and in other States a contract for deed is used.";helpTexts["A_T"] = "Enter the estimated annual property tax.";helpTexts["A_I"] = "Enter the estimated annual property insurance.";helpTexts["M_T"] = "During the term of the contract, the buyer may be required to pay the real estate taxes, or reimburse the Seller.";helpTexts["M_I"] = "During the term of the contract, the buyer may be required to keep the property insured, or reimburse the Seller.";helpTexts["P_I"] = "Principal + interest. The buyer pays the owner a certain amount of money over time with interest payable on the unpaid balance.";helpTexts["M_P"] = "Principal + interest + taxes + insurance = PITI. With minimal credit requirements, low closing costs and a smaller down payment than most banks would require, owner financing can benefit many buyers.";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+20)+"px";help_box.style.left = (field_left+0)+"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;}
