/*****************************************
(C) http://www.calculator.net all right reserved.  
*****************************************/
function calc(){showquickmsg("calculating...",true);setTimeout("process()",2)}function process(){Rg=trimAll(gObj("cinterestrate").value+"");Lb=trimAll(gObj("cincompound").value+"");VR=trimAll(gObj("coutcompound").value+"");if(!isNumber(Rg)){showquickmsg("input interest need to be numeric",true);return }Rg=parseFloat(Rg);ii=0;if(Lb=="annually"){ii=Math.log(Rg/100+1)}else{if(Lb=="semiannually"){ii=Math.log(Math.pow((Rg/200+1),2))}else{if(Lb=="quarterly"){ii=Math.log(Math.pow((Rg/400+1),4))}else{if(Lb=="monthly"){ii=Math.log(Math.pow((Rg/1200+1),12))}else{ii=Rg/100}}}}sw=Math.pow(Math.E,ii)-1;LN=0;if(VR=="annually"){LN=sw*100}else{if(VR=="semiannually"){LN=(Math.sqrt(sw+1)-1)*200}else{if(VR=="quarterly"){LN=(Math.pow((sw+1),0.25)-1)*400}else{if(VR=="monthly"){LN=(Math.pow((sw+1),(1/12))-1)*1200}else{LN=ii*100}}}}gObj("cinterestrateout").value=LN.toFixed(5);showquickmsg(Rg+"% compound "+Lb+" is equivalent to <b><font color='green'>"+LN.toFixed(5)+"%</font></b> compound "+VR,false)};