document.writeln("<HEAD>");
document.writeln("");
document.writeln("<SCRIPT LANGUAGE=\"JavaScript\">");
document.writeln("");
document.writeln("<!-- Original:  Marat Rikelman (rikelman@bellsouth.net) -->");
document.writeln("");
document.writeln("<!-- This script and many more are available free online at -->");
document.writeln("<!-- The JavaScript Source!! http:\/\/javascript.internet.com -->");
document.writeln("");
document.writeln("<!-- Begin");
document.writeln("function mod(div,base) {");
document.writeln("return Math.round(div - (Math.floor(div\/base)*base));");
document.writeln("}");
document.writeln("function calcBmi() {");
document.writeln("var w = document.bmi.weight.value * 1;");
document.writeln("var HeightFeetInt = document.bmi.htf.value * 1;");
document.writeln("var HeightInchesInt = document.bmi.hti.value * 1;");
document.writeln("HeightFeetConvert = HeightFeetInt * 12;");
document.writeln("h = HeightFeetConvert + HeightInchesInt;");
document.writeln("displaybmi = (Math.round((w * 703) \/ (h * h)));");
document.writeln("var rvalue = true;");
document.writeln("if ( (w <= 35) || (w >= 500)  || (h <= 48) || (h >= 120) ) {");
document.writeln("alert (\"Invalid data.  Please check and re-enter!\");");
document.writeln("rvalue = false;");
document.writeln("}");
document.writeln("if (rvalue) {");
document.writeln("if (HeightInchesInt > 11) {");
document.writeln("reminderinches = mod(HeightInchesInt,12);");
document.writeln("document.bmi.hti.value = reminderinches;");
document.writeln("document.bmi.htf.value = HeightFeetInt + ");
document.writeln("((HeightInchesInt - reminderinches)\/12);");
document.writeln("document.bmi.answer.value = displaybmi;");
document.writeln("}");
document.writeln("if (displaybmi <19) ");
document.writeln("document.bmi.comment.value = \"Underweight\";");
document.writeln("if (displaybmi >=19 && displaybmi <=25) ");
document.writeln("document.bmi.comment.value = \"Desirable\";");
document.writeln("if (displaybmi >=26 && displaybmi <=29) ");
document.writeln("document.bmi.comment.value = \"prone to health risks\";");
document.writeln("if (displaybmi >=30 && displaybmi <=40) ");
document.writeln("document.bmi.comment.value = \"Obese\";");
document.writeln("if (displaybmi >40) ");
document.writeln("document.bmi.comment.value = \"Extremely obese\";");
document.writeln("document.bmi.answer.value = displaybmi; }");
document.writeln("return rvalue;");
document.writeln("}");
document.writeln("\/\/  End -->");
document.writeln("");
document.writeln("<\/script>");
document.writeln("<\/HEAD>");
document.writeln("");
document.writeln("<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->");
document.writeln("");
document.writeln("<BODY>");
document.writeln("");
document.writeln("<form name=bmi>");
document.writeln("<center>");
document.writeln("<table width=200 border=0>");
document.writeln("<tr>");
document.writeln("<td align=center><B>Weight:<\/B>");
document.writeln("<input type=text name=weight SIZE=3 maxlength=3> lbs.<\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td align=center><B>Height:<\/B>");
document.writeln("<input type=text name=htf size=1 maxlength=1> Ft.         ");
document.writeln("<input type=text name=hti size=2 maxlength=2> In.");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td align=center>");
document.writeln("<input type=button value=\"Calculate BMI\" onclick=\"calcBmi()\">");
document.writeln(" ");
document.writeln("<hr><\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td><B>Body Mass Index<\/B>");
document.writeln("<input type=text name=answer size=3>");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<tr>");
document.writeln("<td>");
document.writeln("According to the Panel on Energy, Obesity, and ");
document.writeln("Body Weight Standards published by American ");
document.writeln("Journal of Clinical Nutrition, your category is:<br>");
document.writeln("<input type=text name=comment size=25>");
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<\/table>");
document.writeln("<\/center>");
document.writeln("<\/form>");
document.writeln("");