<?xml                 version="1.0"  encoding="UTF-8" ?>
<Module>
<ModulePrefs title="BMI Calculator"
title_url="http://gadget-blog.ro/"
category="tools"
category2="funandgames"
description="The BMI Calculator will display your health condition according to the BMI factor (= the raport between your weight and your height)."
author="Alice Thai"
author_email="the.gadget.architect@gmail.com"
screenshot="http://sites.google.com/site/portalromanesc/BMI-calculator.png"
thumbnail="http://sites.google.com/site/portalromanesc/BMI-calculator.png"
author_location="GR"
author_affiliation="PortalRomanesc"
author_photo="http://portal.romanesc.googlepages.com/sumotv.gif"
author_aboutme="I just love building gadgets"
author_link="http://atat.ro"
author_quote="Never argue with an idiot. They'll bring you down to their level, then beat you with experience"
height="360"
width="250">
</ModulePrefs>
<!-- -->
<Content type="html"><![CDATA[

<table border="0" width="100%">
  <tr>
    <td><FORM NAME="BMI" method=POST>
<TABLE border=1 style="border-collapse: collapse">
<TR>
<TD><DIV ALIGN=CENTER>Weight (kg)</DIV></TD>
<TD><DIV ALIGN=CENTER>Height (cm)</DIV></TD>
<TD><DIV ALIGN=CENTER>BMI</DIV></TD>
</TR>

<TR>
<TD><INPUT NAME=weight  SIZE=5 onFocus="this.form.weight.value=''"></TD>
<TD><INPUT NAME=height  SIZE=5 onFocus="this.form.height.value=''"></TD>
<TD><INPUT NAME=bmi     SIZE=5 ></TD>
</TABLE>

<table border="0" width="100%" id="table1">
  <tr>
    <td><textarea NAME=my_comment size=30 rows="2" cols="23"></textarea><iframe border=0 frameborder=0 height=60 marginheight=0 marginwidth=0 name=explain scrolling=no src=http://atat.ro/about.html title=Proxy width=234></iframe></td>
  </tr>
</table>
<center>
<INPUT TYPE="button" VALUE="Let's see" onClick="computeform(this.form)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<INPUT TYPE="reset"  VALUE="Reset" onClick="ClearForm(this.form)"><br />
<b>
<a title="Cool Gadgets" target="_blank" href="http://atat.ro">
    <font size="-1" color="#333333" face="Verdana">Cool Gadgets</font></a></b></center>
</FORM>

<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- hide this script tag's contents from old browsers


function ClearForm(form){

    form.weight.value = "";
    form.height.value = "";
    form.bmi.value = "";
    form.my_comment.value = "";

}

function bmi(weight, height) {

          bmindx=weight/eval(height*height);
          return bmindx;
}

function checkform(form) {

       if (form.weight.value==null||form.weight.value.length==0 || form.height.value==null||form.height.value.length==0){
            alert("\nPlease complete the form first");
            return false;
       }

       else if (parseFloat(form.height.value) <= 0||
                parseFloat(form.height.value) >=500||
                parseFloat(form.weight.value) <= 0||
                parseFloat(form.weight.value) >=500){
                alert("\nReally know what you're doing? \nPlease enter values again. \nWeight in kilos and \nheight in cm");
                ClearForm(form);
                return false;
       }
       return true;

}

function computeform(form) {

       if (checkform(form)) {

       yourbmi=Math.round(bmi(form.weight.value, form.height.value/100));
       form.bmi.value=yourbmi;

       if (yourbmi >40) {
          form.my_comment.value="You are grossly obese, consult your physician!";
       }

       else if (yourbmi >30 && yourbmi <=40) {
          form.my_comment.value="Umm... You are obese, want some liposuction?";
       }

       else if (yourbmi >27 && yourbmi <=30) {
          form.my_comment.value="You are very fat, do something before it's too late";
       }

       else if (yourbmi >22 && yourbmi <=27) {
          form.my_comment.value="You are fat, need dieting and exercise";
       }

       else if (yourbmi >=21 && yourbmi <=22) {
          form.my_comment.value="I envy you. Keep it up!!";
       }

       else if (yourbmi >=18 && yourbmi <21) {
          form.my_comment.value="You are thin, eat more.";
       }

       else if (yourbmi >=16 && yourbmi <18) {
          form.my_comment.value="You are starving. Go Find some food!";
       }

       else if (yourbmi <16) {
          form.my_comment.value="You're grossly undernourished, need hospitalization ";
       }

       }
       return;
}
 // -- done hiding from old browsers -->
</SCRIPT></td>
  </tr>
</table>


]]></Content>
</Module>












