var Mortgage=function(){function i(n){if(!n||!n.loanAmount||!n.annualRate&&n.annualRate!=0||!n.months||!n.percentDownPayment&&n.percentDownPayment!=0)return console&&console.log("getMonthlyPayment() error: a required parameter is missing."),null;(Number.isNaN(n.loanAmount)||n.loanAmount<1||n.loanAmount>1e9)&&console&&console.log("Warning: the 'params.loanAmount' object is missing, not a number or has an unexpected value. Please provide an integer between 0-1000000000.");(Number.isNaN(n.annualRate)||n.annualRate<0||n.annualRate>100)&&console&&console.log("Warning: the 'params.annualRate' is not a number or has an unexpected value. Please provide an integer between 0-100.");(Number.isNaN(n.months)||n.months<1||n.months>1e3)&&console&&console.log("Warning: the 'params.months' is not a number or has an unexpected value. Please provide an integer between 1-1000.");(Number.isNaN(n.percentDownPayment)||n.percentDownPayment<0||n.percentDownPayment>100)&&console&&console.log("Warning: the 'params.percentDownPayment' is not a number or has an unexpected value. Please provide an integer between 0-100.");var t=n.annualRate/1200,i=n.percentDownPayment/100*n.loanAmount,r=(n.loanAmount-i)*t*Math.pow(1+t,n.months)/(Math.pow(1+t,n.months)-1);return r.toFixed(2)}function n(n){if(!n||!n.monthlyPayment||!n.annualRate&&n.annualRate!=0||!n.months||!n.percentDownPayment&&n.percentDownPayment!=0)return console&&console.log("getMonthlyPayment() error: a required parameter is missing."),null;(Number.isNaN(n.monthlyPayment)||n.monthlyPayment<1||n.monthlyPayment>1e4)&&console&&console.log("Warning: the 'params.monthlyPayment' object is not a number or has an unexpected value. Please provide an integer between 0-10000.");(Number.isNaN(n.annualRate)||n.annualRate<0||n.annualRate>100)&&console&&console.log("Warning: the 'params.annualRate' is not a number or has an unexpected value. Please provide an integer between 0-100.");(Number.isNaN(n.months)||n.months<1||n.months>360)&&console&&console.log("Warning: the 'params.months' is not a number or has an unexpected value. Please provide an integer between 1-360.");(Number.isNaN(n.percentDownPayment)||n.percentDownPayment<0||n.percentDownPayment>100)&&console&&console.log("Warning: the 'params.percentDownPayment' is not a number or has an unexpected value. Please provide an integer between 0-100.");var i=n.annualRate/1200,t=n.monthlyPayment*(Math.pow(1+i,n.months)-1)/(i*Math.pow(1+i,n.months));return t=t+t*(n.percentDownPayment/100),t.toFixed()}function r(i){if(!i||!i.percentVariance)return console&&console.log("getLoanAmountRange() failed: One or more required parameters were missing."),null;var r=Number.parseFloat(n(i));return result=t(r,i.percentVariance)}function t(n,t){if(!n||!t)return console&&console.log("_calculateRange() failed: One or more required parameters were missing."),null;t=t/100;var i=Number.parseFloat(n);return result={LowAmount:(i-i*t).toFixed(0),HighAmount:(i+i*t).toFixed(0)}}return{getMonthlyPayment:function(n){return i(n)},getLoanAmount:function(t){return n(t)},getLoanAmountRange:function(n){return r(n)},calculateRange:function(n,i){return t(n,i)}}}();$(function(){var n=navigator.userAgent.match(/iPad/i)!=null,t=navigator.userAgent.match(/iPhone/i)!=null||navigator.userAgent.match(/iPod/i)!=null;n&&$("body").prepend("<style>        .safari.touch body#ui-v3-listing-listingsearch, .safari.touch body#ui-v3-listing-listingsearch .viewport-container { overflow-x: hidden !important; }         .safari.touch #colorbox0,         .safari.touch #cboxWrapper0,         .safari.touch #cboxContent,         .safari.touch #cboxLoadedContent0 { -webkit-overflow-scrolling: touch; overflow-y: scroll !important;}<\/style>")})