<?xml version="1.0" encoding="utf-8"?>
<!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" 
  xmlns:widget="http://www.netvibes.com/ns/">
  <head>
 
    <meta name="author" content="www.muskel-tipps.de" />
    <meta name="description" content="With this Windows Vista Widget the body fat percentage can be determined. This version is for men." />
 	<meta name="website" content="http://www.muskel-tipps.de" />
 	<meta name="keywords" content="fat, bodyfat, bodyfat percentage, fat percentage, calculator, fitness, health, women" />
    <meta name="apiVersion" content="1.0" />
    <meta name="autoRefresh" content="20" />
    <meta name="debugMode" content="true" />
    <meta name="screenshot" content="http://www.muskel-tipps.de/gadgets/netvibes/koerperfettanteil-mann.png" />
    <meta name="thumbnail" content="http://www.muskel-tipps.de/gadgets/netvibes/muskel-tipps-small.png" />
 
    <link rel="stylesheet" type="text/css" 
      href="http://www.netvibes.com/themes/uwa/style.css" />
    <script type="text/javascript" 
      src="http://www.netvibes.com/js/UWA/load.js.php?env=Standalone"></script>
 
    <title>Bodyfat percentage - men</title>
    <link rel="icon" type="image/png" 
      href="http://www.muskel-tipps.de/favicon.ico" />
    <link rel="rich-icon" type="image/png"
  	  href="http://www.muskel-tipps.de/gadgets/netvibes/muskel-tipps.png"/>

 
<!-- Add your UWA preferences as needed -->
    <widget:preferences>
    </widget:preferences>
 
    <style type="text/css">
     /* Add your CSS rules */
    </style>
 
    <script type="text/javascript">
// this is just some sample code
// you can/should delete it all to place your own code instead
 
// this is how you would declare a global JS object
      var YourWidgetName = {};
 
      // this is how you would declare a global JS variable
      YourWidgetName.yourVariable = "My value";
 
      // this is how you would declare a global 'display()' function
      YourWidgetName.display = function(argument) {
        // display code
      }
 
      // widget.onLoad is the first method called,
      // nothing can be done without it,
      // the rest of the code must be triggered from here.
      widget.onLoad = function() {
        UWA.Data.getFeed(widget.getValue('url'), YourWidgetName.display); 
        var knopf = widget.body.getElementsByClassName("Berechne")[0];
 		knopf.onclick = rechne;
        }
  function rechne() {
  groesse = document.Rechner.Groesse.value;
  bauch = document.Rechner.Bauch.value;
  hals = document.Rechner.Hals.value;
  ze = (bauch * 1) - (hals * 1)
  logmasse = Math.log(ze) / Math.log(10)
  loggrroesse = Math.log(groesse) / Math.log(10)
  fett = 495 / ( 1.0324 - 0.19077 * logmasse + 0.15456 * loggrroesse) - 450
  fett = Math.round(fett)
  document.Rechner.Fett.value = fett;
  return false; // wichtig, damit das Ergebnis stehen bleibt!
  }
      // you can move your start up code to your own method:
      // simply use widget.onLoad = myObject.myStartupMethod;
  </script>
  </head>
  <body>
  <p><img src="http://www.muskel-tipps.de/gadgets/netvibes/banner.jpg" alt="Fitness" /></p>
  <form name="Rechner">
    <table width="280" border="0">
        <tbody>
            <tr>
                <td>Height in cm</td>
                <td><input type="text" id="Groesse" size="15" name="Groesse" /></td>
            </tr>
            <tr>
                <td>Neck at narrowest point</td>
                <td><input type="text" id="Hals" size="15" name="Hals" /></td>
            </tr>
            <tr>
                <td>Waist size at your naval</td>
                <td><input type="text" id="Bauch" size="15" name="Bauch" /></td>
                <td><input type="reset" value="Reset" /></td>
            </tr>
            <tr>
                <td>Body fat percentage</td>
                <td><input type="text" disabled="disabled" size="15" name="Fett" /></td>
                <td><input type='button' class='Berechne' value="Calculate" /> </td>
            </tr>
            <tr>
            <td><br /></td>
            </tr>
            <tr>
            <th colspan="2">What does it mean?</th>
            <td><input type='button' onclick="widget.openURL('http://www.muskel-tipps.de/index.php/Ernaehrung/Koerperfettanteil.html');" value="Info..." /></td>
            </tr>
        </tbody>
    </table>
</form>
</body>
</html>