home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prez / amiga / KidHTML1_25.lha / KidHTML1.25 / Script / caloriescalc.js < prev    next >
Text File  |  1998-08-25  |  2KB  |  75 lines

  1.  
  2.  
  3. <!-- TWO STEPS TO INSTALL CALORIES BURNED:
  4.  
  5.    1.  Paste the specified coding into the HEAD of your HTML document
  6.    2.  Put the last code into the BODY of your HTML document  -->
  7.  
  8. <!-- STEP ONE: Copy this code into the HEAD your HTML document  -->
  9.         
  10. <HEAD>
  11.  
  12. <SCRIPT LANGUAGE="JavaScript">
  13.  
  14. <!-- This script and many more are available online from -->
  15. <!-- The JavaScript Source!! http://javascriptsource.com -->
  16.  
  17. <!-- Begin
  18. var myWeight;
  19. var myDistance;
  20. function HowMany(form) {
  21. var difference;
  22. difference = (myDistance * myWeight) * .653;
  23. form.Fdiff.value = difference;
  24.     
  25. if (difference < 100) {
  26. form.comment.value="You better start working!";
  27. }
  28. if (difference >  101 && difference < 200) {
  29. form.comment.value="Nice run, but you can do better.";
  30. }
  31. if (difference >  201 && difference < 300) {
  32. form.comment.value="Very good!  Push above 300 next time.";
  33. }
  34. if (difference >  301 && difference < 500) {
  35. form.comment.value="Great!  Your a runner.....keep it up!";
  36. }
  37. if (difference >  501 && difference < 700) {
  38. form.comment.value="Bill Rogers move over!";
  39. }
  40. if (difference > 701) {
  41. form.comment.value="Your my hero!  Have a jelly doughnut.";  
  42. }
  43. }
  44. function SetMyWeight(weight) {
  45. myWeight = weight.value;
  46. }
  47. function SetmyDistance(dis) {
  48. myDistance = dis.value;
  49. }
  50. function ClearForm(form){
  51. form.myWeight.value = "";
  52. form.myDistance.value = "";
  53. form.Fdiff.value = "";
  54. form.comment.value = "";
  55. }
  56. // End -->
  57. </SCRIPT>
  58.  
  59. <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  60.  
  61. <BODY>
  62.  
  63. <CENTER>
  64. <FORM METHOD="POST">
  65. <TABLE border=3>
  66. <TR>
  67. <TR>
  68. <TD><div align=center>Your<br>Weight</div></TD>
  69. <TD><div align=center>Miles<br>run</div></TD>
  70. <TD><div align=center>Calories<br>burned</div></TD>
  71. <TD><INPUT TYPE=BUTTON ONCLICK="HowMany(this.form)" VALUE="Calculate"></TD>
  72. </TR>
  73. <tr>
  74. <TD><div 
  75.