/*****************************************
(C) http://www.calculator.net all right reserved.  
*****************************************/
function showMF(A){if(A=="male"){gObj("standardmale").style.display="block";gObj("standardfemale").style.display="none"}else{gObj("standardmale").style.display="none";gObj("standardfemale").style.display="block"}calc()}function calc(){showquickmsg("calculating...",true);IZ=false;if(gObj("csex1").checked){IZ=true}xa=trimAll(gObj("cage").value+"");Sc=trimAll(gObj("cheightfeet").value+"");SL=trimAll(gObj("cheightinch").value+"");IH=trimAll(gObj("cneckfeet").value+"");xu=trimAll(gObj("cneckinch").value+"");QK=trimAll(gObj("cwaistfeet").value+"");UX=trimAll(gObj("cwaistinch").value+"");AU=trimAll(gObj("cwaistfeetf").value+"");CO=trimAll(gObj("cwaistinchf").value+"");pd=trimAll(gObj("chipfeet").value+"");hw=trimAll(gObj("chipinch").value+"");if((!isNumber(Sc))||(!isNumber(SL))){showquickmsg("height need to be numeric",true);return }else{if(!isNumber(xa)){showquickmsg("age need to be numeric",true);return }else{if((!isNumber(IH))||(!isNumber(xu))){showquickmsg("neck need to be numeric",true);return }}}if(IZ){if((!isNumber(QK))||(!isNumber(UX))){showquickmsg("waist need to be numeric",true);return }QK=parseFloat(QK);UX=parseFloat(UX)}else{if((!isNumber(AU))||(!isNumber(CO))){showquickmsg("waist need to be numeric",true);return }else{if((!isNumber(pd))||(!isNumber(hw))){showquickmsg("hip need to be numeric",true);return }}AU=parseFloat(AU);CO=parseFloat(CO);pd=parseFloat(pd);hw=parseFloat(hw)}xa=parseInt(xa);Sc=parseFloat(Sc);SL=parseFloat(SL);IH=parseFloat(IH);xu=parseFloat(xu);SL=12*Sc+SL;xu=12*IH+xu;if(IZ){QK=parseFloat(QK);UX=parseFloat(UX);UX=12*QK+UX;WO=86.01*(Math.log(UX-xu)/Math.LN10)-70.041*(Math.log(SL)/Math.LN10)+36.76}else{AU=parseFloat(AU);UX=parseFloat(UX);pd=parseFloat(pd);hw=parseFloat(hw);UX=12*AU+CO;hw=12*pd+hw;WO=163.205*(Math.log(UX+hw-xu)/Math.LN10)-97.684*(Math.log(SL)/Math.LN10)-78.387}if(WO<0){WO=0}if(WO>100){WO=100}WO=Math.round(WO);jd="<font color=green><b>body fat = "+WO+"%</b></font>";if(xa<17){jd+=" You are too young for army!"}else{if(IZ){if(xa<21){if(WO<19){jd+=" You meet the Department of Defense goal."}else{if(WO<21){jd+=" You meet the body fat percentage standard."}else{if(WO<27){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(xa<28){if(WO<19){jd+=" You meet the Department of Defense goal."}else{if(WO<23){jd+=" You meet the body fat percentage standard."}else{if(WO<27){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(xa<40){if(WO<19){jd+=" You meet the Department of Defense goal."}else{if(WO<25){jd+=" You meet the body fat percentage standard."}else{if(WO<29){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(WO<19){jd+=" You meet the Department of Defense goal."}else{if(WO<27){jd+=" You meet the body fat percentage standard."}else{if(WO<31){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}}}}else{if(xa<21){if(WO<27){jd+=" You meet the Department of Defense goal."}else{if(WO<31){jd+=" You meet the body fat percentage standard."}else{if(WO<33){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(xa<28){if(WO<27){jd+=" You meet the Department of Defense goal."}else{if(WO<33){jd+=" You meet the body fat percentage standard."}else{if(WO<33){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(xa<40){if(WO<27){jd+=" You meet the Department of Defense goal."}else{if(WO<35){jd+=" You meet the body fat percentage standard."}else{if(WO<35){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}else{if(WO<27){jd+=" You meet the Department of Defense goal."}else{if(WO<37){jd+=" You meet the body fat percentage standard."}else{if(WO<39){jd+=" You meet the army recruitment body fat percentage standard."}else{jd+=" You are not in compliance."}}}}}}}}showquickmsg(jd,false)};