<!-- hide from old browsers


function ClearFormkg (form) {

	form.weight.value="";

	form.waist.value="";

	form.bodyfat.value="";

}


function VerifyFormkg(form) {

	

	// Holds whether or not the form is correct

	var Correct = true;



	// Check for missing fields

	if (form.weight.value == null || form.weight.value.length == 0 ||

	form.waist.value == null || form.waist.value.length == 0) {

		alert ("\nPlease fill in all of the form elements");

		Correct = false;

	}

	

	// Check that only numbers are in the weight and waist fields

	else {

		// Holds the floats representing the weight and waist

		var TestWeight;

		var TestWaist;



		// Parse the weight and waist values and put in the variables

		TestWeight = parseFloat(form.weight.value);

		TestWaist = parseFloat(form.waist.value);



		// Check to see that TestWeight is a number

		if (isNaN (TestWeight)) {

			alert("\nMake sure to enter the weight\nas a number.");

			Correct = false;

			form.weight.value="";

		}



		// Check to see that TestWaist is a number

		if (isNaN (TestWaist)) {

			alert("\nMake sure to enter the waist size\nas a number.");

			Correct = false;

			form.waist.value="";

		}

	

		// Check that the TestWeight is greater than 0

		if (TestWeight <= 0) {

			alert("\nCome on.  Enter a real weight.");

			Correct = false;

			form.weight.value="";	

		}



		// Check that the TestWaist is greater than 0

		if (TestWaist <= 0) {

			alert("\nCome on.  Enter a real waist size.");

			Correct = false;

			form.waist.value="";	

		}



	}



	// If the inputs are correct, calculate the bodyfat percent

	if (Correct) {

		

		// Holds the bodyfat number and percent

		var BF;

		var BFPercent;


			TestWaist=TestWaist/2.54;

			TestWeight=TestWeight*2.2;

		// Make the male calculations	

		if (form.gender[0].checked) {

			BF = -98.42 + (4.15*TestWaist) - (.082*TestWeight);

		}



		// Make the female calculations
		else {

			BF = -76.76 + (4.15*TestWaist) - (.082*TestWeight);

		}

		

		// Calculate the bodyfat percentage

		BFPercent = BF / TestWeight;

		BFPercent = BFPercent * 100;

		BFPercent = Math.round(BFPercent);



		// Send this number to the screen

		form.bodyfat.value = BFPercent + "%";

	}

}

// finish hiding from old browsers -->