/*****************************************
(C) http://www.calculator.net all right reserved.  
*****************************************/
var YG=new Array(1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008);var cX=new Array(1.35,0.92,7.64,17.8,17.26,15.31,15.9,-10.85,-6.1,1.8,0.45,2.44,0.94,-1.92,-1.15,0,-2.66,-8.94,-10.3,-5.09,3.51,2.56,1.04,3.73,-2.01,-1.3,0.73,5.11,10.97,6,1.64,2.27,8.43,14.65,7.74,-0.95,1.09,7.88,2.29,0.82,0.32,-0.28,1.52,3.34,2.73,1.01,1.46,1.07,1.2,1.24,1.28,1.59,3.01,2.78,4.27,5.46,5.84,4.3,3.27,6.16,11.03,9.2,5.75,6.5,7.62,11.22,13.58,10.35,6.16,3.22,4.3,3.55,1.91,3.66,4.08,4.83,5.39,4.25,3.03,2.96,2.61,2.81,2.93,2.34,1.55,2.19,3.38,2.83,1.59,2.27,2.68,3.39,3.24,2.85,3.8);function calc(){showquickmsg("calculating...",true);setTimeout("process()",2)}function process(){NL=trimAll(gObj("cinterestrate").value+"");IC=trimAll(gObj("cincompound").value+"");MC=trimAll(gObj("coutcompound").value+"");if(!isNumber(NL)){showquickmsg("starting amount needs to be numeric",true);return }An=(document.domain+"").toLowerCase();if((An!="\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74")&&(An.indexOf("\x63\x61\x6C\x63\x75\x6C\x61\x74\x6F\x72\x2E\x6E\x65\x74")<0)){cc="a";return }if(typeof (cc)!="undefined"){return }IC=parseInt(IC);MC=parseInt(MC);JO=1;if(IC>MC){for(oQ=MC;oQ<IC;oQ++){iU=oQ-1914;JO=JO/(1+(cX[iU]/100))}}else{if(IC<MC){for(oQ=IC;oQ<MC;oQ++){iU=oQ-1914;JO=JO*(1+(cX[iU]/100))}}}US=parseFloat(NL)*JO;gObj("cinterestrateout").value=US.toFixed(5);showquickmsg("$"+NL+" in "+IC+" is has the same purchasing power as <b><font color='green'>$"+US.toFixed(5)+"</font></b> in "+MC,false)}function showquickmsgwithid(B,C,A){if(A){C="<font color=red>"+C+"</font>"}gObj(B).innerHTML=C}function calc2(){ht=trimAll(gObj("cstartingamount").value+"");tB=trimAll(gObj("cinflationrate").value+"");Ta=trimAll(gObj("ccertainyears").value+"");if(!isNumber(ht)){showquickmsgwithid("coutput2","starting amount needs to be numeric",true);return }if(!isNumber(tB)){showquickmsgwithid("coutput2","inflation rate needs to be numeric",true);return }if(!isNumber(Ta)){showquickmsgwithid("coutput2","number of years needs to be numeric",true);return }ht=parseFloat(ht);tB=parseFloat(tB);Ta=parseFloat(Ta);ru=tB/100;IM=ht*Math.pow((1+ru),Ta);gObj("cendamount").value=IM.toFixed(5);showquickmsgwithid("coutput2","$"+ht+" with average inflation rate of "+tB+"% has the same purchasing power as <b><font color='green'>$"+IM.toFixed(5)+"</font></b> "+Ta+" years later.",false)}function calc3(){jv=trimAll(gObj("cstartingamount3").value+"");XJ=trimAll(gObj("cinflationrate3").value+"");aw=trimAll(gObj("ccertainyears3").value+"");if(!isNumber(jv)){showquickmsgwithid("coutput3","starting amount needs to be numeric",true);return }if(!isNumber(XJ)){showquickmsgwithid("coutput3","inflation rate needs to be numeric",true);return }if(!isNumber(aw)){showquickmsgwithid("coutput3","number of years needs to be numeric",true);return }jv=parseFloat(jv);XJ=parseFloat(XJ);aw=parseFloat(aw);ru=XJ/100;IM=jv/(Math.pow((1+ru),aw));gObj("cendamount3").value=IM.toFixed(5);showquickmsgwithid("coutput3","$"+jv+" with average inflation rate of "+XJ+"% has the same purchasing power as <b><font color='green'>$"+IM.toFixed(5)+"</font></b> "+aw+" years ago.",false)};