|
|
(10 intermediate revisions not shown) |
Line 1: |
Line 1: |
- | <html> | + | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
- | | + | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
- | <body> | + | <head> |
- | | + | <title>iGEMGameV1_1</title> |
- | <div align="right"> | + | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
- | <object type="application/x-shockwave-flash" id="iGem" data="https://static.igem.org/mediawiki/2012/c/ce/UCalgary2012_FlashGame.swf" width="600px" height="400px" style="display: block !important; "><param name="menu" value="false"><param name="scale" value="noScale"><param name="allowFullscreen" value="true"><param name="allowScriptAccess" value="always"><param name="bgcolor" value="#FFFFFF"></object> | + | <style type="text/css" media="screen"> |
- | </div> | + | html, body { height:100%; background-color: #ffffff;} |
- | | + | body { margin:0; padding:0; overflow:hidden; } |
- | | + | #flashContent { width:100%; height:100%; } |
- | | + | </style> |
- | Enter your weight in kilograms and your height in centimeters in the form below and press the "Let's see" button (Please read disclaimer below before using this form)
| + | </head> |
- | | + | <body> |
- | <FORM NAME="BMI" method=POST>
| + | <div id="flashContent"> |
- | <TABLE border=1>
| + | <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="480" id="iGEMGameV1_1" align="middle"> |
- | <TR>
| + | <param name="movie" value="iGEMGameV1_1.swf" /> |
- | <TD><DIV ALIGN=CENTER>Your Weight (kg)</DIV></TD>
| + | <param name="quality" value="high" /> |
- | <TD><DIV ALIGN=CENTER>Your Height (cm)</DIV></TD> | + | <param name="bgcolor" value="#ffffff" /> |
- | <TD><DIV ALIGN=CENTER>Your BMI</DIV></TD>
| + | <param name="play" value="true" /> |
- | <TD><DIV ALIGN=CENTER>My Comment</DIV></TD> | + | <param name="loop" value="true" /> |
- | </TR>
| + | <param name="wmode" value="window" /> |
- | | + | <param name="scale" value="showall" /> |
- | <TR>
| + | <param name="menu" value="true" /> |
- | <TD><INPUT TYPE=TEXT NAME=weight SIZE=10 onFocus="this.form.weight.value=''"></TD>
| + | <param name="devicefont" value="false" /> |
- | <TD><INPUT TYPE=TEXT NAME=height SIZE=10 onFocus="this.form.height.value=''"></TD> | + | <param name="salign" value="" /> |
- | <TD><INPUT TYPE=TEXT NAME=bmi SIZE=8 ></TD> | + | <param name="allowScriptAccess" value="sameDomain" /> |
- | <TD><INPUT TYPE=TEXT NAME=my_comment size=35></TD> | + | <!--[if !IE]>--> |
- | </TABLE> | + | <object type="application/x-shockwave-flash" data="iGEMGameV1_1.swf" width="640" height="480"> |
- | | + | <param name="movie" value="iGEMGameV1_1.swf" /> |
- | <P>
| + | <param name="quality" value="high" /> |
- | <INPUT TYPE="button" VALUE="Let's see" onClick="computeform(this.form)"> | + | <param name="bgcolor" value="#ffffff" /> |
- | <INPUT TYPE="reset" VALUE="Reset" onClick="ClearForm(this.form)"> | + | <param name="play" value="true" /> |
- | </FORM>
| + | <param name="loop" value="true" /> |
- | | + | <param name="wmode" value="window" /> |
- | <HR> | + | <param name="scale" value="showall" /> |
- | | + | <param name="menu" value="true" /> |
- | | + | <param name="devicefont" value="false" /> |
- | <B>Disclaimer</B>: This form is based on the calculation of
| + | <param name="salign" value="" /> |
- | <A HREF="http://phaster.com/unpretentious/bmi.html"><I>"Body Mass Index"</I></A>
| + | <param name="allowScriptAccess" value="sameDomain" /> |
- | and is only meant to be a demonstration of how Javascript(tm) could be used
| + | <!--<![endif]--> |
- | on a Web Page. Information it contains may not be accurate and is not designed
| + | <a href="http://www.adobe.com/go/getflash"> |
- | or intended to serve as medical advice. I am not liable for any physical or
| + | <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> |
- | psychological damages suffered as a result of using this script.
| + | </a> |
- | <p>This free script provided by | + | <!--[if !IE]>--> |
- | <a href="http://javascriptkit.com">JavaScript
| + | </object> |
- | Kit</a></p>
| + | <!--<![endif]--> |
- | <hr> | + | </object> |
- | | + | </div> |
- | <SCRIPT LANGUAGE="JAVASCRIPT">
| + | </body> |
- | <!-- hide this script tag's contents from old browsers | + | |
- | | + | |
- | //Body Mass calculator- by John Scott (johnscott03@yahoo.com)
| + | |
- | //Visit JavaScript Kit (http://javascriptkit.com) for script
| + | |
- | //Credit must stay intact for use
| + | |
- | | + | |
- | function ClearForm(form){
| + | |
- | | + | |
- | form.weight.value = "999";
| + | |
- | 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) {
| + | |
- | alert("Hello");
| + | |
- | | + | |
- | 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> | + | |
- | | + | |
- | </body> | + | |
| </html> | | </html> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">