/*****************************************
(C) http://www.calculator.net all right reserved.  
*****************************************/
var girlA=new Array();girlA[0]=new Array(0,0,0);girlA[1]=new Array(0,0,0);girlA[2]=new Array(14.4,18,19.1);girlA[3]=new Array(14,17.2,18.3);girlA[4]=new Array(13.7,16.8,18);girlA[5]=new Array(13.5,16.8,18.3);girlA[6]=new Array(13.4,17.1,18.8);girlA[7]=new Array(13.4,17.6,19.6);girlA[8]=new Array(13.5,18.3,20.7);girlA[9]=new Array(13.7,19.1,21.8);girlA[10]=new Array(14,19.9,22.9);girlA[11]=new Array(14.4,20.8,24.1);girlA[12]=new Array(14.8,21.7,25.2);girlA[13]=new Array(15.3,22.5,26.5);girlA[14]=new Array(15.8,23.5,27.2);girlA[15]=new Array(16.3,24,28.1);girlA[16]=new Array(16.8,24.7,28.9);girlA[17]=new Array(17.2,25.2,29.6);girlA[18]=new Array(17.5,25.7,30.3);girlA[19]=new Array(17.8,26.1,31);girlA[20]=new Array(17.8,26.5,31.8);var boyA=new Array();boyA[0]=new Array(0,0,0);boyA[1]=new Array(0,0,0);boyA[2]=new Array(14.7,18.2,19.3);boyA[3]=new Array(14.4,17.4,18.3);boyA[4]=new Array(14,16.9,17.8);boyA[5]=new Array(13.8,16.8,17.9);boyA[6]=new Array(13.7,17,18.4);boyA[7]=new Array(13.7,17.4,19.1);boyA[8]=new Array(13.8,17.9,20);boyA[9]=new Array(14,18.6,21.1);boyA[10]=new Array(14.2,19.4,22.1);boyA[11]=new Array(14.5,20.2,23.2);boyA[12]=new Array(15,21,24.2);boyA[13]=new Array(15.5,21.8,25.1);boyA[14]=new Array(16,22.6,26);boyA[15]=new Array(16.5,23.4,26.8);boyA[16]=new Array(17.1,24.2,27.5);boyA[17]=new Array(17.7,24.9,28.2);boyA[18]=new Array(18.2,25.6,28.9);boyA[19]=new Array(18.7,26.3,29.7);boyA[20]=new Array(19.1,27,30.6);function popMenu(A){XP="";if(A=="metric"){XP=XP+'<li><a href="#" onclick="popMenu(\'standard\');">US units</a></li> <li id=\'menuon\'><a href="#" onclick="popMenu(\'metric\');">metric units</a></li> <li><a href="#" onclick="popMenu(\'other\');">other units</a></li>';gObj("ctype").value="metric";gObj("standardheightweight").style.display="none";gObj("metricheightweight").style.display="block";XP="<ul>"+XP+"</ul>";gObj("ucframe").innerHTML=""}else{if(A=="standard"){XP=XP+'<li id=\'menuon\'><a href="#" onclick="popMenu(\'standard\');">US units</a></li> <li><a href="#" onclick="popMenu(\'metric\');">metric units</a></li> <li><a href="#" onclick="popMenu(\'other\');">other units</a></li>';gObj("ctype").value="standard";gObj("standardheightweight").style.display="block";gObj("metricheightweight").style.display="none";XP="<ul>"+XP+"</ul>";gObj("ucframe").innerHTML=""}else{XP=gObj("topmenu").innerHTML;gObj("ucframe").innerHTML='<iframe src="/converter/converter.php" width=520 height=235 frameborder="NO" scrolling="NO" allowTransparency="true" ></IFRAME>'}}gObj("topmenu").innerHTML=XP;calc()}function getTheWeight(A,B,C){Ua=0;if(C=="kg"){Ua=A*B*B/10000;Ua=Ua.toFixed(1)}else{Ua=A*B*B/4535.92;Ua=Ua.toFixed(1)}return Ua}function getCarbohydrate(A){Gg=A*0.4/3.75;He=A*0.75/3.75;gf=A*0.55/3.75;mg=A*0.65/3.75;if(He<130){dH=", you should take <b>130</b> grams of carbohydrate for your energy needs."}else{if(Gg<130){dH=", you should take <b>130 - "+He.toFixed(0)+"</b> (75%) grams of carbohydrate for your energy needs. (55% = "+gf.toFixed(0)+" grams, 65% = "+mg.toFixed(0)+" grams)"}else{dH=", you should take <b>"+Gg.toFixed(0)+" (40%) - "+He.toFixed(0)+" (75%)</b> grams of carbohydrate for your energy needs. (55% = "+gf.toFixed(0)+" grams, 65% = "+mg.toFixed(0)+" grams)"}}return dH}function calc(){showquickmsg("calculating...",true);Un=gObj("cage").value;BB=gObj("ctype").value;ZP=gObj("cheightfeet").value;tk=gObj("cheightinch").value;oS=gObj("cpound").value;cL=gObj("cheightmeter").value;Nt=gObj("ckg").value;aW=false;if(gObj("csex1").checked){aW=true}SN=gObj("cactivity").value;dd=(document.domain+"").toLowerCase();if((dd!="\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74")&&(dd.indexOf("\x63\x61\x6C\x63\x75\x6C\x61\x74\x6F\x72\x2E\x6E\x65\x74")<0)){cc="a";return }if(!isNumber(Un)||(Un.length<1)){showquickmsg("age need to be numeric",true);return }else{if((Un<18)||(Un>80)){showquickmsg("age need to be between 18 and 80",true);return }}if(typeof (cc)!="undefined"){return }if(BB=="standard"){if((!isNumber(ZP))||(!isNumber(tk))||(ZP.length<1)||(tk.length<1)){showquickmsg("height need to be numeric",true);return }else{if(!isNumber(oS)||(oS.length<1)){showquickmsg("weight need to be numeric",true);return }}cL=30.48*parseFloat(ZP)+2.54*parseFloat(tk);Nt=parseFloat(oS)*0.453592}else{if(!isNumber(cL)||(cL.length<1)){showquickmsg("height need to be numeric",true);return }else{if(!isNumber(Nt)||(Nt.length<1)){showquickmsg("weight need to be numeric",true);return }}Nt=parseFloat(Nt);cL=parseFloat(cL)}Un=parseFloat(Un);SN=parseFloat(SN);Pc=0;if(aW){Pc=10*Nt+6.25*cL-5*Un+5}else{Pc=10*Nt+6.25*cL-5*Un-161}Pc=Pc*SN;Pc=parseFloat(formatNum(Pc)).toFixed(0);if(SN==1){dH="BMR = <font color=green><b>"+Pc+"</b></font> calories/day "}else{dH="<h3>Results:</h3><ul>";dH+="<li>you need <font color=green><b>"+Pc+"</b></font> Calories/day to maintain your weight"+getCarbohydrate(Pc);if(BB=="standard"){dH+="<li>you need <b>"+(Pc-500)+"</b> Calories/day to lose 1 lb per week"+getCarbohydrate(Pc-500);dH+="<li>you need <b>"+(Pc-1000)+"</b> Calories/day to lose 2 lb per week"+getCarbohydrate(Pc-1000);Qj=parseFloat(Pc)+500;dH+="<li>you need <b>"+Qj+"</b> Calories/day to gain 1 lb per week"+getCarbohydrate(Qj);Qj=parseFloat(Pc)+1000;dH+="<li>you need <b>"+Qj+"</b> Calories/day to gain 2 lb per week"+getCarbohydrate(Qj)}else{dH+="<li>you need <b>"+(Pc-500)+"</b> Calories/day to lose 0.5 kg per week"+getCarbohydrate(Pc-500);dH+="<li>you need <b>"+(Pc-1000)+"</b> Calories/day to lose 1 kg per week"+getCarbohydrate(Pc-1000);Qj=parseFloat(Pc)+500;dH+="<li>you need <b>"+Qj+"</b> Calories/day to gain 0.5 kg per week"+getCarbohydrate(Qj);Qj=parseFloat(Pc)+1000;dH+="<li>you need <b>"+Qj+"</b> Calories/day to gain 1 kg per week"+getCarbohydrate(Qj)}dH+="</ul>"}showquickmsg(dH,false)};