document.writeln('<html xmlns="http://www.w3.org/1999/xhtml" >');document.writeln("<head>");document.writeln("    <title></title>");document.writeln('    <link rel="stylesheet" href="http://www.bankrate.com/free-content/css/bankrate-fcc-calculators.css" type ="text/css" />');document.writeln('    <script type="text/javascript">');document.writeln('        var loanvalues = "";');document.writeln("        loanvalues = (document.getElementById('loanCal').value);");document.writeln("	    function loanCalValidateMinMax(txtID, spanID, minVal, maxVal) {");document.writeln("	        var boolResult = false;");document.writeln("	        var txtValue = document.getElementById(txtID).value;");document.writeln("	        txtValue = loanCalCleanVariable(txtValue);");document.writeln('	        if (txtValue != "") {');document.writeln("	            if (parseFloat(txtValue) == txtValue) {");document.writeln("	                if (txtValue >= minVal && txtValue <= maxVal) {");document.writeln("	                    boolResult = true;");document.writeln("	                }");document.writeln("	                else {");document.writeln('	                    document.getElementById(spanID).innerHTML = "*Please enter a value between " + minVal + " and " + maxVal + ".";');document.writeln("	                }");document.writeln("	            }");document.writeln("	            else {");document.writeln('	                document.getElementById(spanID).innerHTML = "*Please enter a number value.";');document.writeln("	            }");document.writeln("	        }");document.writeln("	        else {");document.writeln('	            document.getElementById(spanID).innerHTML = "*This field cannot be blank.";');document.writeln("	        }");document.writeln("	        return boolResult;");document.writeln("	    }");document.writeln("	    function loanCalValidateInterestRate(txtID, spanID, minVal, maxVal) {");document.writeln("	        var boolResult = false;");document.writeln("	        var txtValue = document.getElementById(txtID).value;");document.writeln("	        txtValue = loanCalCleanVariable(txtValue);");document.writeln('	        if (txtValue != "") {');document.writeln("	            if (parseFloat(txtValue) == txtValue) {");document.writeln("	                if (txtValue > minVal && txtValue <= maxVal) {");document.writeln("	                    boolResult = true;");document.writeln("	                }");document.writeln("	                else if (txtValue <= minVal) {");document.writeln('	                    document.getElementById(spanID).innerHTML = "*Please enter a value greater than " + minVal + ".";');document.writeln("	                }");document.writeln("	                else if (txtValue > maxVal) {");document.writeln('	                    document.getElementById(spanID).innerHTML = "*Please enter a value between " + minVal + " and " + maxVal + ".";');document.writeln("	                }");document.writeln("	            }");document.writeln("	            else {");document.writeln('	                document.getElementById(spanID).innerHTML = "*Please enter a number value.";');document.writeln("	            }");document.writeln("	        }");document.writeln("	        else {");document.writeln('	            document.getElementById(spanID).innerHTML = "*This field cannot be blank.";');document.writeln("	        }");document.writeln("	        return boolResult;");document.writeln("	    }");document.writeln("");document.writeln("	    function loanCalCleanVariable(string) {");document.writeln('	        string = string.split(" ").join("");');document.writeln('	        string = string.split(",").join("");');document.writeln('	        string = string.split("%").join("");');document.writeln('	        string = string.split("$").join("");');document.writeln("	        return string;");document.writeln("	    }");document.writeln("");document.writeln("	    function loanCalcleanErrorSpan() {");document.writeln('	        document.getElementById("errloanCalLoanAmount").innerHTML = "";');document.writeln('	        document.getElementById("errloanCalLoanTerm").innerHTML = "";');document.writeln('	        document.getElementById("errloanCalInterestRate").innerHTML = "";');document.writeln("	    }");document.writeln("");document.writeln("	    function loanCalCalculateMonthlyPayment() {");document.writeln("	        loanCalcleanErrorSpan();");document.writeln('	        var loanAmount = loanCalCleanVariable(document.getElementById("txtloanCalLaonAmount").value);');document.writeln('	        var years = loanCalCleanVariable(document.getElementById("txtloanCalLoanTerm").value);');document.writeln("	        var months = parseFloat(years) * 12;");document.writeln('	        var interestRate = loanCalCleanVariable(document.getElementById("txtloanCalInterestRate").value);');document.writeln("");document.writeln('	        var boolAmount = loanCalValidateMinMax("txtloanCalLaonAmount", "errloanCalLoanAmount", 0, 10000000);');document.writeln('	        var boolTerm = loanCalValidateMinMax("txtloanCalLoanTerm", "errloanCalLoanTerm", 0.083, 40);');document.writeln('	        var boolRate = loanCalValidateInterestRate("txtloanCalInterestRate", "errloanCalInterestRate", 0, 99);');document.writeln("	        if (boolAmount && boolRate && boolTerm) {");document.writeln("	            var factor = 1;");document.writeln("	            var rate = parseFloat(interestRate) / 1200;");document.writeln("	            var interestRatePlusOne = parseFloat(rate) + 1;");document.writeln("	            for (var i = 0; i < months; i++) {");document.writeln("	                factor = parseFloat(factor) * parseFloat(interestRatePlusOne);");document.writeln("	            }");document.writeln("	            var result = (parseFloat(parseFloat(loanAmount) * parseFloat(factor) * parseFloat(rate)) / (parseFloat(factor) - 1)).toFixed(2);");document.writeln('	            document.getElementById("loanCalrate").innerHTML = loanCalCleanVariable(document.getElementById("txtloanCalInterestRate").value);');document.writeln('	            document.getElementById("loanCalyear").innerHTML = loanCalCleanVariable(document.getElementById("txtloanCalLoanTerm").value) +" years";');document.writeln('	            document.getElementById("loanCalamount").innerHTML = loanCalFormatCurrency(loanCalCleanVariable(document.getElementById("txtloanCalLaonAmount").value));');document.writeln('	            document.getElementById("loanCalmonthlyPayment").innerHTML = loanCalFormatCurrency(result);');document.writeln('	            document.getElementById("loanCalresultDiv").style.display = "block";');document.writeln('	            document.getElementById("loanCalbtnText").innerHTML="Recalculate";');document.writeln("	        }");document.writeln("	    }");document.writeln("        function loanCalFormatCurrency(num) {");document.writeln("                num = num.toString().replace(/$|,/g, '');");document.writeln("                if (isNaN(num))");document.writeln('                    num = "0";');document.writeln("                sign = (num == (num = Math.abs(num)));");document.writeln("                num = Math.floor(num * 100 + 0.50000000001);");document.writeln("                cents = num % 100;");document.writeln("                num = Math.floor(num / 100).toString();");document.writeln("                if (cents < 10)");document.writeln('                    cents = "0" + cents;');document.writeln("                for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)");document.writeln("                    num = num.substring(0, num.length - (4 * i + 3)) + ',' +");document.writeln("                num.substring(num.length - (4 * i + 3));");document.writeln("                return (((sign) ? '' : '-') + '$' + num + '.' + cents);");document.writeln("         }");document.writeln("         var loanCalSetOptions= loanvalues.split(',');");document.writeln("");document.writeln("         function loanCalGetColor()");document.writeln("         {");document.writeln('            if(loanCalSetOptions[0]=="1")');document.writeln("            {");document.writeln('                document.getElementById("loanCalheaderDiv").className = "BankrateFCC_boxhead-container-small" +" BankrateFCC_calc-blue-border";');document.writeln('                document.getElementById("loanCalbodyDiv").className = "BankrateFCC_calc-container-small" + " BankrateFCC_calc-blue" + " BankrateFCC_calc-blue-border";');document.writeln('                document.getElementById("loanCalresultDiv").className = "BankrateFCC_results-container" + " BankrateFCC_calc-blue-border";');document.writeln('                document.getElementById("loanCalfooterDiv").className = "BankrateFCC_footer-container small" +" BankrateFCC_calc-dkblue";');document.writeln("");document.writeln("");document.writeln("            }");document.writeln('            if(loanCalSetOptions[0]=="2")');document.writeln("            {");document.writeln('                document.getElementById("loanCalheaderDiv").className="BankrateFCC_boxhead-container-small" +" BankrateFCC_calc-orange-border";');document.writeln('                document.getElementById("loanCalbodyDiv").className="BankrateFCC_calc-container-small" + " BankrateFCC_calc-orange" + " BankrateFCC_calc-orange-border";');document.writeln('                document.getElementById("loanCalresultDiv").className = "BankrateFCC_results-container" + " BankrateFCC_calc-orange-border";');document.writeln('                document.getElementById("loanCalfooterDiv").className="BankrateFCC_footer-container small" +" BankrateFCC_calc-dkorange";');document.writeln("");document.writeln("            }");document.writeln('            if(loanCalSetOptions[0]=="3")');document.writeln("            {");document.writeln('                document.getElementById("loanCalheaderDiv").className = "BankrateFCC_boxhead-container-small" +" BankrateFCC_calc-gray-border";');document.writeln('                document.getElementById("loanCalbodyDiv").className = "BankrateFCC_calc-container-small" + " BankrateFCC_calc-gray" + " BankrateFCC_calc-gray-border";');document.writeln('                document.getElementById("loanCalresultDiv").className = "BankrateFCC_results-container" + " BankrateFCC_calc-gray-border";');document.writeln('                document.getElementById("loanCalfooterDiv").className = "BankrateFCC_footer-container small" +" BankrateFCC_calc-dkgray";');document.writeln("");document.writeln("            }");document.writeln('            if(loanCalSetOptions[0]=="4")');document.writeln("            {");document.writeln('                document.getElementById("loanCalheaderDiv").className = "BankrateFCC_boxhead-container-small" +" BankrateFCC_calc-green-border";');document.writeln('                document.getElementById("loanCalbodyDiv").className = "BankrateFCC_calc-container-small" + " BankrateFCC_calc-green" + " BankrateFCC_calc-green-border";');document.writeln('                document.getElementById("loanCalresultDiv").className = "BankrateFCC_results-container" + " BankrateFCC_calc-green-border";');document.writeln('                document.getElementById("loanCalfooterDiv").className = "BankrateFCC_footer-container small" +" BankrateFCC_calc-dkgreen";');document.writeln("");document.writeln("            }");document.writeln("         }");document.writeln("");document.writeln("        function loanCalSetWidthOptions()");document.writeln("        {");document.writeln("	       var loansizeOfWidget = loanCalSetOptions[2];");document.writeln('               if(loansizeOfWidget=="250"){');document.writeln("            for(var i=1;i<=3;i++) {");document.writeln('             document.getElementById("loanCalip"+i).style.width="150px";');document.writeln("            }");document.writeln("        }");document.writeln("           var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');");document.writeln("            var ie = (typeof window.ActiveXObject != 'undefined');");document.writeln("            if(moz){");document.writeln('               document.getElementById("loanCalbodyDiv").style.width = loansizeOfWidget - parseInt(20) + "px";');document.writeln('               document.getElementById("loanCalheaderDiv").style.width = parseInt(loansizeOfWidget)  + "px";');document.writeln('               document.getElementById("loanCalfooterDiv").style.width = parseInt(loansizeOfWidget) + parseInt(2) + "px";');document.writeln("");document.writeln("            }");document.writeln("            else if(ie){");document.writeln("if(Checkfun())");document.writeln("{");document.writeln('               document.getElementById("loanCalbodyDiv").style.width = loansizeOfWidget - parseInt(20) + "px";');document.writeln('               document.getElementById("loanCalheaderDiv").style.width = parseInt(loansizeOfWidget)  + "px";');document.writeln('               document.getElementById("loanCalfooterDiv").style.width = parseInt(loansizeOfWidget) + parseInt(2) + "px";');document.writeln("}");document.writeln("else");document.writeln("{");document.writeln('               document.getElementById("loanCalbodyDiv").style.width = parseInt(loansizeOfWidget)  + "px";');document.writeln('               document.getElementById("loanCalheaderDiv").style.width = parseInt(loansizeOfWidget)  + "px";');document.writeln('               document.getElementById("loanCalfooterDiv").style.width = parseInt(loansizeOfWidget)  + "px";');document.writeln("}");document.writeln('               if(loansizeOfWidget=="250"){');document.writeln('                   document.getElementById("loanCalDivCalculate").style.marginLeft="75px";');document.writeln("               }");document.writeln('               else if(loansizeOfWidget=="300"){');document.writeln('                   document.getElementById("loanCalDivCalculate").style.marginLeft="90px";');document.writeln("               }");document.writeln('               else if(loansizeOfWidget=="350"){');document.writeln('                   document.getElementById("loanCalDivCalculate").style.marginLeft="120px";');document.writeln("               }");document.writeln("");document.writeln("            }");document.writeln("        }");document.writeln("");document.writeln("");document.writeln("        function loanCalSetFontOptions()");document.writeln("        {");document.writeln("            for(var i=1;i<=3;i++)");document.writeln('             document.getElementById("loanCalip"+i).style.fontFamily=loanCalSetOptions[1];');document.writeln('             document.getElementById("loanCalyear").style.fontFamily=loanCalSetOptions[1];');document.writeln('             document.getElementById("loanCalrate").style.fontFamily=loanCalSetOptions[1];');document.writeln('             document.getElementById("loanCalamount").style.fontFamily=loanCalSetOptions[1];');document.writeln('             document.getElementById("loanCalmonthlyPayment").style.fontFamily=loanCalSetOptions[1];');document.writeln('             document.getElementById("loanCaltitleDiv").style.fontFamily=loanCalSetOptions[1];');document.writeln("");document.writeln("             for(var j=1;j<=4;j++)");document.writeln('               document.getElementById("loanCalresult"+j).style.fontFamily=loanCalSetOptions[1];');document.writeln("        }");document.writeln("");document.writeln("        function loanCalinit()");document.writeln("        {");document.writeln("            loanCalGetColor();");document.writeln("            loanCalSetWidthOptions();");document.writeln("            loanCalSetFontOptions();");document.writeln("        }");document.writeln("      function Checkfun(){");document.writeln("        var i=0;");document.writeln("        var strToFind =/DOCTYPE/;");document.writeln("        var docCount = 0;");document.writeln("        var docChekStatus = false;");document.writeln("        var flagt_comment = false;");document.writeln("        var loopexec = true;");document.writeln("        for(i=0; i< document.all.length; i++)");document.writeln("        {");document.writeln("          if(loopexec){");document.writeln("            if(document.all[i].text != null)");document.writeln("            {");document.writeln("                var nVal = document.all[i].text;");document.writeln("                var substr = nVal.substring('1', '4');");document.writeln("                  if(substr != \"\" && substr == '!--')");document.writeln("                    flagt_comment =true;");document.writeln("");document.writeln("                if(findPos != -1)");document.writeln("                {");document.writeln("                  var substr1 = nVal.substring('1', '4');");document.writeln("                  if(substr1 != \"\" && substr1 != '!--'){");document.writeln("                    var findPos = nVal.search(strToFind);");document.writeln("                    var posd = nVal.substring(parseInt(findPos - 1), findPos);");document.writeln("                    if(posd == '!')");document.writeln("                    {");document.writeln("                      docCount = parseInt(docCount) + 1;");document.writeln("                      loopexec = false;");document.writeln("                    }");document.writeln("                  }");document.writeln("                }");document.writeln("            }");document.writeln("          }");document.writeln("        }");document.writeln("        if(docCount >= 1 && !flagt_comment)");document.writeln("           docChekStatus = true;");document.writeln("        return docChekStatus;");document.writeln("      }");document.writeln("    <\/script>");document.writeln("</head>");document.writeln("<body>");document.writeln("");document.writeln('	             <div id="loanCalbodyDiv" class="BankrateFCC_calc-container-small">');document.writeln("");document.writeln("							<!-- Script Content Begin -->");document.writeln("");document.writeln('                  <div id="loanCalip1" class="BankrateFCC_col1">Loan amount ($):</div>');document.writeln('                <div class="BankrateFCC_col2">');document.writeln('                  <input type="text" class="BankrateFCC_sel-options" id="txtloanCalLaonAmount" value="">');document.writeln("                </div>");document.writeln('                <div class="BankrateFCC_colFull">');document.writeln('                  <span id="errloanCalLoanAmount" class="BankrateFCC_form-error"></span>');document.writeln("                </div>");document.writeln("");document.writeln('                <div id="loanCalip2" class="BankrateFCC_col1">Interest rate (%):</div>');document.writeln('                <div class="BankrateFCC_col2">');document.writeln('                  <input type="text" class="BankrateFCC_sel-options" id="txtloanCalInterestRate" value="">');document.writeln("                </div>");document.writeln('                <div class="BankrateFCC_colFull">');document.writeln('                  <span id="errloanCalInterestRate" class="BankrateFCC_form-error"></span>');document.writeln("                </div>");document.writeln("");document.writeln('                  <div id="loanCalip3" class="BankrateFCC_col1">Loan term (years):</div>');document.writeln('                <div class="BankrateFCC_col2">');document.writeln('                  <input type="text" class="BankrateFCC_sel-options" id="txtloanCalLoanTerm" value="">');document.writeln("                </div>");document.writeln('                <div class="BankrateFCC_colFull">');document.writeln('                  <span id="errloanCalLoanTerm" class="BankrateFCC_form-error"></span>');document.writeln("                </div>");document.writeln("");document.writeln('                <div id="loanCalDivCalculate" class="BankrateFCC_button-small">');document.writeln("                  <div>");document.writeln('                    <a id="loanCalbtnText" href="javascript:onclick=loanCalCalculateMonthlyPayment()">Calculate</a>');document.writeln("                  </div>");document.writeln("                </div>");document.writeln('                <div id="loanCalresultDiv" style="display:none;" class="BankrateFCC_results-container">');document.writeln('                  <div id="loanCalresult1" class="BankrateFCC_results-col1">Loan term (years):</div>');document.writeln('                  <div class="BankrateFCC_results-col2">');document.writeln('                    <span id="loanCalyear"></span>');document.writeln("                  </div>");document.writeln("");document.writeln("");document.writeln('                  <div id="loanCalresult2" class="BankrateFCC_results-col1">Interest rate:</div>');document.writeln('                  <div class="BankrateFCC_results-col2">');document.writeln('                    <span id="loanCalrate"></span>%');document.writeln("                  </div>");document.writeln("");document.writeln('                  <div id="loanCalresult3" class="BankrateFCC_results-col1">Loan amount:</div>');document.writeln('                  <div class="BankrateFCC_results-col2">');document.writeln('                    <span id="loanCalamount"></span>');document.writeln("                  </div>");document.writeln("");document.writeln('                  <div id="loanCalresult4" class="BankrateFCC_results-col1">Total monthly payment:</div>');document.writeln('                  <div class="BankrateFCC_results-col2">');document.writeln('                    <span id="loanCalmonthlyPayment"></span>');document.writeln("                  </div>");document.writeln("                </div>");document.writeln("                <!-- Script Content End -->");document.writeln("");document.writeln("			</div>");document.writeln("");document.writeln("</body>");document.writeln("</html>");document.writeln("");
