function ec(a) { (v = a), jQuery("#loanproduct").val(v), "active" != jQuery("li#" + v).attr("class") && jQuery("li#" + v) .addClass("active") .siblings() .removeClass("active"), jQuery("ul.loanproduct-nav li").click(function () { return ( "active" != jQuery(this).attr("class") && (jQuery(this).addClass("active").siblings().removeClass("active"), (v = jQuery(this).attr("id")), jQuery("#loanproduct").val(v), "home-loan" == v ? jc("Home Loan/LAP Amount", 2e7, 1e5, 5e6, 20, 10.5, 30, 0.5, 240) : "personal-loan" == v ? jc("Business Loan Amount", 15e5, 1e4, 35e4, 25, 17.5, 5, 0.25, 36) : "car-loan" == v && jc("Car Loan Amount", 2e6, 1e4, 4e5, 20, 12.5, 7, 0.25, 60), X()), !1 ); }); } function lc() { jQuery("#loanamount").blur(function () { jQuery("#loanamount").val( Globalize.format( Math.round( jQuery("#loanamount") .val() .replace(/[^\d\.]/g, "") ), "n", "en-IN" ) ); }), jQuery("#loaninterest").blur(function () { jQuery("#loaninterest").val( Math.round( 1e3 * jQuery("#loaninterest") .val() .replace(/[^\d\.]/g, "") ) / 1e3 ); }), jQuery("#loanterm").blur(function () { jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loanterm").val( Math.round( (Math.round( 12 * jQuery("#loanterm") .val() .replace(/[^\d\.]/g, "") ) / 12) * 100 ) / 100 ) : jQuery("#loanterm").val( jQuery("#loanterm") .val() .replace(/[^\d\.]/g, "") ); }); } function hc(a) { var e = jQuery("#emicalculatorform").find(":input").get(); return "object" != typeof a ? ((a = {}), jQuery.each(e, function () { this.name && (this.checked || /select|textarea/i.test(this.nodeName) || /text|hidden|password/i.test(this.type)) && "loandata" != this.name && (a[this.name] = jQuery(this).val()); }), a) : (jQuery.each(e, function () { this.name && a[this.name] ? "checkbox" == this.type || "radio" == this.type ? (jQuery(this).prop("checked", a[this.name] == jQuery(this).val()), a[this.name] == jQuery(this).val() ? (jQuery(this).parent(".btn").addClass("active"), jQuery(this) .parent(".btn") .siblings("input[name=" + this.name + "]") .removeClass("active")) : (jQuery(this).parent(".btn").removeClass("active"), jQuery(this) .parent(".btn") .siblings("input[name=" + this.name + "]") .addClass("active"))) : jQuery(this).val(a[this.name]) : "checkbox" == this.type && jQuery(this).prop("checked", !1); }), jQuery(this)); } function fc() { jQuery("#startmonthyear").attr("readonly", !0), jQuery("#startmonthyear") .datepicker({ format: "M yyyy", minViewMode: 1, autoclose: !0 }) .on("changeDate", function () { jQuery(this).datepicker("getDate").toDateString() != Tb.c.toDateString() && ((Tb.c = jQuery(this).datepicker("getDate")), X()); }) .on("hide", function () { jQuery("#startmonthyear").blur(); }), (Tb.c = new Date()), jQuery("#startmonthyear").datepicker("setDate", Tb.c); } function gc() { jQuery("#loanamount").unbind("change"), jQuery("#loaninterest").unbind("change"), jQuery("#loanterm").unbind("change"), jQuery("#emicalculatorform input[name='loantenure']").unbind("change"), jQuery("#emicalculatorform input[name='emischeme']").unbind("change"); } function pc(a, e, s, n, t) { (Vb = jQuery("#loanamountslider").slider({ range: "min", value: parseInt( jQuery("#loanamount") .val() .replace(/[^\d\.]/g, "") ), min: 0, max: a, step: e, slide: function (a, e) { jQuery("#loanamount").val(Globalize.format(Math.round(e.value), "n", "en-IN")); }, change: function (a) { a.originalEvent && X(); }, })), Vb.slider("value", Vb.slider("value")), (Wb = jQuery("#loaninterestslider").slider({ range: "min", value: parseFloat(jQuery("#loaninterest").val()), min: 5, max: s, step: 0.25, slide: function (a, e) { jQuery("#loaninterest").val(e.value); }, change: function (a) { a.originalEvent && X(); }, })), Wb.slider("value", Wb.slider("value")), (a = parseInt(jQuery("#loanterm").val())), jQuery("#emicalculatorform input[name='loantenure']")[1].checked && (a = parseInt(jQuery("#loanterm").val()) / 12), (Xb = jQuery("#loantermslider").slider({ range: "min", value: a, min: 0, max: n, step: t, slide: function (a, e) { jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loanterm").val(e.value) : jQuery("#loanterm").val(12 * e.value); }, change: function (a) { a.originalEvent && X(); }, })), Xb.slider("value", Xb.slider("value")); } function ic() { jQuery("#loanamount").change(function () { Vb.slider("value", this.value.replace(/[^\d\.]/g, "")), X(); }), jQuery("#loaninterest").change(function () { Wb.slider("value", this.value), X(); }), jQuery("#loanterm").change(function () { jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? Xb.slider("value", this.value) : Xb.slider("value", this.value / 12), X(); }), jQuery("#emicalculatorform input[name='loantenure']").change(function () { jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loanterm").val( Math.round( (jQuery("#loanterm") .val() .replace(/[^\d\.]/g, "") / 12) * 100 ) / 100 ) : jQuery("#loanterm").val( Math.round( 12 * jQuery("#loanterm") .val() .replace(/[^\d\.]/g, "") ) ), qc(); }), jQuery("#emicalculatorform input[name='emischeme']").change(function () { X(); }); } function jc(a, e, s, n, t, l, r, c, o) { gc(), jQuery("label[for=loanamount]").html(a), jQuery("#loanamount").val(Globalize.format(n, "n", "en-IN")), jQuery("#loaninterest").val((1e3 * l) / 1e3), jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loanterm").val(o / 12) : jQuery("#loanterm").val(o), pc(e, s, t, r, c), ic(), qc(), "car-loan" == v ? jQuery(".toggle-hidden").removeClass("toggle-hidden").addClass("toggle-visible") : jQuery(".toggle-visible").removeClass("toggle-visible").addClass("toggle-hidden"); } function qc() { "home-loan" == v ? (jQuery("#loanamountsteps").html( '|
0
|
25L
|
50L
|
75L
|
100L
|
125L
|
150L
|
175L
|
200L
' ), jQuery("#loanintereststeps").html( '|
5
|
7.5
|
10
|
12.5
|
15
|
17.5
|
20
' ), jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loantermsteps").html( '|
0
|
5
|
10
|
15
|
20
|
25
|
30
' ) : jQuery("#loantermsteps").html( '|
0
|
60
|
120
|
180
|
240
|
300
|
360
' )) : "personal-loan" == v ? (jQuery("#loanamountsteps").html( '|
0
|
2.5L
|
5L
|
7.5L
|
10L
|
12.5L
|
15L
' ), jQuery("#loanintereststeps").html( '|
5
|
7.5
|
10
|
12.5
|
15
|
17.5
|
20
|
22.5
|
25
' ), jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loantermsteps").html( '|
0
|
1
|
2
|
3
|
4
|
5' ) : jQuery("#loantermsteps").html( '|
0
|
12
|
24
|
36
|
48
|
60' )) : "car-loan" == v && (jQuery("#loanamountsteps").html( '|
0
|
5L
|
10L
|
15L
|
20L
' ), jQuery("#loanintereststeps").html( '|
5
|
7.5
|
10
|
12.5
|
15
|
17.5
|
20
' ), jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loantermsteps").html( '|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
' ) : jQuery("#loantermsteps").html( '|
0
|
12
|
24
|
36
|
48
|
60
|
72
|
84
' )); } function mc() { jQuery(".ecalprint").click(function () { jQuery('#page #main').find('#middle').css('padding-top', '0px'); jQuery('#page #main').find('#middle .emicalculatorcontainer').css('border', 'none'); jQuery('#page #main').find('#header').hide(); jQuery('#page #main').find('#middle .headline').hide(); jQuery('.page').find('#footer').hide(); jQuery('#page #main').find('#ecalprintandshare').hide(); window.print(); jQuery('#page #main').find('#header').show(); jQuery('#page #main').find('#middle .headline').show(); jQuery('.page').find('#footer').show(); jQuery('#page #main').find('#ecalprintandshare').show(); jQuery('#page #main').find('#middle').css('padding-top', ''); jQuery('#page #main').find('#middle .emicalculatorcontainer').css('border', ''); }); } function nc() { jQuery(".ecalshare").click(function () { jQuery("#loader").toggle(); var a = hc(); return ( (a = Base64.encode(unescape(encodeURIComponent(JSON.stringify(a))))), jQuery.get("https://emicalculator.net/bitly/?longURL=https://emicalculator.net/?ecdata=" + a, function (a) { jQuery("#sharelink").val(a), jQuery("#ecalsharelink").slideDown(), jQuery("#loader").toggle(); }), !1 ); }), jQuery("#sharelink").click(function () { jQuery(this).focus().select(); }); } function X() { jQuery("#emicalculatorform").mask("Calculating EMI..."), setTimeout(sc, 10); } function sc() { jQuery("#ecalsharelink").hide(), (e = Math.abs( jQuery("#loanamount") .val() .replace(/[^\d\.]/g, "") )), (f = Math.abs(jQuery("#loaninterest").val() / 12 / 100)), (n = jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? Math.abs(Math.round(12 * jQuery("#loanterm").val())) : Math.abs(jQuery("#loanterm").val())), 0 == f && (jQuery("#loaninterest").val(5), (f = 0.004166666666666667), Wb.slider("value", 5)), 0 == n && (jQuery("#emicalculatorform input[name='loantenure']")[0].checked ? jQuery("#loanterm").val(1) : jQuery("#loanterm").val(12), Xb.slider("value", 1), (n = 12)), (db = 0), "emiadvance" == jQuery("#emicalculatorform input[name='emischeme']:checked").val() && (db = 1), jQuery("#loanstartdate").val(jQuery("#startmonthyear").val()), (q = "car-loan" == v && 1 == db ? (Math.pow(1 + f, n - 1) / (Math.pow(1 + f, n) - 1)) * f * e : (Math.pow(1 + f, n) / (Math.pow(1 + f, n) - 1)) * f * e), jQuery("#emiamount span").text(Globalize.format(Math.round(q), "n", "en-IN")), jQuery("#emitotalinterest span").text(Globalize.format(Math.round(q * n - e), "n", "en-IN")), jQuery("#emitotalamount span").text(Globalize.format(Math.round(q * n), "n", "en-IN")), (w = []), (x = []), ($b = []), (ac = []), (bc = []), (y = []), (z = []), (U = []), (V = []), (cc = []), (y[0] = new Date(Tb.c.getTime())), "car-loan" == v && 1 == db ? ((U[0] = 0), (z[0] = q)) : ((U[0] = e * f), (z[0] = q - U[0])), (V[0] = e - z[0]), (cc[0] = ((e - V[0]) / e) * 100); var a = y[0].getFullYear(), s = 0; for (w[s++] = a, x[a] = z[0], $b[a] = U[0], ac[a] = V[0], bc[a] = cc[0], i = 1; i < n; i++) (y[i] = new Date(y[i - 1].getTime())), y[i].setMonth(y[i].getMonth() + 1, 1), (U[i] = V[i - 1] * f), (z[i] = q - U[i]), (V[i] = V[i - 1] - z[i]), (cc[i] = ((e - V[i]) / e) * 100), y[i].getFullYear() != a && ((a = y[i].getFullYear()), (w[s++] = a), (x[a] = 0), ($b[a] = 0), (ac[a] = 0), (bc[a] = 0)), (x[a] += z[i]), ($b[a] += U[i]), (ac[a] = V[i]), (bc[a] = cc[i]); (V[n - 1] = 0), (ac[a] = 0), (cc[n - 1] = 100), (bc[a] = 100), tc(), uc(), vc(), jQuery("#emicalculatorform").unmask(); } function uc() { var a = [], s = [], n = [], t = [], l = 0; l = 0; for (var r = w.length; l < r; l++) { var c = w[l]; (a[l] = c), (s[l] = x[c]), (n[l] = $b[c]), (t[l] = ac[c]); } new Highcharts.Chart({ chart: { renderTo: "emibarchart", backgroundColor: "transparent", plotBackgroundColor: "transparent", defaultSeriesType: "column", borderWidth: 0, C: 0, G: 0 }, title: { text: "" }, xAxis: { categories: a, minorTickInterval: "auto", tickmarkPlacement: "on", labels: { rotation: -45, align: "right", step: 8 < w.length ? 2 : 1, style: { font: "normal 9px Verdana, sans-serif" }, formatter: function () { return this.value; }, }, }, yAxis: [ { min: 0, title: { text: "EMI Payment / year" }, stackLabels: { enabled: !1, style: { fontWeight: "bold", color: (Highcharts.theme && Highcharts.theme.j) || "gray" } }, opposite: !0, labels: { formatter: function () { return "₹ " + Globalize.format(this.value, "n", "en-IN"); }, }, }, { min: 0, title: { text: "Balance" }, stackLabels: { enabled: !1, style: { fontWeight: "bold", color: (Highcharts.theme && Highcharts.theme.j) || "gray" } }, labels: { formatter: function () { return "₹ " + Globalize.format(this.value, "n", "en-IN"); }, }, }, ], legend: { align: "center", itemMarginBottom: 2, itemMarginTop: 2, verticalAlign: "bottom", floating: !1, backgroundColor: "#FFFFFF", shadow: !1 }, tooltip: { formatter: function () { return "Balance" == this.series.name ? "Year: " + this.x + "
" + this.series.name + " : ₹ " + Globalize.format(this.y, "n", "en-IN") + "
Loan Paid To Date : " + Globalize.format(((e - this.y) / e) * 100, "n2", "en-IN") + "%" : "Year : " + this.x + "
" + this.series.name + " : ₹ " + Globalize.format(this.y, "n", "en-IN") + "
Total Payment : ₹ " + Globalize.format(this.point.stackTotal, "n", "en-IN"); }, }, plotOptions: { column: { borderWidth: 0, stacking: "normal", dataLabels: { enabled: !1, color: (Highcharts.theme && Highcharts.theme.u) || "white" } } }, series: [ { name: "Interest", data: n, yAxis: 0, legendIndex: 2, color: "#ffc91f" }, { name: "Principal", data: s, yAxis: 0, legendIndex: 1, color: "#27286f" }, { name: "Balance", data: t, type: "spline", yAxis: 1, legendIndex: 3, color: "#B8204C" }, ], }); } function vc() { Ub = ''; for (var a = 0, e = 0, s = w.length; e < s; e++) { var n = w[e]; (Ub += '"), (Ub += '"; } (Ub += "
YearPrincipal
(A)
PrincipalInterest
(B)
InterestTotal Payment
(A + B)
BalanceLoan Paid
' + n + '₹ ' + Globalize.format(x[n], "n", "en-IN") + '₹ ' + Globalize.format($b[n], "n", "en-IN") + '₹ ' + Globalize.format(x[n] + $b[n], "n", "en-IN") + '₹ ' + Globalize.format(ac[n], "n", "en-IN") + '' + Globalize.format(bc[n], "n2", "en-IN") + "%
'); for (var t = y.length; a < t && y[a].getFullYear() == n; ) Ub += '"; Ub += "
' + dc[y[a].getMonth()] + '₹ ' + Globalize.format(z[a], "n", "en-IN") + '₹ ' + Globalize.format(U[a], "n", "en-IN") + '₹ ' + Globalize.format(z[a] + U[a], "n", "en-IN") + '₹ ' + Globalize.format(V[a], "n", "en-IN") + '' + Globalize.format(cc[a++], "n2", "en-IN") + "%
"), jQuery("#emipaymenttable").html(Ub), jQuery("#emipaymenttable tr.monthlypaymentdetails").find("div").hide(), jQuery("#emipaymenttable td.toggle").click(function () { var a = jQuery(this).attr("id"); jQuery(this).toggleClass("toggle-open"), jQuery("tr#month" + a) .find("div") .slideToggle(); }); } function tc() { new Highcharts.Chart({ chart: { renderTo: "emipiechart", backgroundColor: "transparent", plotBackgroundColor: "transparent", borderWidth: null, plotBorderWidth: null, plotShadow: !1 }, title: { text: "Break-up of Total Payment" }, tooltip: { formatter: function () { return "" + this.point.name + ": " + Math.round(10 * this.percentage) / 10 + "%"; }, }, plotOptions: { pie: { borderWidth: 0, startAngle: 0, allowPointSelect: !0, cursor: "pointer", dataLabels: { style: { textOutline: !1 }, enabled: !0, distance: -30, color: "#FFFFFF", formatter: function () { return "" + Math.round(10 * this.percentage) / 10 + "%"; }, }, showInLegend: !0, }, }, series: [ { type: "pie", name: "Principal Loan Amount vs. Total Interest", data: [ { name: "Principal Loan Amount", y: e, color: "#27286f" }, { name: "Total Interest", y: q * n - e, sliced: !0, selected: !0, color: "#ffc91f" }, ], }, ], }); } var e, f, n, q, db, Tb = { c: new Date() }, Ub, v, Vb, Wb, Xb, Yb, Zb, w = [], x = [], $b = [], ac = [], bc = [], y = [], z = [], U = [], V = [], cc = [], dc = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "); jQuery(document).ready(function () { ec("home-loan"), fc(); var a = jQuery("#loandata").val(); if ("" != a) { jQuery(".loanproduct-nav").hide(), (a = jQuery.parseJSON(decodeURIComponent(escape(Base64.decode(a))))), (v = a.loanproduct), ec(v), gc(), hc(a), ic(); var e = Math.abs( jQuery("#loanamount") .val() .replace(/[^\d\.]/g, "") ), s = jQuery("#loaninterest").val(), n = jQuery("#loanterm").val(); "loanyears" == a.loantenure && (n *= 12), jQuery("#emicalculatorform input[name='emischeme']:checked").val(), "home-loan" == v ? jc("Home Loan/LAP Amount", 2e7, 1e5, e, 20, s, 30, 0.5, n) : "personal-loan" == v ? jc("Business Loan Amount", 15e5, 1e4, e, 25, s, 5, 0.25, n) : "car-loan" == v && jc("Car Loan Amount", 2e6, 1e4, e, 20, s, 7, 0.25, n), 0 < (selDate = a.loanstartdate).length && ((Zb = selDate.substring(selDate.length - 4, selDate.length)), (Yb = jQuery.inArray(selDate.substring(0, selDate.length - 5), dc)), jQuery("#startmonthyear").datepicker("setDate", new Date(Zb, Yb, 1))); } else jc("Home Loan/LAP Amount", 2e7, 1e5, 5e6, 20, 10.5, 30, 0.5, 240); lc(), mc(), nc(), X(); }); //# sourceMappingURL=emicalculator.js.map