Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- function BMI(h,w)
- {
- if (h.length==0 || w.length==0)
- {return ("")}
- if (h>0 && w>0)
- {return Math.round((w/Math.pow(h,2))*703)}
- return ("")
- }
- function BMIPER(b,d,e,a,g)
- {
- if (d.length==0 || e.length==0)
- {return ("")}
- if (d>0 && e>0 && g=="M" && a<15)
- {return Math.round((1.51*b)-(0.70*a)-(3.6*1)+1.4)}
- if (d>0 && e>0 && g=="F" && a<15)
- {return Math.round((1.51*b)-(0.70*a)-(3.6*0)+1.4)}
- if (d>0 && e>0 && g=="F" && a>14)
- {return Math.round((1.20*b)-(0.23*a)-(10.8*0)+5.4)}
- if (d>0 && e>0 && g=="M" && a>14)
- {return Math.round((1.20*b)-(0.23*a)-(10.8*0)+5.4)}
- return ("")
- }
- function Calc_BMI()
- {
- for (i = 0; i <= 13; i++)
- document.getElementById("bmi_"+i).value = BMI(document.getElementById("hgt_"+i).value, document.getElementById("wgt_"+i).value)
- }
- function Calc_BMIper()
- {
- for (z = 0; z <= 13; z++)
- document.getElementById("bmi_per_"+z).value = BMIPER(document.getElementById("bmi_"+z).value, document.getElementById("hgt_"+z).value, document.getElementById("wgt_"+z).value, document.getElementById("age_"+z), document.getElementById("gen").value)
- }
- </script>