var browserName=navigator.appName;if(browserName=="Microsoft Internet Explorer"){var show_tab="inline"}else{var show_tab="table-row"}function formatNumber(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function ClearAmountToSave_amtsave(){document.getElementById("AmountToResult").style.display="none";document.getElementById("TrExplain").style.display="none";document.getElementById("spnclear").style.display="none"}function ExplainAmount_amtsave(){document.getElementById("TrExplain").style.display=show_tab}function cl_calculate_amtsave(){var j;var g;var e;var f;var c;var d;var b;var h;var a;e=parseFloat(document.breakup.CL_tenure.value,10);j=parseFloat(document.breakup.CL_current.value,10);g=parseFloat(document.breakup.CL_roi.value,10)/1200;d=parseFloat(document.breakup.CL_cst.value);b=parseFloat(document.breakup.CL_inf.value)/100;c=d*Math.pow(1+b,e);f=c-j*Math.pow((1+g*12),e);a=parseFloat(document.breakup.CL_sav.value);h=a*(Math.pow(1+g,e*12)-1)/g;if(isNaN(Math.round((f*g)/(Math.pow((1+g),e*12)-1)))){alert("One or more of the numeric fields is wrong. Please Check")}else{if(document.layers){document.getElementById("CL_emi").value=Math.max(Math.round((f*g)/(Math.pow((1+g),e*12)-1)),0);document.getElementById("CL_current_value").value=Math.round(h+j*Math.pow((1+g*12),e));document.getElementById("CL_fv").value=Math.round(c);if(h+j*Math.pow((1+g*12),e)<c){document.getElementById("extra").value=Math.round(c-h-j*Math.pow((1+g*12),e))}else{document.getElementById("extra").value=0}}else{document.getElementById("CL_emi").value=Math.max(Math.round((f*g)/(Math.pow((1+g),e*12)-1)),0);document.getElementById("CL_fv").value=Math.round(c);document.getElementById("CL_current_value").value=Math.round(h+j*Math.pow((1+g*12),e));if(h+j*Math.pow((1+g*12),e)<c){document.getElementById("extra").value=Math.round(c-h-j*Math.pow((1+g*12),e))}else{document.getElementById("extra").value=0}}document.getElementById("AmountToResult").style.display="inline";document.getElementById("spnclear").style.display="inline";formatNumber("CL_emi");formatNumber("CL_fv");formatNumber("CL_current_value");formatNumber("extra")}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_amtsave(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_amtsave(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_amtsave(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_amtsave(a){if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Savings should be greater than or equal to 0.");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_cst.value))||parseFloat(a.CL_cst.value)<=0){alert("Cost should be greater than or equal to 0");a.CL_cst.focus();return false}if(isNaN(parseFloat(a.CL_tenure.value))||parseFloat(a.CL_tenure.value)<=0){alert("Period should be greater than 0.");a.CL_tenure.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<=0){alert("Return on investment should be greater than 0.");a.CL_roi.focus();return false}if(isNaN(parseFloat(a.CL_sav.value))||parseFloat(a.CL_sav.value)<0){alert("Your monthly savings should be greater than or equal to 0.");a.CL_sav.focus();return false}if(isNaN(parseFloat(a.CL_inf.value))||parseFloat(a.CL_inf.value)<0){alert("Inflation should be greater than or equal to 0");a.CL_inf.focus();return false}return true}function loan_autoemi(){var a=parseFloat(document.breakup.ap.value)}function asset_autoemi(){var a=parseFloat(document.breakup.p.value)}function calculate_autoemi(){var b=parseFloat(document.breakup.p.value);if(!b){b=0}var g=parseFloat(document.breakup.i.value)/100;if(!g){g=0}var j=parseFloat(document.breakup.tenure.value);if(!j){j=0}var n=document.breakup.timetype.options[document.breakup.timetype.options.selectedIndex].value;var m=parseFloat(document.breakup.reset.value);var c=parseFloat(document.breakup.adv.value);if(!c){c=0}var q=parseFloat(document.breakup.dep.value)/100;if(!q){q=0}var f=parseFloat(document.breakup.idep.value)/100;if(!f){f=0}var l=parseFloat(document.breakup.comp.options[document.breakup.comp.options.selectedIndex].value);if(!l){l=0}if(n=="yr"){j=j*12}var e=1/(1+g*m/12);var r=j/m;var o=0;if(q&&!isNaN(q)){if(l<=-1){o=q*b*(1+j/12*f)}else{o=q*b*Math.pow(1+l*f/12,j/l)}o=o*Math.pow(e,r)}var a=b+o-q*b;r=(j-c)/m;var d=(Math.pow(e,r)-1)/(e-1)*e;d+=c/m;var h=a/d/m;document.breakup.emi.value=Math.round(h);formatNumber("emi")}var str=window.location.href;var viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function hide_autoemi(){document.getElementById("TrAutoEmiCalculator").style.display="none";document.getElementById("spnclear").style.display="none"}function show_autoemi(){document.getElementById("TrAutoEmiCalculator").style.display="inline";document.getElementById("spnclear").style.display="inline"}function check_autoemi(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function display_autoemi(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible;viewHide=content}function validate_autoemi(a){if(!a.p.value||a.p.value<=0){alert("Loan Amount should be greater than 0");a.p.focus();return false}if(!a.i.value||a.i.value<=0){alert("Rate of Interest should be greater than 0");a.i.focus();return false}if(!a.tenure.value||parseFloat(a.tenure.value)<=0){alert("Repayment period should be greater than 0");a.tenure.focus();return false}if(!a.adv.value||parseFloat(a.adv.value)<0||10<parseFloat(a.adv.value)){alert("Advance EMIs should be between 0 and 10");a.adv.focus();return false}if(!a.dep.value||parseFloat(a.dep.value)<0){alert("Deposit should be greater than or equal to 0");a.dep.focus();return false}if(!a.idep.value||parseFloat(a.idep.value)<0){alert("Interest on deposit should be greater than or equal to 0");a.idep.focus();return false}return true}function ClearBondYield_bondyield(){document.getElementById("TrBondYield").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_bondyield(){var g=document.breakup.CL_amt.value;var f=parseFloat(document.breakup.CL_t2.value);var b=parseFloat(document.breakup.CL_roi2.value)/100;var e=parseFloat(document.breakup.CL_comp.options[document.breakup.CL_comp.options.selectedIndex].value);if(e>0){var d=Math.pow(1+b/e,e);var c=g*b/e}else{var d=Math.pow(1+f*b,1/f);var c=g*f*b}var a;if(e<0){a="simple"}if(e==1){a="annual"}if(e==2){a="semi annual"}if(e==4){a="quarterly"}if(e==12){a="monthly"}if(document.layers){document.getElementById("CL_tframe").value=a;document.getElementById("CL_inc").value=Math.round(c);document.getElementById("CL_irate").value=Math.round((d-1)*10000)/100}if(document.all){document.getElementById("CL_tframe").value=a;document.getElementById("CL_inc").value=Math.round(c);document.getElementById("CL_irate").value=Math.round((d-1)*10000)/100}document.getElementById("CL_tframe").value=a;document.getElementById("CL_inc").value=Math.round(c);formatNumber("CL_inc");document.getElementById("CL_irate").value=Math.round((d-1)*10000)/100;document.getElementById("TrBondYield").style.display="inline";document.getElementById("spnclear").style.display="inline"}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_bondyield(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_bondyield(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_bondyield(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_bondyield(a){if(isNaN(parseFloat(a.CL_amt.value))||parseFloat(a.CL_amt.value)<=0){alert("Invested amount should be greater than 0");a.CL_amt.focus();return false}if(isNaN(parseFloat(a.CL_t2.value))||parseFloat(a.CL_t2.value)<=0){alert("The period should be greater than 0.");a.CL_t2.focus();return false}if(isNaN(parseFloat(a.CL_roi2.value))||parseFloat(a.CL_roi2.value)<=0){alert("Rate of interest should be greater than 0.");a.CL_roi2.focus();return false}document.getElementById("TrBondYield").style.display="none";return true}function ClearCapitalGain_capgain(){document.getElementById("result_capitalgain").style.display="none";document.getElementById("CapitalExplain").style.display="none";document.getElementById("spnclear").style.display="none"}function ExplainFun_capgain(){document.getElementById("CapitalExplain").style.display="inline"}function cl_calculate_capgain(){var d;var c;var e;var b;var a=0;var f=0;d=parseFloat(document.breakup.ival.value,10);c=parseFloat(document.breakup.hidByr.value,10);e=parseFloat(document.breakup.CL_sval.value,10);b=parseFloat(document.breakup.hidSyr.value,10);if(c!=0&&b!=0){if(b==c){alert("As the buying and the selling year are same, the gains will be added to your regular income");CL_hid_capgain("result");CL_hid_capgain("explain")}if(b<c){alert("the sale year should come after the investment year");return}}if(c==0||b==0){alert("W.e.f 1-10-2004, Securities Transaction Tax (STT) is Applicable...So Long Term Capital Gains tax is NIL ");if(document.layers){document.getElementById("cl_emi").value=0;document.getElementById("cl_emi1").value=Math.round(e-d)}else{document.getElementById("cl_emi").value=0;document.getElementById("cl_emi1").value=Math.round(e-d)}}else{f=((e-d)*0.1)*1.1;a=(e-(b/c)*d)*0.2*1.1;f=Math.min(f,a);f=Math.max(0,f);if(isNaN(f)){alert("One or more of the numeric fields is wrong. Please Check")}else{if(document.layers){document.getElementById("cl_emi").value=Math.round(f);document.getElementById("cl_emi1").value=Math.round(e-d)}else{document.getElementById("cl_emi").value=Math.round(f);document.getElementById("cl_emi1").value=Math.round(e-d)}formatNumber("cl_emi");formatNumber("cl_emi1")}}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_capgain(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_capgain(a){document.getElementById("result_capitalgain").style.display="inline";document.getElementById("CapitalExplain").style.display="none";document.getElementById("spnclear").style.display="inline"}function CL_hid_capgain(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_capgain(a){if(!a.ival.value||a.ival.value<=0){alert("Investment value should be greater than 0.");a.ival.focus();return false}if(!a.CL_sval.value||a.CL_sval.value<=0){alert("Sale / Maturity value should be greater than 0");a.CL_sval.focus();return false}return true}function ChildEduEmiCalc_intcheck(){var a=document.getElementById("interest");if(a.value.length>2){if(a.value>100){alert("Interest Rate Cannot be Greater than 100");a.focus();return false}}}function calculate_childemu(){var e=document.breakup.edu_loan.value;var g=document.breakup.loan_pri.value;var b=document.getElementById("edu_loan");var f=document.getElementById("interest");if(b.value==""){alert("Enter the Education loan Amount");b.focus();return false}if(f.value==""){alert("Enter the Interest Rate");f.focus();return false}else{if((e==null||e==0)||(g==null||g==0)){document.breakup.emi.value=0}else{if(f.value>100){alert("Interest Rate Cannot be Greater than 100");f.focus();return false}else{var d=e;var c=g;var a=document.breakup.interest.value/1200;document.breakup.emi.value=parseInt(d*a/(1-(Math.pow(1/(1+a),c))))+1;show_childemu();formatNumber("emi")}}}}function hide_childemu(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_childemu(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline"}function hide_childwed(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_childwed(){document.getElementById("hid").style.display=show_tab;document.getElementById("spnclear").style.display="inline";formatNumber("emi")}function childwed_intcheck(){var a=document.getElementById("interest");if(a.value.length>2){if(a.value>100){alert("Interest Rate Cannot be Greater than 100");a.focus();return false}}}function calculate_childwed(){var e=document.breakup.loan.value;var g=document.breakup.loan_pri.value;var d=document.getElementById("loan");var f=document.getElementById("interest");if(d.value==""){alert("Enter the loan amount");d.focus();return false}if(f.value==""){alert("Enter the Interest Rate");f.focus();return false}if(f.value<0){alert("Interest Rate Cannot be Negative");f.focus();return false}else{if((e==null||e==0)||(g==null||g==0)||(f.value==null||f.value==0)){document.breakup.emi.value=0}else{if(f.value>100){alert("Interest Rate Cannot be Greater than 100");f.focus();return false}else{var c=e;var b=g;var a=document.breakup.interest.value/1200;document.breakup.emi.value=parseInt(c*a/(1-(Math.pow(1/(1+a),b))))+1;show_childwed();formatNumber("emi")}}}}function ClearCompoundingMagic_compmag(){document.getElementById("TrCompoundingMagic").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_compmag(){var d;var f;var c;var b;var e;f=parseFloat(document.breakup.CL_mon.value,10);b=parseFloat(document.breakup.CL_time.value,10);d=parseFloat(document.breakup.CL_current.value,10);c=1+parseFloat(document.breakup.CL_roi.value,10)/100;if(c==0){c=1e-8}e=d+f;for(var a=1;a<=b;a++){e=e*c;if(a!=b){e=e+f}}if(isNaN(e)){alert("One or more of the numeric fields are wrong. Please Check")}else{if(document.layers){document.layers.result.document.breakup.CL_emi.value=Math.round(e);formatNumber("CL_emi")}else{document.getElementById("TrCompoundingMagic").style.display="inline";document.getElementById("spnclear").style.display="inline";document.breakup.CL_emi.value=Math.round(e);formatNumber("CL_emi")}}}var CL_viewHide;function cl_check_compmag(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_vlidate_compmag(a){if(isNaN(parseFloat(a.CL_time.value))||parseFloat(a.CL_time.value)<=0){alert("Investment horizon should be greater than 0");a.age.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Current savings should be greater than or equal to 0");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_mon.value))||parseFloat(a.CL_mon.value)<0){alert("Monthly savings should be greater than or equal to 0");a.CL_mon.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<0){alert("Return on your investments should be greater than or equal to 0");a.CL_roi.focus();return false}return true}function ClearCostofLiving_costlive(){document.getElementById("TrSavingEnough").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_costlive(){var c=parseFloat(document.breakup.CL_infexp.value);var f=parseFloat(document.breakup.CL_ninfexp.value);var d=parseFloat(document.breakup.CL_col.value);var g=parseFloat(document.breakup.CL_incinf.value);var j=parseFloat(document.breakup.CL_decinf.value);var h=parseFloat(document.breakup.CL_nincinf.value);var b=parseFloat(document.breakup.CL_ndecinf.value);var a=parseFloat(document.breakup.CL_inf.value)/100;var e=c;e=e*Math.pow(1+a,d);var k=g-j;k=k*Math.pow(1+a,d);e+=k;CL_nexp=f+h-b;if(e<0){alert("Check inflationary expenses");return}if(CL_nexp<0){alert("Check Non Inflationaey expenses");return}if(document.all){document.getElementById("CL_inf_borrow").value=Math.round(e);document.getElementById("CL_ninf_borrow").value=Math.round(CL_nexp);document.getElementById("CL_exp_borrow").value=Math.round(e+CL_nexp);document.getElementById("TrSavingEnough").style.display="inline"}document.getElementById("CL_inf_borrow").value=Math.round(e);document.getElementById("CL_ninf_borrow").value=Math.round(CL_nexp);document.getElementById("CL_exp_borrow").value=Math.round(e+CL_nexp);formatNumber("CL_inf_borrow");formatNumber("CL_ninf_borrow");formatNumber("CL_exp_borrow");document.getElementById("TrSavingEnough").style.display="inline";document.getElementById("spnclear").style.display="inline";if(document.layers){}}var CL_viewHide;if(document.layers){}else{if(document.all){}}function cl_check_costlive(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_costlive(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_hid_costlive(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_vlidate_costlive(a){if(isNaN(parseFloat(a.CL_infexp.value))||parseFloat(a.CL_infexp.value)<=0){alert("Expenses should be greater than 0");a.CL_infexp.focus();return false}if(isNaN(parseFloat(a.CL_ninfexp.value))||parseFloat(a.CL_ninfexp.value)<0){alert("Expenses should be greater than or equal to 0");a.CL_ninfexp.focus();return false}if(isNaN(parseFloat(a.CL_col.value))||parseFloat(a.CL_col.value)<0){alert("Year should be greater than or equal to 0");a.CL_col.focus();return false}if(isNaN(parseFloat(a.CL_incinf.value))||parseFloat(a.CL_incinf.value)<0){alert("Increase should be greater than or equal to 0");a.CL_incinf.focus();return false}if(isNaN(parseFloat(a.CL_decinf.value))||parseFloat(a.CL_decinf.value)<0){alert("Decrease should be greater than or equal to 0");a.CL_decinf.focus();return false}if(isNaN(parseFloat(a.CL_nincinf.value))||parseFloat(a.CL_nincinf.value)<0){alert("Increase should be greater than or equal to 0");a.CL_nincinf.focus();return false}if(isNaN(parseFloat(a.CL_ndecinf.value))||parseFloat(a.CL_ndecinf.value)<0){alert("Decrease should be greater than or equal to 0");a.CL_ndecinf.focus();return false}if(isNaN(parseFloat(a.CL_inf.value))||parseFloat(a.CL_inf.value)<0){alert("Decrease should be greater than or equal to 0");a.CL_inf.focus();return false}return true}function ClearCurrentBond_cby(){document.getElementById("TrCurrentBondYield").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_cby(){CL_fvb=parseFloat(document.breakup.CL_fvb.value);CL_price=parseFloat(document.breakup.CL_price.value);CL_coupon=parseFloat(document.breakup.CL_coupon.value);var a=CL_fvb*CL_coupon/CL_price/100;a=Math.round(a*10000)/100;if(document.all){document.getElementById("CL_yld").value=a}if(document.layers){document.getElementById("CL_yld").value=a}document.getElementById("CL_yld").value=a;document.getElementById("spnclear").style.display="inline"}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_cby(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_cby(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_hid_cby(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function cl_validate_cby(a){if(!a.CL_fvb.value||parseFloat(a.CL_fvb.value)<=0){alert("The face value of bond should be greater than or equal to 0");a.CL_fvb.focus();return false}if(!a.CL_price.value||parseFloat(a.CL_price.value)<=0){alert("The price of bond should be greater than or equal to 0");a.CL_price.focus();return false}document.getElementById("TrCurrentBondYield").style.display="inline";return true}function cl_calculate_effectroi(){var b;var a;a=(parseFloat(document.breakup.ret.value,10)-parseFloat(document.breakup.age.value,10));b=parseFloat(document.breakup.CL_current.value,10);CL_val=b*Math.pow((1+CL_roi),a*12);CL_val+=parseFloat(document.breakup.mon.value,10)*((Math.pow((1+CL_roi),a*12)-1)/CL_roi);if(isNaN(CL_val)){alert("One or more of the numeric fields are wrong. Please cl_check")}}function draw_effectroi(){var d=Array();CL_roi=5/1200;cl_calculate_effectroi();var b=CL_val;var g=1;g=CL_val/15;CL_roi=21/1200;cl_calculate_effectroi();var a=CL_val;var c=400;CL_roi=parseFloat(document.breakup.CL_roi.value,10)/1200;cl_calculate_effectroi();var f=parseFloat(document.breakup.CL_roi.value,10);d[0]=CL_val/a*400;for(i=1;i<14;i++){CL_roi=(8+i)/1200;cl_calculate_effectroi();d[i]=400/a*CL_val}CL_win=window.open("","ash1","scrollbars=yes,toolbar=no,menubar=no,resizable=yes,height=600,width=700","replace");CL_win.document.open();CL_win.focus();var e="ffffff";CL_win.document.write("<body bgcolor=#"+e+">");CL_win.document.write("<table><tr><td valign=bottom><table><tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round(a/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((9/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((8/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((7/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((6/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((5/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((4/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((3/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((2/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("<tr><td height="+40+" valign=top><font face=verdana size=1>Rs "+Math.round((1/10*(a))/1000)+" Thousands</font></td><td bgcolor=#000000 width=2><font face=verdana size=1>&nbsp;</font></td></tr>");CL_win.document.write("</table></td>");if(f<9){CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#00aa00 width=4 height="+Math.round(d[0])+">&nbsp;</td></tr></table></td>")}for(i=1;i<14;i++){if((f-8)!=i){if((f-7)>i&&(f-7)<(i+1)&&i!=1){CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#00aa00 width=4 height="+Math.round(d[0])+">&nbsp;</td></tr></table></td>")}CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#aaaaaa width=2 height="+Math.round(d[i])+">&nbsp;</td></tr></table></td>")}else{CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#00aa00 width=2 height="+Math.round(d[i])+">&nbsp;</td></tr></table></td>");if((f-8)>i&&(f-8)<(i+1)&&i!=1){CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#00aa00 width=4 height="+Math.round(d[0])+">&nbsp;</td></tr></table></td>")}}}if((f>21)){CL_win.document.writeln("<td><font size=1>&nbsp;</font></td><td valign=bottom align=center><table><tr><td valign=bottom bgcolor=#00aa00 width=4 height="+Math.round(d[0])+">&nbsp;</td></tr></table></td>")}CL_win.document.writeln("</tr><tr><td></td><td bgcolor=#000000 height=1 colspan=28></td>");CL_win.document.writeln("</tr><tr><td></td>");if(f<9){CL_win.document.writeln("<td></td>");CL_win.document.writeln("<td><font face=verdana size=1><b>"+f+"%</b></font></td>")}for(i=9;i<22;+i++){if(i!=f){CL_win.document.write("<td></td><td><font face=verdana size=1>"+i+"%</font></td>")}else{CL_win.document.write("<td></td><td><font face=verdana size=1><b>"+i+"%</b></font></td>")}if((f)>i&&(f)<(i+1)&&i!=21){CL_win.document.writeln("<td></td>");CL_win.document.writeln("<td><font face=verdana size=1><b>"+f+"%</b></font></td>")}}if((f>21)){CL_win.document.writeln("<td></td>");CL_win.document.writeln("<td><font face=verdana size=1><b>"+f+"%</b></font></td>")}CL_win.document.write("</tr></table>");CL_win.document.writeln("<table><tr><td align=middle width=100%><font face=arial size=1><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return on investment in %</b></font></td></tr></table>");CL_win.document.writeln('<table><tr><td><a href="#" onClick="javascript:top.window.close()"><font face=arial size=2>Back</font></a></td></tr></table>');CL_win.document.write('<table><tr><td Class="Blacktext"><font face=verdana size=2>With your current savings rate of <b>'+f+"%</b> you should be able to save <b>Rs"+Math.round(d[0]*a/400)+"</b><br></td></tr></table>")}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_effectroi(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_effectroi(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_effectroi(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}var CL_val;var CL_roi;function cl_validate_effectroi(a){if(isNaN(parseFloat(a.age.value))||parseFloat(a.age.value)<=0){alert("Age should be greater than 0");a.age.focus();return false}if(isNaN(parseFloat(a.ret.value))||parseFloat(a.ret.value)<=parseFloat(a.age.value)){alert("Retirement age should be greater than your age");a.ret.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Your current savings should be greater than or equal to 0");a.CL_current.focus();return false}if(isNaN(parseFloat(a.mon.value))||parseFloat(a.mon.value)<0){alert("Monthly savings should be greater than or equal to 0");a.mon.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<=0){alert("Return on your investment should be greater than 0");a.CL_roi.focus();return false}return true}function ClearFdCalculator_fdcalc(){document.getElementById("TrFdCalcultor").style.display="none";document.getElementById("spnclear").style.display="none"}function FDCalc_intcheck(){var a=document.getElementById("interest");if(a.value.length>2){if(a.value>100){alert("Interest Rate Cannot be Greater than 100");a.focus();return false}}}function getfdMatVal_fdcalc(f){var g=f.principal.value;if(isNaN(g)||(parseFloat(g)<=0)){alert("Principal value invalid!!!");f.principal.focus();return(false)}var a=f.interest.value;if(isNaN(a)||(parseFloat(a)<=0)||(parseFloat(a)>100)){alert("Rate of Interest value invalid!!!");f.interest.focus();return(false)}var c=f.tenure.value;if(isNaN(c)||(parseFloat(c)<=0)){alert("Tenure value invalid!!!");f.tenure.focus();return(false)}var b=getSelectedValue_fdcalc(f.tenurePeriod);if(isNaN(b)){alert("Tenure Period value invalid!!!");f.tenurePeriod.focus();return(false)}var e=getSelectedValue_fdcalc(f.frequency);if(isNaN(e)){alert("Frequency value invalid!!!");f.frequency.focus();return(false)}g=parseFloat(g);a=parseFloat(a);c=parseFloat(c);b=parseFloat(b);e=parseFloat(e);var d=calMatVal_fdcalc(g,a,c,b,e);f.fdMatValResult.value=d;formatNumber("fdMatValResult");document.getElementById("TrFdCalcultor").style.display="inline";document.getElementById("spnclear").style.display="inline";return(false)}function getSelectedValue_fdcalc(b){var c=b.selectedIndex;var a=b.options[c].value;return(a)}function calMatVal_fdcalc(b,e,k,c,d){var a=0;var j="";if(d==0){a=b*(1+((e*k)/(c*100)))}else{var h=1+e/(100*d);var g=k*d/c;var f=0;f=Math.pow(h,g);a=b*f}j=j+Math.round(a);return(j)}function validate_flatrate(){if(!document.breakup.tenure.value||parseFloat(document.breakup.tenure.value)<=0){alert("Tenure should be greater than 0");document.breakup.tenure.focus();return false}if(!document.breakup.interest.value||parseFloat(document.breakup.interest.value)<0){alert("Interest should be greater than or equal to 0%");document.breakup.tenure.focus();return false}if(!document.breakup.charge.value||parseFloat(document.breakup.charge.value)<0){alert("Charges should be greater than or equal to 0%");document.breakup.charge.focus();return false}return true}function calculate_flatrate(){var e=100000;var c=document.breakup.tenure.value*12;var l=document.breakup.interest.value/100;var g=parseFloat(document.breakup.charge.value/100);var e=100000;var b=e*(1+c/12*l);var f=(b-e)/e/c;var d=b/c;e=100000*(1-g);var a=1/(1+f);var h=d*((Math.pow(a,c)-1)/(a-1))*a-e;if(h>0){do{f=f+0.00001;a=1/(1+f);h=d*((Math.pow(a,c)-1)/(a-1))*a-e}while(h>0)}else{alert("Please check the input numbers")}var j=(Math.pow(1+f,12)-1)*10000;var k=((f)*12)*10000;k=Math.round(k);j=Math.round(j);k/=100;j/=100;document.breakup.emi.value=k;document.breakup.irr.value=j}var str=window.location.href;var viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function check_flatrate(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function display_flatrate(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible;viewHide=content}function hide_flatrate(){document.getElementById("TrFlatRateCost").style.display="none";document.getElementById("spnclear").style.display="none"}function show_flatrate(){document.getElementById("TrFlatRateCost").style.display="inline";document.getElementById("spnclear").style.display="inline"}function calculate_houseemi(){var a=parseInt(document.breakup.pamount.value);var g=parseFloat(document.breakup.intrate.value,2);var e=parseInt(document.breakup.tenure.value);if(isNaN(parseInt(a))==true){alert("Please enter a valid Principal Amount !");document.breakup.pamount.focus();return false}if(isNaN(parseFloat(g),2)==true){alert("Please enter a valid Interest Rate !");document.breakup.intrate.focus();return false}if(isNaN(parseInt(e))==true){alert("Please enter a Valid Tenure !");document.breakup.tenure.focus();return false}var f=parseInt((document.breakup.tenure.value)*12);var c=document.breakup.intrate.value;if(c>1){c=c/100}c/=12;var d=1;for(var b=0;b<f;b++){d=d*(1+c)}money=""+0.01*Math.round(100*(document.breakup.pamount.value*d*c)/(d-1));dec=money.indexOf(".");if(dec!=-1){dollars=money.substring(0,dec);cents=money.substring(dec+1,dec+3);cents=(cents.length<2)?cents+"0":cents;money=dollars+"."+cents}else{}document.breakup.emiamt.value=money}function hide_houseemi(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none";document.getElementById("tr_emi_exp").style.display="none"}function show_houseemi(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline";formatNumber("emiamt")}function check_houseemi(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function HraClear_hraexeinn(){document.getElementById("showresult").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate1_hraexeinn(){var e=parseFloat(document.breakup.CL_hra.value);var g=parseFloat(document.breakup.CL_rent.value);var a=parseFloat(document.breakup.CL_basic.value);var f=parseFloat(document.breakup.CL_da.value);var b=0.5;var d=0,c=0;if(document.breakup.CL_city[1].checked){b=0.4}d=Math.min((a+f)*b,e);d=Math.min(d,g-0.1*(a+f));d=Math.max(d,0);document.getElementById("showresult").style.display="inline";document.getElementById("spnclear").style.display="inline";document.breakup.hra.value=d;formatNumber("hra")}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_hraexeinn(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_hraexeinn(a){}function CL_hid_hraexeinn(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validateHRA_hraexeinn(a){if(isNaN(parseFloat(a.CL_rent.value))||parseFloat(a.CL_rent.value)<0){alert("Rent should be greater than or equal to 0.");a.CL_rent.focus();return false}if(isNaN(parseFloat(a.CL_basic.value))||parseFloat(a.CL_basic.value)<=0){alert("Basic salary should be greater than or equal to 0");a.CL_basic.focus();return false}if(isNaN(parseFloat(a.CL_da.value))||parseFloat(a.CL_da.value)<0){alert("DA should be greater than or equal to 0.");a.CL_da.focus();return false}if(isNaN(parseFloat(a.CL_hra.value))||parseFloat(a.CL_hra.value)<0){alert("HRA should be greater than or equal to 0.");a.CL_hra.focus();return false}return true}function ClearImplied_impbond(){document.getElementById("TrImplied").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_impbond(){CL_fvb=parseFloat(document.breakup.CL_fvb.value);CL_price=parseFloat(document.breakup.CL_price.value);var e=document.getElementById("ImpliedBondYield1_pur_date").value;var d=e.split("/");var h=document.getElementById("ImpliedBondYield1_mat_date").value;var c=h.split("/");CL_rday1=parseFloat(d[1]);CL_rday=parseFloat(c[1]);CL_rmon1=parseFloat(d[0]);CL_rmon=parseFloat(c[0]);CL_ryr1=parseFloat(d[2]);CL_ryr=parseFloat(c[2]);var f=new Date(CL_ryr1,CL_rmon1,CL_rday1);var j=new Date(CL_ryr,CL_rmon,CL_rday);frm=document.breakup;if(document.getElementById("ImpliedBondYield1_pur_date").value==""){alert("Choose a Purchase date");document.getElementById("ImpliedBondYield1_pur_date").focus();return}if(document.getElementById("ImpliedBondYield1_mat_date").value==""){alert("Choose a Maturity date");document.getElementById("ImpliedBondYield1_mat_date").focus();return}if(f-j>0){alert("Purchase Date should be before Maturity Date");return}var g=(j-f)/365/24/60/60/1000;var b=(CL_fvb-CL_price)/CL_price;var a=Math.pow((1+b),(1/g))-1;a=Math.round(a*10000)/100;if(document.all){document.getElementById("yld").value=a}if(document.layers){document.getElementById("yld").value=a;document.getElementById("spnclear").style.display="inline"}document.getElementById("yld").value=a;document.getElementById("TrImplied").style.display="inline";document.getElementById("spnclear").style.display="inline"}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_impbond(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_impbond(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_hid_impbond(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function cl_validate_impbond(a){if(!a.CL_fvb.value||parseFloat(a.CL_fvb.value)<=0){alert("The face value of bond should be greater than or equal to 0");a.CL_fvb.focus();return false}if(!a.CL_price.value||parseFloat(a.CL_price.value)<=0){alert("The price of bond should be greater than or equal to 0");a.CL_price.focus();return false}return true}function ClearMakingCrore_makecrore(){document.getElementById("MakingCroreResult").style.display="none";document.getElementById("spnclear").style.display="none";document.getElementById("tr_mkcr_exp").style.display="none"}function cl_calculate_makecrore(){CL_age=parseFloat(document.breakup.CL_age.value);CL_cursav1=parseFloat(document.breakup.CL_cursav.value);CL_inc=parseFloat(document.breakup.CL_inc.value);CL_incgrow25=parseFloat(document.breakup.CL_incgrow25.value);CL_incgrow35=parseFloat(document.breakup.CL_incgrow35.value);CL_incgrow50=parseFloat(document.breakup.CL_incgrow50.value);CL_roi25=parseFloat(document.breakup.CL_roi25.value);CL_roi35=parseFloat(document.breakup.CL_roi35.value);CL_roi50=parseFloat(document.breakup.CL_roi50.value);CL_savinc25=parseFloat(document.breakup.CL_savinc25.value);CL_savinc35=parseFloat(document.breakup.CL_savinc35.value);CL_savinc50=parseFloat(document.breakup.CL_savinc50.value);CL_diff=1;CL_ret=CL_age+1;CL_crore=0;CL_r25=1+(CL_roi25/100);CL_r35=1+(CL_roi35/100);CL_r50=1+(CL_roi50/100);CL_igrow25=1+(CL_incgrow25/100);CL_igrow35=1+(CL_incgrow35/100);CL_igrow50=1+(CL_incgrow50/100);CL_savinc25=CL_savinc25/100/12;CL_savinc35=CL_savinc35/100/12;CL_savinc50=CL_savinc50/100/12;CL_monrate25=Math.pow(CL_r25,1/12);CL_monrate35=Math.pow(CL_r35,1/12);CL_monrate50=Math.pow(CL_r50,1/12);if(CL_monrate25!=1){CL_savinc25=CL_savinc25*((Math.pow(CL_monrate25,12)-1)/(CL_monrate25-1))}if(CL_monrate35!=1){CL_savinc35=CL_savinc35*((Math.pow(CL_monrate35,12)-1)/(CL_monrate35-1))}if(CL_monrate50!=1){CL_savinc50=CL_savinc50*((Math.pow(CL_monrate50,12)-1)/(CL_monrate50-1))}CL_cursav=CL_cursav1;do{CL_Ncursav=CL_cursav1;CL_k=CL_igrow25/CL_r25;CL_income=CL_inc;if(CL_age<35){CL_Ninc=CL_income*(Math.pow(CL_r25,Math.min(CL_diff-1,35-CL_age-1)));CL_Ncursav=CL_Ncursav*(Math.pow(CL_r25,Math.min(CL_diff,35-CL_age)));if(CL_k!=1){CL_Ninc=CL_Ninc*((Math.pow(CL_k,Math.min(CL_diff,35-CL_age))-1)/(CL_k-1))}else{CL_Ninc=CL_Ninc*Math.min(CL_diff,35-CL_age)}CL_Ninc=CL_Ninc*CL_savinc25;CL_Ncursav=CL_Ninc+CL_Ncursav;CL_income=CL_income*(Math.pow(CL_igrow25,Math.min(CL_diff-1,35-CL_age-1)));CL_income=CL_income*CL_igrow35}CL_k=CL_igrow35/CL_r35;if(CL_age<50){if(CL_ret>35){CL_Ncursav=CL_Ncursav*Math.pow(CL_r35,Math.min(CL_ret-Math.max(CL_age,35),50-Math.max(CL_age,35)));CL_Ninc=CL_income*Math.pow(CL_r35,Math.min(CL_ret-Math.max(CL_age,35)-1,50-Math.max(CL_age,35)-1));if(CL_k!=1){CL_Ninc=CL_Ninc*((Math.pow(CL_k,Math.min(CL_ret-Math.max(CL_age,35),50-Math.max(CL_age,35)))-1)/(CL_k-1))}else{CL_Ninc=CL_Ninc*Math.min(CL_ret-Math.max(CL_age,35),50-Math.max(CL_age,35))}CL_Ninc=CL_Ninc*CL_savinc35;CL_Ncursav=CL_Ninc+CL_Ncursav;CL_income=CL_income*Math.pow(CL_igrow35,Math.min(CL_ret-Math.max(CL_age,35)-1,50-Math.max(CL_age,35))-1);CL_income=CL_income*CL_igrow50}}CL_k=CL_igrow50/CL_r50;CL_Ninc=CL_income*Math.pow(CL_r50,Math.max(0,CL_ret-Math.max(CL_age,50)-1));CL_Ncursav=CL_Ncursav*(Math.pow(CL_r50,Math.max(0,CL_ret-Math.max(CL_age,50))));if(CL_k!=1){CL_Ninc=CL_Ninc*(Math.pow(CL_k,Math.max(0,CL_ret-Math.max(CL_age,50)))-1)/(CL_k-1)}else{CL_Ninc=CL_Ninc*Math.max(0,CL_ret-Math.max(CL_age,50))}CL_Ninc=CL_Ninc*CL_savinc50;CL_Ncursav=CL_Ninc+CL_Ncursav;CL_ret=CL_ret+1;CL_diff=CL_diff+1;CL_crore=CL_Ncursav}while(CL_crore<10000000);if(document.layers){document.layers.result.document.breakup.cl_emi.value=CL_diff-1}else{document.breakup.cl_emi.value=CL_diff-1}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_makecrore(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_makecrore(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_makecrore(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_makecrore(p){var r,h,e,b,j,k,f;var l,d,o;var m,g,q;var a,n,c;r=parseInt(document.breakup.CL_age.value);h=parseInt(document.breakup.CL_cursav.value);e=parseInt(document.breakup.CL_inc.value);l=parseInt(document.breakup.CL_incgrow25.value);d=parseInt(document.breakup.CL_incgrow35.value);o=parseInt(document.breakup.CL_incgrow50.value);m=parseInt(document.breakup.CL_roi25.value);g=parseInt(document.breakup.CL_roi35.value);q=parseInt(document.breakup.CL_roi50.value);a=parseInt(document.breakup.CL_savinc25.value);n=parseInt(document.breakup.CL_savinc35.value);c=parseInt(document.breakup.CL_savinc50.value);if(l==0&&d==0&&o==0&&m==0&&g==0&&q==0&&a==0&&n==0&&c==0){alert("All fields cannot be zero");document.getElementById("CL_incgrow25").focus();return false}if(isNaN(l)||isNaN(d)||isNaN(o)||isNaN(m)||isNaN(g)||isNaN(q)||isNaN(a)||isNaN(n)||isNaN(c)){alert("Please Enter Valid Data");return false}document.getElementById("MakingCroreResult").style.display="inline";document.getElementById("spnclear").style.display="inline";return true}function ClearMakingMillion_makemill(){document.getElementById("MakingMillionResult").style.display="none";document.getElementById("spnclear").style.display="none";document.getElementById("tr_mkmln_val").style.display="none"}function cl_calculate_makemill(){var e;var b;var d;var c;var a;c=parseFloat(document.breakup.CL_sav.value,10);e=parseFloat(document.breakup.CL_current.value,10);d=parseFloat(document.breakup.CL_roi.value,10)/100;d=Math.pow(1+d,1/12)-1;d=d+1;a=0;if(d<0||c<0){alert("You can not give negetive figures in your Monthly Savings Interest on your savings");return false}if(e>=1000000){alert("Congratulations you are already a millionaire");CL_hid("result");CL_hid("explain");return}b=c*(Math.pow(d,a)-1)/(d-1);do{a+=1;b=c*(Math.pow(d,a)-1)/(d-1)+e*(Math.pow(d,a))}while(b<1000000);if(a/12<1){a=a+" months"}else{a=Math.round(a/12)+" years"}if(document.layers){document.getElementById("emi").value=a}else{document.getElementById("emi").value=a}}function cl_check_makemill(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function cl_validate_makemill(a){if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Savings should be greater than or equal to 0.");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_sav.value))||parseFloat(a.CL_sav.value)<=0){alert("Your savings should be greater than 0");a.CL_sav.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<=0){alert("Return on you savings should be greater than 0");a.CL_roi.focus();return false}document.getElementById("MakingMillionResult").style.display="inline";document.getElementById("spnclear").style.display="inline";return true}function PPFLoanClear_ppfloancalc(){document.getElementById("TrResult").style.display="none";document.getElementById("spnclear").style.display="none"}function dateDiff_ppfloancalc(b,a){date1=new Date(b);date2=new Date(a);diff=new Date();diff.setTime((date1.getTime()-date2.getTime()));timediff=diff.getTime();weeks=Math.floor(timediff/(1000*60*60*24*7));timediff=weeks*(1000*60*60*24*7);days=Math.floor(timediff/(1000*60*60*24));timediff-=days*(1000*60*60*24);hours=Math.floor(timediff/(1000*60*60));timediff-=hours*(1000*60*60);mins=Math.floor(timediff/(1000*60));timediff-=mins*(1000*60);secs=Math.floor(timediff/1000);timediff-=secs*1000;difference=(weeks*7+days)/365;return difference}function checkday_ppfloancalc(){var c=document.getElementById("PPFLoanCalculator1_txt_openingDate").value;if(c!=""){var b=c.split("/");var g=b[1];var a=b[0];var h=b[2]}else{alert("empty date")}var e;if(parseInt(g)<10){g="0"+g}if(parseInt(a)<10){a="0"+a}concDate=a+"/"+g+"/"+h;if(h<1980||h>2050){window.alert("The date should be after 1980 and before 2050");gl_flag="FALSE";return false}if((a==4||a==6||a==9||a==11)&&g==31){if(a==4){e="April"}if(a==6){e="June"}if(a==9){e="September"}if(a==11){e="November"}window.alert("Month "+e+" doesn't have 31 days!");document.breakup.start.value="";document.breakup.end.value="";document.breakup.day.focus();return false}if(a==2){var f=(h%4==0&&(h%100!=0||h%400==0));if(g>29||(g==29&&!f)){window.alert("February "+h+" doesn't have "+g+" days!");document.breakup.start.value="";document.breakup.end.value="";document.breakup.day.focus();return false}}valid(h,a,g)}function checkdate(){var c=document.getElementById("txt_openingDate").value;if(c!=""){var b=c.split("/");var f=b[1];var a=b[0];var g=b[2]}if(parseInt(f)<10){f="0"+f}if(parseInt(a)<10){a="0"+a}concDate=a+"/"+f+"/"+g;if(g<1980||g>2050){window.alert("The date should be after 1980 and before 2050");gl_flag="FALSE";return false}if((!nullvalue(document.breakup.year)||((document.breakup.year.value).length!=4)||(document.breakup.year.value<=0)||isNaN(document.breakup.year.value))){alert("Please enter the year of opening of your PPF account properly");document.breakup.year.focus();return false}if(a=="None"){window.alert("Month needs to have a value");return false}if(isNaN(g)){window.alert("Year can only be numeric");return false}if(g==""){window.alert("Year cannot be left blank");return false}if((a==4||a==6||a==9||a==11)&&f==31){window.alert("Month "+a+" doesn't have 31 days!");return false}if(a==2){var e=(g%4==0&&(g%100!=0||g%400==0));if(f>29||(f==29&&!e)){window.alert("February "+g+" doesn't have "+f+" days!");return false}}valid(g,a,f)}function valid(c,a,b){if(a>3){year=parseInt(c)+2}else{year=parseInt(c)+1}newDate="01-Apr-"+year;document.breakup.start.value=newDate;edDate="31-Mar-"+(year+4);document.breakup.end.value=edDate;x1="04/01/"+year;y1="03/31/"+parseInt(year+4);nardate1=x1;nardate2=y1;nardiff1=dateDiff_ppfloancalc(nardate2,nardate1)}function checkmonth(){var e=document.breakup.day.options[document.breakup.day.selectedIndex].value;var a=document.breakup.mon.options[document.breakup.mon.selectedIndex].value;var f=document.breakup.year.value;var b;if(parseInt(e)<10){e="0"+e}if(parseInt(a)<10){a="0"+a}concDate=a+"/"+e+"/"+f;if(a=="None"){window.alert("Month needs to have a value");return false}if(f==""){document.breakup.year.focus();return false}if((a==4||a==6||a==9||a==11)&&e==31){if(a==4){b="April"}if(a==6){b="June"}if(a==9){b="September"}if(a==11){b="November"}window.alert("Month "+b+" doesn't have 31 days!");document.breakup.start.value="";document.breakup.end.value="";document.breakup.day.focus();return false}if(a==2){var c=(f%4==0&&(f%100!=0||f%400==0));if(e>29||(e==29&&!c)){window.alert("February "+f+" doesn't have "+e+" days!");document.breakup.start.value="";document.breakup.end.value="";document.breakup.day.focus();return false}}valid2(f,a,e)}function valid2(c,a,b){if(isNaN(c)){window.alert("Year can only be numeric");return false}if(a>3){year=parseInt(c)+2}else{year=parseInt(c)+1}newDate="01-Apr-"+year;newDate2="04/01/"+year;document.breakup.start.value=newDate;edDate="31-Mar-"+(year+4);edDate2="03/31/"+parseInt(year+4);document.breakup.end.value=edDate}function checkmonth2(){var e=document.breakup.day1.options[document.breakup.day1.selectedIndex].value;var a=document.breakup.mon1.options[document.breakup.mon1.selectedIndex].value;var b=document.breakup.year1.value;var d;if(parseInt(e)<10){e="0"+e}if(parseInt(a)<10){a="0"+a}if(a=="None"){window.alert("Month needs to have a value");document.breakup.mon1.focus();return false}if((a==4||a==6||a==9||a==11)&&e==31){if(a==4){d="April"}if(a==6){d="June"}if(a==9){d="September"}if(a==11){d="November"}window.alert("Month "+d+" doesn't have 31 days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}if(a==2){var c=(b%4==0&&(b%100!=0||b%400==0));if(e>29||(e==29&&!c)){window.alert("February "+b+" doesn't have "+e+" days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}}}function checkday1_ppfloancalc(){var f=document.getElementById("PPFLoanCalculator1_txt_loanavaildate").value;var b=document.getElementById("PPFLoanCalculator1_txt_openingDate").value;if(b!=""){var n=b.split("/");var h=n[1];var c=n[0];var j=n[2]}else{var h="0";var c="0";var j="0"}if(f!=""){var o=f.split("/");var a=o[1];var l=o[0];var k=o[2]}if(parseInt(h)<10){h="0"+h}if(parseInt(c)<10){c="0"+c}concDate=c+"/"+h+"/"+j;var g;if(parseInt(a)<10){a="0"+a}if(parseInt(l)<10){l="0"+l}concDate1=l+"/"+a+"/"+k;if((l==4||l==6||l==9||l==11)&&a==31){if(l==4){g="April"}if(l==6){g="June"}if(l==9){g="September"}if(l==11){g="November"}window.alert("Month "+g+" doesn't have 31 days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}if(l==2){var e=(k%4==0&&(k%100!=0||k%400==0));if(a>29||(a==29&&!e)){window.alert("February "+k+" doesn't have "+a+" days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}}nardiff2=dateDiff_ppfloancalc(concDate1,nardate1);if((nardiff2>nardiff1)||(nardiff2<0)){alert("The date entered should be in the range "+document.breakup.start.value+" and "+document.breakup.end.value);return false}x11=dateDiff_ppfloancalc(concDate1,concDate);if(x11<=0){window.alert(" Date should be after account opening date");gl_flagi="FALSE";return false}newDte=document.breakup.start.value;edDte=document.breakup.end.value;if(isNaN(k)){window.alert("Year can only be numeric");document.breakup.year1.value="";document.breakup.year1.focus();return false}if(l=="None"){window.alert("Month needs to have a value");document.breakup.mon1.focus();return false}valid1_ppfloancalc(k,l,a)}function checkdate1_ppfloancalc(){var g=document.breakup.day.options[document.breakup.day.selectedIndex].value;var a=document.breakup.mon.options[document.breakup.mon.selectedIndex].value;var h=document.breakup.year.value;if(parseInt(g)<10){g="0"+g}if(parseInt(a)<10){a="0"+a}concDate=a+"/"+g+"/"+h;var f=document.breakup.day1.options[document.breakup.day1.selectedIndex].value;var b=document.breakup.mon1.options[document.breakup.mon1.selectedIndex].value;var c=document.breakup.year1.value;if(parseInt(f)<10){f="0"+f}if(parseInt(b)<10){b="0"+b}concDate1=b+"/"+f+"/"+c;nardiff2=dateDiff_ppfloancalc(concDate1,nardate1);if((nardiff2>nardiff1)||(nardiff2<0)){alert("The date entered should be in the range "+document.breakup.start.value+" and "+document.breakup.end.value);return false;document.breakup.year1.focus();document.breakup.year1.select()}x11=dateDiff_ppfloancalc(concDate1,concDate);if(x11<=0){window.alert(" Date should be after account opening date");gl_flagi="FALSE";return false}newDte=document.breakup.start.value;edDte=document.breakup.end.value;if(isNaN(c)){window.alert("Year can only be numeric");document.breakup.year1.value="";document.breakup.year1.focus();return false}if(b=="None"){window.alert("Month needs to have a value");document.breakup.mon1.focus();return false}if((b==4||b==6||b==9||b==11)&&f==31){window.alert("Month "+b+" doesn't have 31 days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}if(b==2){var e=(c%4==0&&(c%100!=0||c%400==0));if(f>29||(f==29&&!e)){window.alert("February "+c+" doesn't have "+f+" days!");document.breakup.fixdate.value="";document.breakup.day1.focus();return false}}valid1_ppfloancalc(c,b,f)}function valid1_ppfloancalc(b,a,c){if(a>3){year1=parseInt(b)-1;newDate2="31-Mar-"+year1;document.breakup.fixdate.value=newDate2}else{year1=parseInt(b)-2;newDate2="31-Mar-"+year1;document.breakup.fixdate.value=newDate2}}function valAmt_ppfloancalc(){var a=document.breakup.amount.value;if(isNaN(a)||a<="0"){window.alert("Amount can only be positive and numeric");document.breakup.amount.value="";document.breakup.amount.focus();return false}}function nullvalue(b){var a=0;for(i=0;i<b.length;i++){if(b.charAt(i)==" "){a=parseInt(a)+1}}if(a==b.length){return false}else{return true}}function loanperc_ppfloancalc(){formatNumber("LOAN");var j=document.getElementById("PPFLoanCalculator1_txt_loanavaildate").value;var b=document.getElementById("PPFLoanCalculator1_txt_openingDate").value;if(b!=""){var q=b.split("/");var k=q[1];var e=q[0];var n=q[2];var l=q[2]}else{var k="0";var e="0";var n="0"}if(j!=""){var r=j.split("/");var a=r[1];var p=r[0];var o=r[2];var h=r[2]}var c=parseInt(document.breakup.amount.value);if(b==""){alert("Date of opening account Field cannot be empty");document.getElementById("PPFLoanCalculator1_txt_openingDate").focus();return false}if(j==""){alert("Date of avail account Field cannot be empty");document.getElementById("PPFLoanCalculator1_txt_loanavaildate").focus();return false}if((e==4||e==6||e==9||e==11)&&k==31){window.alert("Month "+e+" doesn't have 31 days!");document.breakup.start.value="";document.breakup.end.value="";return false}if(e==2){var g=(n%4==0&&(n%100!=0||n%400==0));if(k>29||(k==29&&!g)){window.alert("February "+n+" doesn't have "+k+" days!");document.breakup.start.value="";document.breakup.end.value="";return false}}if((p==4||p==6||p==9||p==11)&&a==31){window.alert("Month "+p+" doesn't have 31 days!");document.breakup.fixdate.value="";return false}if(p==2){var g=(o%4==0&&(o%100!=0||o%400==0));if(a>29||(a==29&&!g)){window.alert("February "+o+" doesn't have "+a+" days!");document.breakup.fixdate.value="";return false}}if((!nullvalue(l)||((l).length!=4)||(l<=0)||isNaN(l))){alert("Please enter the year of opening of your PPF account");return false}if(parseInt(l)<1980||parseInt(l)>2050){alert("Year Field should be between 1980-2050");document.breakup.year.focus();return false}if((!nullvalue(h)||((h.length!=4))||(h<=0)||isNaN(h))){alert("Please enter the date on which you wish to avail of a loan");alert("vaileee");return false}if(isNaN(c)){alert("Please enter the balance in your PPF account");document.breakup.amount.focus();document.breakup.amount.select();return false}p=parseInt(p);var f="";switch(p){case 1:f="Jan";break;case 2:f="Feb";break;case 3:f="Mar";break;case 4:f="Apr";break;case 5:f="May";break;case 6:f="Jun";break;case 7:f="Jul";break;case 8:f="Aug";break;case 9:f="Sep";break;case 10:f="Oct";break;case 11:f="Nov";break;case 12:f="Dec";break;default:}concDate1=a+"-"+f+"-"+o;document.breakup.fixdate1.value=concDate1;document.breakup.LOAN.value=(0.25*parseInt(document.breakup.amount.value));document.getElementById("TrResult").style.display=show_tab;document.getElementById("spnclear").style.display="inline";formatNumber("LOAN")}function PPFWithDrawClear_ppfwd(){document.getElementById("TrResult").style.display="none";document.getElementById("spnclear").style.display="none"}function dateDiff_ppfwd(b,a){date1=new Date(b);date2=new Date(a);diff=new Date();diff.setTime((date1.getTime()-date2.getTime()));timediff=diff.getTime();weeks=Math.floor(timediff/(1000*60*60*24*7));timediff-=weeks*(1000*60*60*24*7);days=Math.floor(timediff/(1000*60*60*24));timediff-=days*(1000*60*60*24);hours=Math.floor(timediff/(1000*60*60));timediff-=hours*(1000*60*60);mins=Math.floor(timediff/(1000*60));timediff-=mins*(1000*60);secs=Math.floor(timediff/1000);timediff-=secs*1000;difference=(weeks*7+days)/365;return difference}function chkday_ppfwd(){var f=document.getElementById("PPFWithdrawal1_txtLoanAvailDate").value;var b=document.getElementById("PPFWithdrawal1_txtOpenDate").value;if(b!=""){var k=b.split("/");var g=k[1];var c=k[0];var h=k[2]}else{var g="0";var c="0";var h="0"}var a;if(parseInt(g)<10){g="0"+g}if(parseInt(c)<10){c="0"+c}var j=c+"/"+g+"/"+h;if(c=="None"){document.breakup.mon.focus();return false}if((c==4||c==6||c==9||c==11)&&g==31){if(c==4){a="April"}if(c==6){a="June"}if(c==9){a="September"}if(c==11){a="November"}window.alert("Month "+a+" doesn't have 31 days!");document.breakup.withdate.value="";document.breakup.year.value="";document.breakup.year.focus();return false}if(c==2){var e=(h%4==0&&(h%100!=0||h%400==0));if(g>29||(g==29&&!e)){window.alert("February "+h+" doesn't have "+g+" days!");document.breakup.withdate.value="";document.breakup.day.focus();return false}}if(isNaN(h)){window.alert("Year can only be numeric");document.breakup.year.value="";document.breakup.year.focus();return false}if(h=="0"){window.alert("Year cannot be Zero");document.breakup.year.value="";document.breakup.year.focus();return false}if(h==""){document.breakup.year.value="";document.breakup.year.focus();return false}valid_ppfwd(h,c,g)}function checkdate_ppfwd(){var e=document.breakup.day.options[document.breakup.day.selectedIndex].value;var a=document.breakup.mon.options[document.breakup.mon.selectedIndex].value;var f=document.breakup.year.value;if(parseInt(e)<10){e="0"+e}if(parseInt(a)<10){a="0"+a}var c=a+"/"+e+"/"+f;if(f<1980||f>2050){window.alert("The date should be after 1980 and before 2050");document.breakup.year.value="";document.breakup.year.focus();return false}date3=new Date(c);if(a=="None"){window.alert("Month needs to have a value");document.breakup.mon.focus();return false}if(isNaN(f)){window.alert("Year can only be numeric");document.breakup.year.value="";document.breakup.year.focus();return false}if(f=="0"){window.alert("Year cannot be Zero");document.breakup.year.value="";document.breakup.year.focus();return false}if(f==""){window.alert("Year cannot be left blank");document.breakup.year.value="";document.breakup.year.focus();return false}if((a==4||a==6||a==9||a==11)&&e==31){window.alert("Month "+a+" doesn't have 31 days!");document.breakup.year.value="";document.breakup.year.focus();return false}if(a==2){var b=(f%4==0&&(f%100!=0||f%400==0));if(e>29||(e==29&&!b)){window.alert("February "+f+" doesn't have "+e+" days!");return false}}valid_ppfwd(f,a,e)}function valid_ppfwd(c,a,b){if(a>3){year=parseInt(c)+6;newDate="01-Apr-"+year;document.breakup.withdate.value=newDate}else{year=parseInt(c)+5;newDate="01-Apr-"+year;document.breakup.withdate.value=newDate}chkdate="04/01/"+year}function ckmonth_ppfwd(){var c=document.getElementById("txt_openingDate").value;if(c!=""){var b=c.split("/");var h=b[1];var a=b[0];var j=b[2]}else{var h="0";var a="0";var j="0"}var e;if(parseInt(h)<10){h="0"+h}if(parseInt(a)<10){a="0"+a}var g=a+"/"+h+"/"+j;if(a==2){var f=(j%4==0&&(j%100!=0||j%400==0));if(h>29||(h==29&&!f)){window.alert("February "+j+" doesn't have "+h+" days!");document.breakup.withdate.value="";document.breakup.mon.focus();return false}}if(a=="None"){window.alert("Month needs to have a value");document.breakup.mon.focus();return false}if(j==""){document.breakup.year.focus();return false}if((a==4||a==6||a==9||a==11)&&h==31){if(a==4){e="April"}if(a==6){e="June"}if(a==9){e="September"}if(a==11){e="November"}window.alert("Month "+e+" doesn't have 31 days!");document.breakup.withdate.value="";document.breakup.mon.focus();return false}if(a==2){var f=(j%4==0&&(j%100!=0||j%400==0));if(h>29||(h==29&&!f)){window.alert("February "+j+" doesn't have "+h+" days!");document.breakup.withdate.value="";return false}}if(isNaN(j)){window.alert("Year can only be numeric");document.breakup.year.focus();return false}if(j<1980||j>2050){window.alert("The date should be after 1980 and before 2050");document.breakup.year.focus();document.breakup.year.select();gl_flag="FALSE";return false}if(a>3){year=parseInt(j)+6}else{year=parseInt(j)+5}newDate="01-Apr-"+year;document.breakup.withdate.value=newDate}function checkdate1_ppfwd(){var g=document.getElementById("PPFWithdrawal1_txtLoanAvailDate").value;var b=document.getElementById("PPFWithdrawal1_txtOpenDate").value;if(b!=""){var p=b.split("/");var h=p[1];var e=p[0];var j=p[2]}else{var h="0";var e="0";var j="0"}if(parseInt(h)<10){h="0"+h}if(parseInt(e)<10){e="0"+e}var n=e+"/"+h+"/"+j;if(g!=""){var q=g.split("/");var a=q[1];var o=q[0];var l=q[2]}else{var a="0";var o="0";var l="0"}if(parseInt(a)<10){a="0"+a}if(parseInt(o)<10){o="0"+o}var k=o+"/"+a+"/"+l;var c=dateDiff_ppfwd(k,chkdate);if(o=="None"){window.alert("Please enter the month");document.breakup.mon1.focus();return false}if(c<=0){alert("Date needs to be after  "+document.breakup.withdate.value);document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";return false}x=dateDiff_ppfwd(k,n);if(isNaN(l)){window.alert("Year can only be numeric");return false}if(l=="0"){window.alert("Year cannot be Zero");return false}if(l==""){window.alert("Year cannot be left blank");return false}if((o==4||o==6||o==9||o==11)&&a==31){window.alert("Month "+o+" doesn't have 31 days!");document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}if(o==2){var f=(l%4==0&&(l%100!=0||l%400==0));if(a>29||(a==29&&!f)){window.alert("February "+l+" doesn't have "+a+" days!")}document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}if(x<=0){window.alert("The date should be after account opening date");document.breakup.year1.focus();gl_flagi="FALSE";valid1_ppfwd(l,o,a);return false}else{if(x>=16){chkdt_gl_flag="FALSE";document.breakup.submit();return false}}valid1_ppfwd(l,o,a)}function valid1_ppfwd(b,a,c){if(a>3){year1=parseInt(b);newDate2="31-Mar-"+year1;document.breakup.startdate.value=newDate2}else{if(a==1||a==2||a==3){year1=parseInt(b)-1;newDate2="31-Mar-"+year1;document.breakup.startdate.value=newDate2}}newdate3=document.breakup.startdate.value;newdate4=newdate3.substring(6);newdate5=parseInt(newdate4)+3;newdate6="31-Mar-"+newdate5;document.breakup.enddate.value=newdate6}function chkday1_ppfwd(){var g=document.breakup.day.options[document.breakup.day.selectedIndex].value;var c=document.breakup.mon.options[document.breakup.mon.selectedIndex].value;var h=document.breakup.year.value;var f;if(parseInt(g)<10){g="0"+g}if(parseInt(c)<10){c="0"+c}var k=c+"/"+g+"/"+h;var a=document.breakup.day1.options[document.breakup.day1.selectedIndex].value;var n=document.breakup.mon1.options[document.breakup.mon1.selectedIndex].value;var l=document.breakup.year1.value;if(parseInt(a)<10){a="0"+a}if(parseInt(n)<10){n="0"+n}var j=n+"/"+a+"/"+l;var b=dateDiff_ppfwd(j,chkdate);if(n=="None"){document.breakup.mon1.focus();return false}if(b<=0){alert("Date needs to be after  "+document.breakup.withdate.value);document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.year1.focus();return false}if((n==4||n==6||n==9||n==11)&&a==31){if(n==4){f="April"}if(n==6){f="June"}if(n==9){f="September"}if(n==11){f="November"}window.alert("Month "+f+" doesn't have 31 days!");document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}if(n==2){var e=(l%4==0&&(l%100!=0||l%400==0));if(a>29||(a==29&&!e)){window.alert("February "+l+" doesn't have "+a+" days!");document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}}chkval_ppfwd(l,n,a)}function chkmth_ppfwd(){var g=document.breakup.day.options[document.breakup.day.selectedIndex].value;var c=document.breakup.mon.options[document.breakup.mon.selectedIndex].value;var h=document.breakup.year.value;if(parseInt(g)<10){g="0"+g}if(parseInt(c)<10){c="0"+c}var k=c+"/"+g+"/"+h;var a=document.breakup.day1.options[document.breakup.day1.selectedIndex].value;var n=document.breakup.mon1.options[document.breakup.mon1.selectedIndex].value;var l=document.breakup.year1.value;var f;if(parseInt(a)<10){a="0"+a}if(parseInt(n)<10){n="0"+n}var j=n+"/"+a+"/"+l;var b=dateDiff_ppfwd(j,chkdate);if(n=="None"){window.alert("Please enter the month");document.breakup.mon1.focus();return false}if(b<=0){alert("Date needs to be after  "+document.breakup.withdate.value);document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.year1.focus();return false}if((n==4||n==6||n==9||n==11)&&a==31){if(n==4){f="April"}if(n==6){f="June"}if(n==9){f="September"}if(n==4){f="November"}window.alert("Month "+f+" doesn't have 31 days!");document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}if(n==2){var e=(l%4==0&&(l%100!=0||l%400==0));if(a>29||(a==29&&!e)){window.alert("February "+l+" doesn't have "+a+" days!");document.breakup.startdate.value="";document.breakup.balstart.value="";document.breakup.enddate.value="";document.breakup.endbal.value="";document.breakup.mon1.focus();return false}}chkval_ppfwd(l,n,a)}function chkval_ppfwd(b,a,c){if(isNaN(b)){window.alert("Year can only be numeric");document.breakup.year1.focus();return false}if(b==""){document.breakup.year1.focus();return false}if(a>3){year1=parseInt(b);newDate2="31-Mar-"+year1;document.breakup.startdate.value=newDate2}else{if(a==1||a==2){year1=parseInt(b)-1;newDate2="31-Mar-"+year1;document.breakup.startdate.value=newDate2}}newdate3=document.breakup.startdate.value;newdate4=newdate3.substring(6);newdate5=parseInt(newdate4)+3;newdate6="31-Mar-"+newdate5;document.breakup.enddate.value=newdate6}function withamt_ppfwd(){var h=document.getElementById("PPFWithdrawal1_txtLoanAvailDate").value;var b=document.getElementById("PPFWithdrawal1_txtOpenDate").value;if(b!=""){var r=b.split("/");var j=r[1];var c=r[0];var k=r[2]}else{var j="0";var c="0";var k="0"}if(h!=""){var p=h.split("/");var a=p[1];var o=p[1];var q=p[0];var n=p[2];var e=p[0];var g=p[2]}else{var a="0";var q="0";var n="0"}balstart1=document.breakup.balstart.value;endbal1=document.breakup.endbal.value;if(k==""&&(balstart1==""||endbal1=="")){window.alert("Please enter the date of opening your PPF Account");return false}if(b==""){alert("Date of opening account Field cannot be empty");return false}if(document.breakup.withdate.value==""){alert("Date of withdrawal should not be empty");document.breakup.withdate.focus();return false}if(e==""){alert("Please enter the Month of withdrawal");document.breakup.mon1.focus();return false}if(endbal1==""&&isNaN(balstart1)){alert("Please enter a positive numerical value and do not leave any field blank");document.breakup.balstart.value="";document.breakup.balstart.focus();return false}if(balstart1==""&&isNaN(endbal1)){alert("Please enter a positive numerical value and do not leave any field blank");document.breakup.balstart.value="";document.breakup.balstart.focus();return false}if(n==""&&(balstart1==""||endbal1=="")){window.alert("Please enter the date of withdrawal");return false}if(balstart1==""){window.alert("Please enter PPF balance amount");document.breakup.balstart.focus();return false}if(endbal1==""){window.alert("Please enter PPF balance amount");document.breakup.endbal.focus();return false}if(isNaN(balstart1)||balstart1<="0"){window.alert("PPF Amount can only be positive and numeric");document.breakup.balstart.value="";document.breakup.balstart.focus();return false}if(isNaN(endbal1)||endbal1<="0"){window.alert("PPF Amount can only be positive and numeric");document.breakup.endbal.value="";document.breakup.endbal.focus();return false}q=parseInt(q);var f="";switch(q){case 1:f="Jan";break;case 2:f="Feb";break;case 3:f="Mar";break;case 4:f="Apr";break;case 5:f="May";break;case 6:f="Jun";break;case 7:f="Jul";break;case 8:f="Aug";break;case 9:f="Sep";break;case 10:f="Oct";break;case 11:f="Nov";break;case 12:f="Dec";break;default:}var l=a+"-"+f+"-"+n;if(balstart1>endbal1){newamt=endbal1*0.5;document.breakup.amount.value=newamt;dtwith1=l;document.breakup.dtwith.value=dtwith1}else{newamt=balstart1*0.5;document.breakup.amount.value=newamt;dtwith2=l;document.breakup.dtwith.value=dtwith2}document.getElementById("TrResult").style.display=show_tab;document.getElementById("spnclear").style.display="inline";formatNumber("amount")}function formatNumber_pva(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function calculate_pva(){document.getElementById("hid").style.display="inline";var a=document.breakup.annuityamt.value;a=a.replace(/,/,"");var g=document.breakup.Frequency.value;g=g.replace(/,/,"");var f=document.breakup.annruns.value;var c=a*g*f;document.breakup.totalamt.value=c;var b=document.breakup.discounting.value;var e=Math.pow((1+((b)/100)),document.breakup.annstart.value);document.breakup.presentval.value=c/e;var d=document.breakup.annstart.value;document.getElementById("txt_pva_years").value=d;formatNumber_pva("totalamt");formatNumber_pva("annuityamt");formatNumber_pva("Frequency");formatNumber_pva("discounting");formatNumber_pva("annuityamt");formatNumber_pva("presentval")}function hide_pva(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_pva(){document.getElementById("hid").style.display=show_tab;document.getElementById("spnclear").style.display="inline"}function futurevalue_pva(a,c,b,f,e){var d=a/100;var g;g=(b*(1+d*e)*(1-Math.pow(1+d,c))/d)-f*Math.pow(1+d,c);return(g)}function formatNumber_pvsamt(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function calculate_pvsamt(){var b=document.breakup.fvvalue.value;b=b.replace(/,/,"");var a=document.breakup.tenure.value;var c=document.breakup.rate.value;c=c.replace(/,/,"");document.breakup.PresentValue.value=Math.round(b/Math.pow(1+c/100,a));formatNumber_pvsamt("fvvalue");formatNumber_pvsamt("rate");formatNumber_pvsamt("PresentValue")}function hide_pvsamt(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_pvsamt(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline"}function formatNumber_pvirr(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function replaceAll_pvirr(c,b){for(i=0;i<b.length;i++){var a=c.indexOf(b[i][0]);while(a>-1){c=c.replace(b[i][0],b[i][1]);a=c.indexOf(b[i][0])}}return c}function hide_pvirr(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_pvirr(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline"}function calculate_pvirr(){var texttype;if(navigator.appName=="Microsoft Internet Explorer"){texttype="innerText"}else{texttype="textContent"}if(document.breakup.firstyear.value==""){document.breakup.firstyear.value=0}if(document.breakup.secondyear.value==""){document.breakup.secondyear.value=0}if(document.breakup.thirdyear.value==""){document.breakup.thirdyear.value=0}if(document.breakup.fourthyear.value==""){document.breakup.fourthyear.value=0}if(document.breakup.fifthyear.value==""){document.breakup.fifthyear.value=0}if(document.breakup.sixthyear.value==""){document.breakup.sixthyear.value=0}if(document.breakup.seventhyear.value==""){document.breakup.seventhyear.value=0}if(document.breakup.eigthyear.value==""){document.breakup.eigthyear.value=0}if(document.breakup.ninthyear.value==""){document.breakup.ninthyear.value=0}if(document.breakup.tenthyear.value==""){document.breakup.tenthyear.value=0}if(document.breakup.eleventhyear.value==""){document.breakup.eleventhyear.value=0}if(document.breakup.twelthyear.value==""){document.breakup.twelthyear.value=0}if(document.breakup.thirteenthyear.value==""){document.breakup.thirteenthyear.value=0}if(document.breakup.fourteenthyear.value==""){document.breakup.fourteenthyear.value=0}if(document.breakup.fifteenthyear.value==""){document.breakup.fifteenthyear.value=0}var t1=document.breakup.firstyear.value;t1=replaceAll_pvirr(t1,[[",",""]]);var t2=document.breakup.secondyear.value;t2=replaceAll_pvirr(t2,[[",",""]]);var t3=document.breakup.thirdyear.value;t3=replaceAll_pvirr(t3,[[",",""]]);var t4=document.breakup.fourthyear.value;t4=replaceAll_pvirr(t4,[[",",""]]);var t5=document.breakup.fifthyear.value;t5=replaceAll_pvirr(t5,[[",",""]]);var t6=document.breakup.sixthyear.value;t6=replaceAll_pvirr(t6,[[",",""]]);var t7=document.breakup.seventhyear.value;t7=replaceAll_pvirr(t7,[[",",""]]);var t8=document.breakup.eigthyear.value;t8=replaceAll_pvirr(t8,[[",",""]]);var t9=document.breakup.ninthyear.value;t9=replaceAll_pvirr(t9,[[",",""]]);var t10=document.breakup.tenthyear.value;t10=replaceAll_pvirr(t10,[[",",""]]);var t11=document.breakup.eleventhyear.value;t11=replaceAll_pvirr(t11,[[",",""]]);var t12=document.breakup.twelthyear.value;t12=replaceAll_pvirr(t12,[[",",""]]);var t13=document.breakup.thirteenthyear.value;t13=replaceAll_pvirr(t13,[[",",""]]);var t14=document.breakup.fourteenthyear.value;t14=replaceAll_pvirr(t14,[[",",""]]);var t15=document.breakup.fifteenthyear.value;t15=replaceAll_pvirr(t15,[[",",""]]);document.breakup.Total.value=parseFloat(t1)+parseFloat(t2)+parseFloat(t3)+parseFloat(t4)+parseFloat(t5)+parseFloat(t6)+parseFloat(t7)+parseFloat(t8)+parseFloat(t9)+parseFloat(t10)+parseFloat(t11)+parseFloat(t12)+parseFloat(t13)+parseFloat(t14)+parseFloat(t15);var value1=t1/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("one").'+texttype));var value2=t2/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("two").'+texttype));var value3=t3/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("three").'+texttype));var value4=t4/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("four").'+texttype));var value5=t5/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("five").'+texttype));var value6=t6/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("six").'+texttype));var value7=t7/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("seven").'+texttype));var value8=t8/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("eight").'+texttype));var value9=t9/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("nine").'+texttype));var value10=t10/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("ten").'+texttype));var value11=t11/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("eleven").'+texttype));var value12=t12/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("twelve").'+texttype));var value13=t13/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("thirteen").'+texttype));var value14=t14/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("fourteen").'+texttype));var value15=t15/Math.pow(1+document.breakup.Discounting.value/100,eval('document.getElementById("fifteen").'+texttype));document.breakup.Present.value=Math.round(parseFloat(value1)+parseFloat(value2)+parseFloat(value3)+parseFloat(value4)+parseFloat(value5)+parseFloat(value6)+parseFloat(value7)+parseFloat(value8)+parseFloat(value9)+parseFloat(value10)+parseFloat(value11)+parseFloat(value12)+parseFloat(value13)+parseFloat(value14)+parseFloat(value15));formatNumber_pvirr("firstyear");formatNumber_pvirr("secondyear");formatNumber_pvirr("thirdyear");formatNumber_pvirr("fourthyear");formatNumber_pvirr("fifthyear");formatNumber_pvirr("sixthyear");formatNumber_pvirr("seventhyear");formatNumber_pvirr("eigthyear");formatNumber_pvirr("ninthyear");formatNumber_pvirr("tenthyear");formatNumber_pvirr("eleventhyear");formatNumber_pvirr("twelthyear");formatNumber_pvirr("thirteenthyear");formatNumber_pvirr("fourteenthyear");formatNumber_pvirr("fifteenthyear");formatNumber_pvirr("Discounting");formatNumber_pvirr("Total");formatNumber_pvirr("Present")}function ClearReturnOnSavings_retsave(){document.getElementById("TrTaxInflation").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_retsave(){var g=document.breakup.CL_amt.value;var f=parseFloat(document.breakup.CL_t2.value);var b=parseFloat(document.breakup.CL_roi2.value)/100;var e=parseFloat(document.breakup.CL_comp.options[document.breakup.CL_comp.options.selectedIndex].value);if(e>0){var d=Math.pow(1+b/e,e);var c=g*b/e}else{var d=Math.pow(1+f*b,1/f);var c=g*f*b}var a;if(e<0){a="simple"}if(e==1){a="annual"}if(e==2){a="semi annual"}if(e==4){a="quarterly"}if(e==12){a="monthly"}document.getElementById("CL_tframe").value=a;document.getElementById("CL_inc").value=Math.round(c);document.getElementById("CL_irate").value=Math.round((d-1)*10000)/100;document.getElementById("TrTaxInflation").style.display="inline";document.getElementById("spnclear").style.display="inline";formatNumber("CL_inc")}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_retsave(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_retsave(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_retsave(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_retsave(a){if(isNaN(parseFloat(a.CL_amt.value))||parseFloat(a.CL_amt.value)<=0){alert("Invested amount should be greater than 0");a.CL_amt.focus();return false}if(isNaN(parseFloat(a.CL_t2.value))||parseFloat(a.CL_t2.value)<=0){alert("The period should be greater than 0.");a.CL_t2.focus();return false}if(isNaN(parseFloat(a.CL_roi2.value))||parseFloat(a.CL_roi2.value)<=0){alert("Rate of interest should be greater than 0.");a.CL_roi2.focus();return false}return true}function ClearSavingEnough_saveeno(){document.getElementById("SavingEnoughResult").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_saveeno(){var l;var h;var e;var f;var d;var b;var j;var c;var k;var g;var a;k=parseFloat(document.breakup.CL_age.value,10);g=parseFloat(document.breakup.CL_ret.value,10);a=parseFloat(document.breakup.CL_retamt.value,10);e=g-k;if(e<0){alert("Retirement age should be more than your current age");return false}l=parseFloat(document.breakup.CL_current.value,10);h=Math.pow(1+parseFloat(document.breakup.CL_roi.value,10)/100,1/12)-1;CL_roi1=parseFloat(document.breakup.CL_roi.value,10)/100;b=parseFloat(document.breakup.CL_inf.value)/100;d=a*Math.pow(1+b,e);f=d-l*Math.pow((1+CL_roi1),e);CL_msav=parseFloat(document.breakup.CL_msav.value);j=CL_msav*(Math.pow(1+h,e*12)-1)/h;if(isNaN(Math.round((f*h)/(Math.pow((1+h),e*12)-1)))){alert("One or more of the numeric fields is wrong. Please Check")}else{if(document.layers){document.getElementById("emi").value=Math.round((f*h)/(Math.pow((1+h),e*12)-1));document.getElementById("CL_fv").value=Math.round(d);document.getElementById("CL_current_answer").value=Math.round(j+l*Math.pow((1+CL_roi1),e))}else{document.getElementById("emi").value=Math.round((f*h)/(Math.pow((1+h),e*12)-1));document.getElementById("CL_fv").value=Math.round(d);document.getElementById("CL_current_answer").value=Math.round(j+l*Math.pow((1+CL_roi1),e))}formatNumber("emi");formatNumber("CL_fv");formatNumber("CL_current_answer");document.getElementById("SavingEnoughResult").style.display="inline";document.getElementById("spnclear").style.display="inline"}}function cl_check_saveeno(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function cl_validate_saveeno(a){if(isNaN(parseFloat(a.CL_age.value))||parseFloat(a.CL_age.value)<=0){alert("Your age should be greater than 0 years");a.CL_age.focus();return false}if(isNaN(parseFloat(a.CL_ret.value))||parseFloat(a.CL_ret.value)<=parseFloat(a.CL_age.value)){alert("Retirement age should be greater than your current age");a.CL_ret.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(parseFloat(a.CL_current.value))<0){alert("Your current savings should be greater than 0");a.current.focus();return false}if(isNaN(parseFloat(a.CL_retamt.value))||parseFloat(parseFloat(a.CL_retamt.value))<0){alert("Your retirement amount should be greater than or equal to 0");a.CL_retamt.focus();return false}if(isNaN(parseFloat(a.CL_msav.value))||parseFloat(parseFloat(a.CL_msav.value))<0){alert("Monthly savings should be greater than or equal to 0");a.CL_msav.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(parseFloat(a.CL_roi.value))<0){alert("Rate of return on your investment should be greater than 0");a.CL_roi.focus();return false}if(isNaN(parseFloat(a.CL_inf.value))||parseFloat(parseFloat(a.CL_inf.value))<0){alert("Rate of inflation should be greater than 0");a.CL_inf.focus();return false}return true}function ClearSavingEnough_saveenouinner(){document.getElementById("TrSavingEnough").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_saveenouinner(){var l;var h;var e;var f;var d;var b;var j;var c;var k;var g;var a;k=parseFloat(document.breakup.CL_age.value,10);g=parseFloat(document.breakup.CL_ret.value,10);a=parseFloat(document.breakup.CL_retamt.value,10);e=g-k;if(e<0){alert("Retirement age should be more than your current age");return false}l=parseFloat(document.breakup.CL_current.value,10);h=Math.pow(1+parseFloat(document.breakup.CL_roi.value,10)/100,1/12)-1;CL_roi1=parseFloat(document.breakup.CL_roi.value,10)/100;b=parseFloat(document.breakup.CL_inf.value)/100;d=a*Math.pow(1+b,e);f=d-l*Math.pow((1+CL_roi1),e);CL_msav=parseFloat(document.breakup.CL_msav.value);j=CL_msav*(Math.pow(1+h,e*12)-1)/h;if(isNaN(Math.round((f*h)/(Math.pow((1+h),e*12)-1)))){alert("One or more of the numeric fields is wrong. Please Check")}else{if(document.layers){document.getElementById("emi").value=Math.round((f*h)/(Math.pow((1+h),e*12)-1));document.getElementById("CL_fv").value=Math.round(d);document.getElementById("CL_current_value").value=Math.round(j+l*Math.pow((1+CL_roi1),e))}else{document.getElementById("emi").value=Math.round((f*h)/(Math.pow((1+h),e*12)-1));document.getElementById("CL_fv").value=Math.round(d);document.getElementById("CL_current_value").value=Math.round(j+l*Math.pow((1+CL_roi1),e))}document.getElementById("spnclear").style.display="inline";document.getElementById("emi").value=Math.round((f*h)/(Math.pow((1+h),e*12)-1));document.getElementById("CL_fv").value=Math.round(d);document.getElementById("CL_current_value").value=Math.round(j+l*Math.pow((1+CL_roi1),e));formatNumber("emi");formatNumber("CL_fv");formatNumber("CL_current_value")}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_saveenouinner(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_saveenouinner(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_saveenouinner(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_saveenouinner(a){if(isNaN(parseFloat(a.CL_age.value))||parseFloat(a.CL_age.value)<=0){alert("Your age should be greater than 0 years");a.CL_age.focus();return false}if(isNaN(parseFloat(a.CL_ret.value))||parseFloat(a.CL_ret.value)<=parseFloat(a.CL_age.value)){alert("Retirement age should be greater than your current age");a.CL_ret.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(parseFloat(a.CL_current.value))<0){alert("Your current savings should be greater than 0");a.current.focus();return false}if(isNaN(parseFloat(a.CL_retamt.value))||parseFloat(parseFloat(a.CL_retamt.value))<0){alert("Your retirement amount should be greater than or equal to 0");a.CL_retamt.focus();return false}if(isNaN(parseFloat(a.CL_msav.value))||parseFloat(parseFloat(a.CL_msav.value))<0){alert("Monthly savings should be greater than or equal to 0");a.CL_msav.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(parseFloat(a.CL_roi.value))<0){alert("Rate of return on your investment should be greater than 0");a.CL_roi.focus();return false}if(isNaN(parseFloat(a.CL_inf.value))||parseFloat(parseFloat(a.CL_inf.value))<0){alert("Rate of inflation should be greater than 0");a.CL_inf.focus();return false}document.getElementById("TrSavingEnough").style.display="inline";return true}function ClearSavingMillion_savemill(){document.getElementById("SavingMillionResult").style.display="none";document.getElementById("spnclear").style.display="none";document.getElementById("tr_mln_val").style.display="none"}function cl_calculate_savemill(){var d;var b;var a;var c;a=parseFloat(document.breakup.CL_tenure.value,10);d=parseFloat(document.breakup.CL_current.value,10);b=Math.pow(1+parseFloat(document.breakup.CL_roi.value,10)/100,1/12)-1;if(d>=1000000){alert("Congratulations you are already a millionaire");CL_hid_savemill("result");CL_hid_savemill("explain");return}c=1000000-d*Math.pow((1+b),a*12);if(isNaN(Math.round((c*b)/(Math.pow((1+b),a*12)-1)))){alert("One or more of the numeric fields is wrong. Please Check")}else{document.getElementById("SavingMillionResult").style.display="inline";if(document.layers){document.getElementById("cl_emi").value=Math.round((c*b)/(Math.pow((1+b),a*12)-1))}else{document.getElementById("CL_emi").value=Math.round((c*b)/(Math.pow((1+b),a*12)-1))}formatNumber("cl_emi");document.getElementById("spnclear").style.display="inline"}}function cl_check_savemill(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_savemill(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_savemill(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_savemill(a){if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Your savings should be greater than or equal to 0.");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_tenure.value))||parseFloat(a.CL_tenure.value)<=0){alert("The period should be greater than 0.");a.CL_tenure.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<=0){alert("Rate of interest should be greater than 0.");a.CL_roi.focus();return false}return true}function ClearSavingsWorth_saveworth(){document.getElementById("TrSavingsWorth").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_saveworth(){var c;var b;var a;var d;a=parseFloat(document.breakup.CL_time.value,10);c=parseFloat(document.breakup.CL_current.value,10);b=parseFloat(document.breakup.CL_roi.value,10)/100;CL_tax=parseFloat(document.breakup.CL_tax.value,10)/100;b=b*(1-CL_tax);CL_mon=parseFloat(document.breakup.CL_mon.value,10);if(b==0){b=1e-8}d=c*(Math.pow((1+b),a));d+=parseFloat(document.breakup.CL_mon.value,10)*((Math.pow((1+b),a)-1)/b);if(isNaN(d)){alert("One or more of the numeric fields are wrong. Please Check")}else{document.getElementById("CL_emi").value=Math.round(d);formatNumber("CL_emi")}}var CL_viewHide;if(document.layers){}else{if(document.all){}}function cl_check_saveworth(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_saveworth(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_hid_saveworth(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function CL_vlidate_saveworth(a){if(isNaN(parseFloat(a.CL_time.value))||parseFloat(a.CL_time.value)<=0){alert("Investment horizon should be greater than 0");a.CL_time.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Current savings should be greater than or equal to 0");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_tax.value))||parseFloat(a.CL_tax.value)<0){alert("Monthly savings should be greater than or equal to 0");a.CL_tax.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<0){alert("Return on your investments should be greater than or equal to 0");a.CL_roi.focus();return false}document.getElementById("TrSavingsWorth").style.display="inline";document.getElementById("spnclear").style.display="inline";return true}function formatNumber_sipdelay(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function futurevalue_sipdelay(a,c,b,f,e){var d=a/100;var g;g=(b*(1+d*e)*(1-Math.pow(1+d,c))/d)-f*Math.pow(1+d,c);return(g)}function hide_sipdelay(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_sipdelay(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline"}function calculate_sipdelay(){document.getElementById("hid").style.display="inline";var b=(document.breakup.moninst.value);b=b.replace(/,/,"");var d=(document.breakup.tenure.value);d=d.replace(/,/,"");var e=(document.breakup.rateofretun.value);e=e.replace(/,/,"");var c=(document.breakup.delay.value);c=c.replace(/,/,"");var a=(document.breakup.tenure.value*12);var g=parseFloat(e/12);var f=parseFloat(-futurevalue(g,a,b,0,1));document.breakup.invvaluetoday.value=Math.round(f);D=(a-c);E=(-futurevalue(g,D,b,0,1));document.breakup.invvaluedelay.value=Math.round(E);document.breakup.delaycost.value=Math.round(f-E);formatNumber("moninst");formatNumber("rateofretun");formatNumber("invvaluetoday");formatNumber("invvaluedelay");formatNumber("delaycost")}var texttype;if(navigator.appName=="Microsoft Internet Explorer"){texttype="innerText"}else{texttype="textContent"}function formatNumber_sipneedcalc(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function replaceAll_sipneedcalc(c,b){for(i=0;i<b.length;i++){var a=c.indexOf(b[i][0]);while(a>-1){c=c.replace(b[i][0],b[i][1]);a=c.indexOf(b[i][0])}}return c}function Comma_sipneedcalc(c){c=""+c;if(c.length>3){var b=c.length%3;var a=(b>0?(c.substring(0,b)):"");for(i=0;i<Math.floor(c.length/3);i++){if((b==0)&&(i==0)){a+=c.substring(b+3*i,b+3*i+3)}else{a+=","+c.substring(b+3*i,b+3*i+3)}}return(a)}else{return c}}function call_sipneedcalc(){var texttype;if(navigator.appName=="Microsoft Internet Explorer"){texttype="innerText"}else{texttype="textContent"}var sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t1").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t1").innerHTML=sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t2").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t2").innerHTML=sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t3").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t3").innerHTML=sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t4").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t4").innerHTML=sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t5").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t5").innerHTML=sip;sip=calculate1_sipneedcalc(eval('document.getElementById("t6").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("r2t6").innerHTML=sip}function call2_sipneedcalc(){var sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t1").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t1").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t2").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t2").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t3").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t3").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t4").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t4").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t5").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t5").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t6").'+texttype),eval('document.getElementById("tab2r1t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r1t6").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t1").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t1").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t2").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t2").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t3").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t3").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t4").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t4").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t5").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t5").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t6").'+texttype),eval('document.getElementById("tab2r2t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r2t6").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t1").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t1").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t2").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t2").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t3").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t3").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t4").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t4").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t5").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t5").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t6").'+texttype),eval('document.getElementById("tab2r3t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r3t6").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t1").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t1").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t2").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t2").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t3").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t3").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t4").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t4").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t5").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t5").innerHTML=sip;sip=calculate2_sipneedcalc(eval('document.getElementById("tab2t6").'+texttype),eval('document.getElementById("tab2r4t0").'+texttype));sip=Math.round(sip);sip=Comma_sipneedcalc(sip);document.getElementById("tab2r4t6").innerHTML=sip}function calculate2_sipneedcalc(d,c){var f=document.breakup.fvamt.value;f=replaceAll_sipneedcalc(f,[[",",""]]);var b=(1+(c/100))*(((Math.pow(1+(c/100),d)-1)))/((1+(c/100))-1);var h=(futurevalue_sipneedcalc(c))-100;var g=(1+(h/100))*(((Math.pow(1+(h/100),12*d)-1)))/((1+(h/100))-1);var e=parseFloat(f)/b;var a=f/g;return(a)}function futurevalue_sipneedcalc(a){var e=a/100;var c=1/12;var b=0;var f=-100;var d=1;var g;g=(b*(1+e*d)*(1-Math.pow(1+e,c))/e)-f*Math.pow(1+e,c);return(g)}function calculate1_sipneedcalc(f){var e=document.breakup.fvamt.value;e=replaceAll_sipneedcalc(e,[[",",""]]);var c=document.breakup.tenure.value;var b=(1+(f/100))*(((Math.pow(1+(f/100),c)-1)))/((1+(f/100))-1);var h=(futurevalue_sipneedcalc(f))-100;var g=(1+(h/100))*(((Math.pow(1+(h/100),12*c)-1)))/((1+(h/100))-1);var d=e/b;var a=e/g;return a}function calculate_sipneedcalc(){var f=document.breakup.fvamt.value;f=replaceAll_sipneedcalc(f,[[",",""]]);var d=document.breakup.tenure.value;var c=document.breakup.returns.value;c=replaceAll_sipneedcalc(c,[[",",""]]);var b=(1+(c/100))*(((Math.pow(1+(c/100),d)-1)))/((1+(c/100))-1);var h=(futurevalue_sipneedcalc(c))-100;var g=(1+(h/100))*(((Math.pow(1+(h/100),12*d)-1)))/((1+(h/100))-1);var e=f/b;var a=f/g;document.breakup.sip.value=Math.round(a);formatNumber("sip")}function hide_sipneedcalc(){document.getElementById("hid").style.display="none";document.getElementById("hid1").style.display="none";document.getElementById("hid2").style.display="none";document.getElementById("spnclear").style.display="none"}function show_sipneedcalc(){document.getElementById("hid").style.display="inline";document.getElementById("hid1").style.display="inline";document.getElementById("hid2").style.display="inline";document.getElementById("spnclear").style.display="inline"}function formatNumber_sipneedin(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function futurevalue_sipneedin(a,c,b,f,e){var d=a/100;var g;g=(b*(1+d*e)*(1-Math.pow(1+d,c))/d)-f*Math.pow(1+d,c);return(g)}function cl_calculate_sipneedin(){var n=document.getElementById("amtpermonth");var j=document.getElementById("tenure");var m=document.getElementById("returns");if(!n.value||parseFloat(n.value)<=0){alert("Please enter monthly investment amount");n.focus();return false}else{if(!j.value||parseFloat(j.value)<=0){alert("Please enter Investment Periods");j.focus();return false}else{if(!m.value||parseFloat(m.value)<=0){alert("Please enter valid returns percentage");m.focus();return false}else{if(parseFloat(m.value)>100){alert("Please enter valid returns percentage");m.focus();return false}else{var g=(document.breakup.amtpermonth.value);g=g.replace(/,/,"");var l=(document.breakup.tenure.value);var b=(document.breakup.returns.value);b=b.replace(/,/,"");var e=(l*12);var d=parseFloat(b/12);var c=parseFloat(-futurevalue(d,e,g,0,1));document.breakup.emi.value=Math.round(c);var a=(l*12*g);document.breakup.CL_fv.value=a;var h=futurevalue(b,1/12,0,-100,1)-100;var k=Math.round(futurevalue(h,l*12,g,0,1));var f=-(k/a)+"";document.breakup.CL_current.value=f.substring(0,4);formatNumber_sipneedin("amtpermonth");formatNumber_sipneedin("returns");formatNumber_sipneedin("emi");formatNumber_sipneedin("CL_fv");formatNumber_sipneedin("CL_current");show_sipneedin()}}}}}function hide_sipneedin(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_sipneedin(){document.getElementById("hid").style.display=show_tab;document.getElementById("spnclear").style.display="inline"}function formatNumber_sippvfv(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function futurevalue_sippvfv(a,c,b,f,e){var d=a/100;var g;g=(b*(1+d*e)*(1-Math.pow(1+d,c))/d)-f*Math.pow(1+d,c);return(g)}function calculate_sippvfv(){document.getElementById("hid").style.display="inline";var a=(document.breakup.moninvest.value);a=a.replace(/,/,"");var g=(document.breakup.tenure.value);var f=(document.breakup.returns.value);f=f.replace(/,/,"");var e=(document.breakup.discounting.value);e=e.replace(/,/,"");var d=(g*12);var b=parseFloat(f/12);var c=(-futurevalue(b,d,a,0,1));document.breakup.futureval.value=Math.round(c);document.breakup.pval.value=Math.round(parseFloat(document.breakup.futureval.value)/Math.pow(1+e/100,g));formatNumber("moninvest");formatNumber("returns");formatNumber("discounting");formatNumber("futureval");formatNumber("pval")}function hide_sippvfv(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_sippvfv(){document.getElementById("hid").style.display=show_tab;document.getElementById("spnclear").style.display="inline"}function formatNumber_siptab(c){var b=document.getElementById(c);var a=new NumberFormat();a.setInputDecimal(".");a.setNumber(b.value);a.setPlaces("2",false);a.setCurrencyValue("");a.setCurrency(true);a.setCurrencyPosition(a.LEFT_OUTSIDE);a.setNegativeFormat(a.LEFT_DASH);a.setNegativeRed(false);a.setSeparators(true,",",",");b.value=a.toFormatted()}function Comma_siptab(c){c=""+c;if(c.length>3){var b=c.length%3;var a=(b>0?(c.substring(0,b)):"");for(i=0;i<Math.floor(c.length/3);i++){if((b==0)&&(i==0)){a+=c.substring(b+3*i,b+3*i+3)}else{a+=","+c.substring(b+3*i,b+3*i+3)}}return(a)}else{return c}}function cl_call_siptab(){var texttype;var emi;var sipvalue=document.breakup.sipamt.value;if(navigator.appName=="Microsoft Internet Explorer"){texttype="innerText"}else{texttype="textContent"}sipvalue=sipvalue.replace(/,/,"");emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t1").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t1").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t2").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t2").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t3").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t3").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t4").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t4").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t5").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t5").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t6").'+texttype),eval('document.getElementById("r1").'+texttype));emi=Comma_siptab(emi);document.getElementById("r1t6").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t1").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t1").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t2").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t2").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t3").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t3").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t4").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t4").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t5").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t5").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t6").'+texttype),eval('document.getElementById("r2").'+texttype));emi=Comma_siptab(emi);document.getElementById("r2t6").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t1").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t1").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t2").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t2").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t3").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t3").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t4").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t4").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t5").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t5").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t6").'+texttype),eval('document.getElementById("r3").'+texttype));emi=Comma_siptab(emi);document.getElementById("r3t6").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t1").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t1").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t2").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t2").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t3").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t3").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t4").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t4").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t5").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t5").innerHTML=emi;emi=cl_calculate_siptab(sipvalue,eval('document.getElementById("t6").'+texttype),eval('document.getElementById("r4").'+texttype));emi=Comma_siptab(emi);document.getElementById("r4t6").innerHTML=emi;formatNumber_siptab("sipamt");show_siptab()}function cl_calculate_siptab(b,e,a){var h=a/100;var f=1/12;var m=0;var l=-100;var j=1;var c;c=(m*(1+h*j)*(1-Math.pow(1+h,f))/h)-l*Math.pow(1+h,f);c=c-100;var n=c/100;var g=e*12;var k=b;l=0;j=1;var d=Math.round(k*(1+n*j)*(1-Math.pow(1+n,g))/n-l*Math.pow(1+n,g));return(-d)}function hide_siptab(){document.getElementById("hid").style.display="none";document.getElementById("spnclear").style.display="none"}function show_siptab(){document.getElementById("hid").style.display="inline";document.getElementById("spnclear").style.display="inline"}function ClearSpendSave_spendsave(){document.getElementById("TrSpendSaveResult").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_spendsave(){var b;var a;var d=0;if(document.breakup.t1.value&&!isNaN(parseFloat(document.breakup.t1.value))){d+=parseFloat(document.breakup.t1.value)}if(document.breakup.t2.value&&!isNaN(parseFloat(document.breakup.t2.value))){d+=parseFloat(document.breakup.t2.value)}if(document.breakup.t3.value&&!isNaN(parseFloat(document.breakup.t3.value))){d+=parseFloat(document.breakup.t3.value)}if(document.breakup.t4.value&&!isNaN(parseFloat(document.breakup.t4.value))){d+=parseFloat(document.breakup.t4.value)}if(document.breakup.t5.value&&!isNaN(parseFloat(document.breakup.t5.value))){d+=parseFloat(document.breakup.t5.value)}if(document.breakup.t6.value&&!isNaN(parseFloat(document.breakup.t6.value))){d+=parseFloat(document.breakup.t6.value)}if(document.breakup.t7.value&&!isNaN(parseFloat(document.breakup.t7.value))){d+=parseFloat(document.breakup.t7.value)}if(!document.breakup.CL_roi.value||isNaN(document.breakup.CL_roi.value)){alert("Enter your annual return");document.breakup.CL_roi.focus();return false}if(!document.breakup.retage.value||isNaN(document.breakup.retage.value)){alert("Enter your retirement age");document.breakup.retage.focus();return false}if(!document.breakup.age.value||isNaN(document.breakup.age.value)){alert("Enter your age");document.breakup.age.focus();return false}if(document.breakup.age.value>document.breakup.retage.value){alert("It appears you have already retired");return false}var c=parseFloat(document.breakup.retage.value)-parseFloat(document.breakup.age.value);b=Math.pow(1+parseFloat(document.breakup.CL_roi.value,10)/100,1/12)-1;b=b+1;d=Math.round(d*(Math.pow(b,c*12)-1)/(b-1));if(document.layers){document.getElementById("emi").value=Math.round(d)}else{document.getElementById("emi").value=Math.round(d)}formatNumber("emi")}function cl_check_spendsave(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus();return false}return true}}function CL_display_spendsave(a){if(document.layers){}else{if(document.all){}}}function CL_hid_spendsave(a){if(document.layers){}else{if(document.all){}}}function cl_validate_spendsave(a){document.getElementById("TrSpendSaveResult").style.display=show_tab;document.getElementById("spnclear").style.display="inline";return true}function ClearTaxFree_taxfree(){document.getElementById("TaxFreeresult").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_taxfree(){var b=document.breakup.amt.value;var j=parseFloat(document.breakup.CL_t2.value);var m=parseFloat(document.breakup.CL_roi2.value)/100;var a=parseFloat(document.breakup.CL_roi1.value)/100;var k=parseFloat(document.breakup.CL_comp1.options[document.breakup.CL_comp1.options.selectedIndex].value);var g=parseFloat(document.breakup.CL_comp2.options[document.breakup.CL_comp2.options.selectedIndex].value);var d=parseFloat(document.getElementById("CL_tax").value)/100;if(b==""){alert("enter the amount");document.breakup.amt.focus();return false}if(j==""){alert("Enter the Tenure of investment years");document.breakup.CL_t2.focus();return false}if(a==""){alert("Enter the Interest Earned");document.breakup.CL_roi1.focus();return false}if(m==""){alert("Enter the Interest Earned");document.breakup.CL_roi2.focus();return false}if(k>0){var f=Math.pow(1+a/k,k);var h=b*a/k*(1-d)}else{var f=Math.pow(1+j*a,1/j);var h=b*j*a*(1-d)}f=(f-1)*(1-d);if(g>0){var c=Math.pow(1+m/g,g);var l=b*m/g}else{var c=Math.pow(1+j*m,1/j);var l=b*j*m}if(c-1>f){var e="Tax-Free"}else{var e="Taxed"}document.getElementById("CL_avn").value=e;document.getElementById("CL_tax_result").value=Math.round((f)*10000)/100;document.getElementById("CL_ntax").value=Math.round((c-1)*10000)/100;document.getElementById("TaxFreeresult").style.display="inline"}var CL_viewHide;function cl_check_taxfree(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_taxfree(a){document.getElementById("spnclear").style.display="inline"}function CL_hid_taxfree(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function cl_validate_taxfree(c){var f=document.breakup.amt.value;if(isNaN(f)||f<0){alert("Investment amount should be greater than 0");document.breakup.amt.focus();return false}var a=document.breakup.CL_roi2.value;if(isNaN(a)||a<=0){alert("Return on Investment should be greater than 0");document.breakup.CL_roi2.focus();return false}var b=document.breakup.CL_roi1.value;if(isNaN(b)||b<=0){alert("Return on Investment should be greater than 0");document.breakup.CL_roi2.focus();return false}var d=document.breakup.CL_t2.value;if(isNaN(d)||d<=0){alert("Tenure of Investment should be greater than 0");document.breakup.CL_t2.focus();return false}var e=parseFloat(document.getElementById("CL_tax").value);if(isNaN(e)||e<0||e>35){alert("Tax should be greater than 0 or less than 36");document.breakup.CL_tax.focus();return false}return true}function ClearTaxInflation_taxinf(){document.getElementById("TrTaxInflation").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_taxinf(){var c=1;var f;var d;var b;var g;var e;var h;var a;b=parseFloat(document.breakup.CL_time.value,10);b*=c;f=parseFloat(document.breakup.CL_current.value,10);d=parseFloat(document.breakup.CL_roi.value,10)/100;h=parseFloat(document.breakup.CL_inf.value,10)/100;CL_tax=parseFloat(document.breakup.CL_tax.value,10)/100;d=d*(1-CL_tax);CL_mon=parseFloat(document.breakup.CL_mon.value,10);if(d==0){d=1e-8}d=Math.pow((1+d),1/c)-1;g=f*(Math.pow((1+d),b));g+=parseFloat(document.breakup.CL_mon.value,10)*((Math.pow((1+d),b)-1)/d);a=g/Math.pow(1+h,b/c);if(isNaN(g)){alert("One or more of the numeric fields are wrong. Please Check")}else{document.getElementById("CL_emi").value=Math.round(g);document.getElementById("CL_real").value=Math.round(a);document.getElementById("TrTaxInflation").style.display="inline";document.getElementById("spnclear").style.display="inline";formatNumber("CL_emi");formatNumber("CL_real")}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_taxinf(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_taxinf(a){if(document.layers){}else{if(document.all){}}}function CL_hid_taxinf(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}}function CL_vlidate_taxinf(a){if(isNaN(parseFloat(a.CL_time.value))||parseFloat(a.CL_time.value)<=0){alert("Investment horizon should be greater than 0");a.age.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Current savings should be greater than or equal to 0");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_tax.value))||parseFloat(a.CL_tax.value)<0){alert("Monthly savings should be greater than or equal to 0");a.CL_tax.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<0){alert("Return on your investments should be greater than or equal to 0");a.CL_roi.focus();return false}return true}function separaterwindow(a){var b="test.htm";CL_windd=window.open(b,"ash1","scrollbars=yes,toolbar=no,menubar=no,resizable=yes,height=600,width=700","replace");CL_windd.focus()}function calculate_taxsave(){var F="ttttt";CL_win_taxsave=window.open("","ash1","scrollbars=yes,toolbar=no,menubar=no,resizable=yes,height=600,width=700","replace");CL_win_taxsave.document.open();CL_win_taxsave.focus();var c;var w;var v;var o;var d;var C;var r;d=parseFloat(document.breakup.tenure.value,10)*12;c=parseFloat(document.breakup.amount.value,10);w=parseFloat(document.breakup.yr.options[document.breakup.yr.selectedIndex].value,10);v=parseFloat(document.breakup.mon.options[document.breakup.mon.selectedIndex].value,10);o=parseFloat(document.breakup.roi.value,10)/1200;C=parseFloat(document.breakup.reset.options[document.breakup.reset.selectedIndex].value,10);r=parseFloat(document.breakup.tax.value,10)/100;var u=(c*12*o*(Math.pow((o*C+1),d/C)))/((Math.pow((1+o*C),d/C)-1)*12);var t=(1+o*C);var s=0;if(C==12){}else{s=12-v+1;var q=c}var j=parseFloat(document.breakup.yr.options[document.breakup.yr.selectedIndex].text,10);if(v>9){j-=1}var g=0;var y=0;var z=0;var m=0;var l=0;h=q;var b="";CL_win_taxsave.document.write("<body bgcolor=#ffffff"+b+">");CL_win_taxsave.document.write("<P><TABLE border=1 cellPadding=1 cellSpacing=0 width=100%><TR><TD align=center><font face=verdana size=2><b>Year</b></font></TD><TD><font face=verdana size=2><b>Principal Paid</b></font></TD><TD><font face=verdana size=2><b>Interest Paid</b></font></TD><TD><font face=verdana size=2><b>Tax saved on Principal</b></font></TD><TD><font face=verdana size=2><b>Tax saved on Interest</b></font></TD><TD><font face=verdana size=2><b>Total Tax Saved</b></font></TD></TR>");if(C==1){for(i=v;i<13;i++){if(g<100000){g+=q*(o)}l+=q*o;if(y<20000){y+=(u-q*(o))}q=q-(u-q*(o));if(q<1){i=13}}g=Math.min(g,100000);y=Math.min(y,20000);CL_win_taxsave.document.write("<TR><TD align=center><font face=verdana size=2>"+j+"-"+Math.round(j+1)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(h-q)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(l)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(g*r)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2+g*r)+"</font></TD></TR>");h=q;m+=g;z+=y;g=0;y=0;j+=1;l=0;do{for(i=1;i<13;i++){if(g<100000){g+=q*(o)}l+=q*o;if(y<20000){y+=(u-q*(o))}q=q-(u-q*(o));if(q<1){i=13}}g=Math.min(g,100000);y=Math.min(y,20000);CL_win_taxsave.document.write("<TR><TD align=center><font face=verdana size=2>"+j+"-"+Math.round(j+1)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(h-q)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(l)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(g*r)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2+g*r)+"</font></TD></TR>");h=q;m+=g;z+=y;g=0;y=0;j+=1;l=0}while(q>1);CL_win_taxsave.document.write("</table>")}else{var h=c;s=12;var q=c*Math.pow(t,s/C)-(u*C)*(Math.pow(t,s/C)-1)/(t-1);var f=0;if((h-q)!=0){f=(h-q)/12}var e=u-f;var a=0;for(i=v;i<13;i++){if(g<100000){g+=e}l+=e;if(y<20000){y+=f}a+=f}g=Math.min(g,100000);y=Math.min(y,20000);CL_win_taxsave.document.write("<TR><TD align=center><font face=verdana size=2>"+j+"-"+Math.round(j+1)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(a)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(l)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(g*r)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2+g*r)+"</font></TD></TR>");m+=g;z+=y;g=0;y=0;j+=1;l=0;a=0;do{for(i=1;i<v;i++){if(g<100000){g+=e}l+=e;if(y<20000){y+=f}a+=f;if(q<1){i=13}}g=Math.min(g,100000);y=Math.min(y,20000);h=q;s+=12;q=c*Math.pow(t,s/C)-(u*C)*(Math.pow(t,s/C)-1)/(t-1);f=(h-q)/12;e=u-f;if(h>10){for(i=v;i<13;i++){if(g<100000){g+=e}l+=e;if(y<20000){y+=f}a+=f}}g=Math.min(g,100000);y=Math.min(y,20000);CL_win_taxsave.document.write("<TR><TD align=center><font face=verdana size=2>"+j+"-"+Math.round(j+1)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(a)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(l)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(g*r)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2+g*r)+"</font></TD></TR>");m+=g;z+=y;g=0;y=0;j+=1;l=0;a=0}while(q>1);if(v>1){for(i=1;i<v;i++){if(g<100000){g+=e}l+=e;if(y<20000){y+=f}a+=f}g=Math.min(g,100000);y=Math.min(y,20000);m+=g;z+=y;CL_win_taxsave.document.write("<TR><TD align=center><font face=verdana size=2>"+j+"-"+Math.round(j+1)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(a)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(l)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(g*r)+"</font></TD><TD ><font face=verdana size=2>"+Math.round(y*0.2+g*r)+"</font></TD></TR>")}CL_win_taxsave.document.write("</table>");CL_win_taxsave.document.write("<table><tr><td><font face=verdana size=2><b>Total Tax Saving: Rs. "+Math.round(z*0.2+m*r)+"<b></td></tr></table>")}}var viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function check_taxsave(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function display_taxsave(a){if(document.layers){content=document.layers[a]}else{if(document.all){}}}function validate_taxsave(a){if(!a.amount.value||parseFloat(a.amount)<=0){alert("Loan amount should be greater than 0");a.amount.focus();return false}if(!a.tenure.value||parseFloat(a.tenure.value)<=0){alert("Tenure should be greater than 0");a.tenure.focus();return false}if(!a.roi.value||parseFloat(a.roi.value)<=0){alert("Rate of interest should be greater than 0");a.roi.focus();return false}if(!a.tax.value||parseFloat(a.tax.value)<0||parseFloat(a.tax.value)>36){alert("Tax Rate of interest should be between 0 and 35");a.roi.focus();return false}return true}function ClearWealthRetire_wealthret(){document.getElementById("TrWealthRetire").style.display="none";document.getElementById("spnclear").style.display="none"}function cl_calculate_wealthret(){var e;var g;var d;var c;var f;var a;c=(parseFloat(document.getElementById("ret").value,10)-parseFloat(document.getElementById("age").value,10));A=c*12;e=parseFloat(document.getElementById("CL_current").value,10);g=parseFloat(document.breakup.CL_mon.value,10);d=(parseFloat(document.getElementById("CL_roi").value,10)/12);if(d==0){d=1e-8}B=d/100;f=e+g;for(var b=1;b<=A;b++){a=f*B;f=f+a;if(b!=A){f=f+g}}if(isNaN(f)){alert("One or more of the numeric fields are wrong. Please Check")}else{if(document.layers){document.layers.result.document.breakup.CL_emi.value=Math.round(f);formatNumber("CL_emi")}else{document.getElementById("spnclear").style.display="inline";document.breakup.CL_emi.value=Math.round(f);formatNumber("CL_emi")}}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check_wealthret(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_display_wealthret(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=visible}function CL_hid_wealthret(a){if(document.layers){content=document.layers[a]}else{if(document.all){content=document.all(a).style}}content.visibility=hidden}function CL_vlidate_wealthret(a){if(isNaN(parseFloat(a.age.value))||parseFloat(a.age.value)<=0){alert("Your age should be greater than 0");a.age.focus();return false}if(isNaN(parseFloat(a.ret.value))||parseFloat(a.ret.value)<=parseFloat(a.age.value)){alert("Your retirement age should be greater than your present age");a.ret.focus();return false}if(isNaN(parseFloat(a.ret.value))||parseFloat(a.ret.value)<=parseFloat(a.age.value)){alert("Your retirement age should be greater than your present age");a.ret.focus();return false}if(isNaN(parseFloat(a.CL_current.value))||parseFloat(a.CL_current.value)<0){alert("Current savings should be greater than or equal to 0");a.CL_current.focus();return false}if(isNaN(parseFloat(a.CL_mon.value))||parseFloat(a.CL_mon.value)<0){alert("Monthly savings should be greater than or equal to 0");a.CL_mon.focus();return false}if(isNaN(parseFloat(a.CL_roi.value))||parseFloat(a.CL_roi.value)<0){alert("Return on your investments should be greater than or equal to 0");a.CL_roi.focus();return false}document.getElementById("TrWealthRetire").style.display="inline";return true};
