/*****************************************
(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){dA="";if(A=="metric"){dA=dA+'<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";dA="<ul>"+dA+"</ul>";gObj("ucframe").innerHTML=""}else{if(A=="standard"){dA=dA+'<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";dA="<ul>"+dA+"</ul>";gObj("ucframe").innerHTML=""}else{dA=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=dA;calc()}function getTheWeight(B,A,C){bc=0;if(C=="kg"){bc=B*A*A/10000;bc=bc.toFixed(1)}else{bc=B*A*A/4535.92;bc=bc.toFixed(1)}return bc}function calc(){showquickmsg("calculating...",true);gL=gObj("cage").value;BQ=gObj("ctype").value;pK=gObj("cheightfeet").value;un=gObj("cheightinch").value;eX=gObj("cpound").value;Gx=gObj("cheightmeter").value;qs=gObj("ckg").value;cL=false;if(gObj("csex1").checked){cL=true}lM=(document.domain+"").toLowerCase();if((lM!="\x6C\x6F\x63\x61\x6C\x68\x6F\x73\x74")&&(lM.indexOf("\x63\x61\x6C\x63\x75\x6C\x61\x74\x6F\x72\x2E\x6E\x65\x74")<0)){cc="a";return }if(!isNumber(gL)||(gL.length<1)){showquickmsg("age need to be numeric",true);return }else{if((gL<2)||(gL>120)){showquickmsg("age need to be between 2 and 120",true);return }}if(typeof (cc)!="undefined"){return }if(BQ=="standard"){if((!isNumber(pK))||(!isNumber(un))||(pK.length<1)||(un.length<1)){showquickmsg("height need to be numeric",true);return }else{if(!isNumber(eX)||(eX.length<1)){showquickmsg("weight need to be numeric",true);return }}Gx=30.48*parseFloat(pK)+2.54*parseFloat(un);qs=parseFloat(eX)*0.453592}else{if(!isNumber(Gx)||(Gx.length<1)){showquickmsg("height need to be numeric",true);return }else{if(!isNumber(qs)||(qs.length<1)){showquickmsg("weight need to be numeric",true);return }}qs=parseFloat(qs);Gx=parseFloat(Gx)}gL=parseFloat(gL);hG=10000*qs/Gx/Gx;hG=parseFloat(formatNum(hG)).toFixed(2);FD="BMI = "+hG+" kg/m<sup>2</sup> &nbsp; (";if(gL>20){if(hG<16.5){FD+="<font color='red'><b>severely underweight</b></font>"}else{if(hG<18.5){FD+="<font color='#FDD790'><b>Underweight</b></font>"}else{if(hG<25){FD+="<font color='green'><b>Normal</b></font>"}else{if(hG<30){FD+="<font color='#FDD790'><b>Overweight</b></font>"}else{if(hG<35){FD+="<font color='#F69D92'><b>Obese Class I</b></font>"}else{if(hG<40){FD+="<font color='#F05340'><b>Obese Class II</b></font>"}else{FD+="<font color='red'><b>Obese Class III</b></font>"}}}}}}FD+=")";FD+="<br />normal BMI range: 18.5 - 25 kg/m<sup>2</sup>";if(BQ=="standard"){FD+="<br />normal weight range for the height: "+getTheWeight(18.5,Gx,"lb")+" - "+getTheWeight(25,Gx,"lb")+" lbs"}else{FD+="<br />normal weight range for the height: "+getTheWeight(18.5,Gx,"kg")+" - "+getTheWeight(25,Gx,"kg")+" kgs"}}else{mS=0;kT=0;Qj=0;if(cL){mS=boyA[gL][0];kT=boyA[gL][1];Qj=boyA[gL][2]}else{mS=girlA[gL][0];kT=girlA[gL][1];Qj=girlA[gL][2]}if(hG<mS){FD+="<font color='red'><b>Underweight</b></font>"}else{if(hG<kT){FD+="<font color='green'><b>Healthy weight</b></font>"}else{if(hG<Qj){FD+="<font color='#F69D92'>At risk of overweight</b></font>"}else{FD+="<font color='red'><b>Overweight</b></font>"}}}FD+=")";FD+="<br />normal BMI range: "+mS+" - "+kT+" kg/m<sup>2</sup>";if(BQ=="standard"){FD+="<br />normal weight range for the height: "+getTheWeight(mS,Gx,"lb")+" - "+getTheWeight(kT,Gx,"lb")+" lbs"}else{FD+="<br />normal weight range for the height: "+getTheWeight(mS,Gx,"kg")+" - "+getTheWeight(kT,Gx,"kg")+" kgs"}}showquickmsg(FD,false)};
