function cl_calculatec(){var k;var h;var e;var f;var d;var b;var i;var c;var j;var g;var a;j=parseFloat(document.getElementById("CL_age").value,10);g=parseFloat(document.getElementById("CL_ret").value,10);a=parseFloat(document.getElementById("CL_retamt").value,10);e=g-j;if(e<0){alert("Retirement age should be more than your current age");return false}k=parseFloat(document.getElementById("CL_current").value,10);h=Math.pow(1+parseFloat(document.getElementById("CL_roi").value,10)/100,1/12)-1;CL_roi1=parseFloat(document.getElementById("CL_roi").value,10)/100;b=parseFloat(document.getElementById("CL_inf").value)/100;d=a*Math.pow(1+b,e);f=d-k*Math.pow((1+CL_roi1),e);CL_msav=parseFloat(document.getElementById("CL_msav").value);i=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_current1").value=Math.round(i+k*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_current1").value=Math.round(i+k*Math.pow((1+CL_roi1),e))}formatNumber("emi");formatNumber("CL_fv");formatNumber("CL_current1")}}var CL_viewHide;if(document.layers){visible="show";hidden="hide"}else{if(document.all){visible="visible";hidden="hidden"}}function cl_check(a,b){if(b=="int"){if(isNaN(a.value)){alert("Please enter a Number in the given field");a.focus()}}}function CL_displayc(b){if(document.layers){content=document.layers[b]}else{if(document.all){content=document.all(b).style}}var a=document.getElementById("result");var c=navigator.appName;if(c=="Microsoft Internet Explorer"){a.style.display="inline"}else{a.style.display="table-cell"}}function CL_hidc(b){if(document.layers){content=document.layers[b]}else{if(document.all){content=document.all(b).style}}var a=document.getElementById("result");var c=navigator.appName;if(c=="Microsoft Internet Explorer"){a.style.display="none"}else{a.style.display="none"}}function cl_validatec(){var c=document.getElementById("CL_age");var e=document.getElementById("CL_ret");var d=document.getElementById("CL_current");var g=document.getElementById("CL_retamt");var a=document.getElementById("CL_msav");var b=document.getElementById("CL_roi");var f=document.getElementById("CL_inf");if(isNaN(parseFloat(c.value))||parseFloat(c.value)<=0){alert("Your age should be greater than 0 years");c.focus();return false}if(isNaN(parseFloat(e.value))||parseFloat(e.value)<=parseFloat(c.value)){alert("Retirement age should be greater than your current age");e.focus();return false}if(isNaN(parseFloat(d.value))||parseFloat(parseFloat(d.value))<0||d.value==""){alert("Your current savings should be greater than 0");d.focus();return false}if(isNaN(parseFloat(g.value))||parseFloat(parseFloat(g.value))<0){alert("Your retirement amount should be greater than or equal to 0");g.focus();return false}if(isNaN(parseFloat(a.value))||parseFloat(parseFloat(a.value))<0){alert("Monthly savings should be greater than or equal to 0");a.focus();return false}if(isNaN(parseFloat(b.value))||parseFloat(parseFloat(b.value))<0){alert("Rate of return on your investment should be greater than 0");b.focus();return false}if(isNaN(parseFloat(f.value))||parseFloat(parseFloat(f.value))<0){alert("Rate of inflation should be greater than 0");f.focus();return false}if(c.value!=""&&e.value!=""&&d.value!=""&&g.value!=""&&a.value!=""&&b!=""&&f.value!=""){return true}else{return false}};
