function calc()	{
				
	var feet = document.bmi_calc.feet.value;
	var inches = document.bmi_calc.inches.value;
	var weight = document.bmi_calc.weight.value;
					
	if ( feet !="" && inches !="" && weight !="" ) {
		
		// initialize variables
		var centimeters = 0;
		var meters = 0;
		var kilograms = 0;
		var bmi = 0;
		var left=0;
		var total_inches = 0;
		
		inches =inches *1;
		feet = feet*1;
		// convert height to metric:
		// 1 inch is 2.54 centimeters
		total_inches = inches + (feet * 12);
		//alert(total_inches);
		
		
		// convert pounds to kilograms:
		// 1 kg = 0.4536 pounds
		
		kilograms = weight / 0.4536
		 
		// calculate BMI
		//bmi = kilograms / Math.pow(meters,2);
		
		bmi=weight*703/Math.pow(total_inches,2);
		bmi=Math.round(bmi*10)/10;
		
		
		// write the BMI to the form
		document.bmi_calc.result.value = bmi;
		
		// write the scale 
		document.bmi_calc.normal.value=Math.round(18.5*Math.pow(total_inches,2)*10/703)/10
		document.bmi_calc.overweight.value=Math.round(25*Math.pow(total_inches,2)*10/703)/10
		document.bmi_calc.obese1.value=Math.round(30*Math.pow(total_inches,2)*10/703)/10
		document.bmi_calc.obese2.value=Math.round(35*Math.pow(total_inches,2)*10/703)/10
		document.bmi_calc.obese3.value=Math.round(40*Math.pow(total_inches,2)*10/703)/10

		// move the pointer
		left = ((420 * (bmi-15)) / 30);
		
		document.getElementById('marker').style.left = left + "px";
		
		return;
		
		} // end calculate and move stuff around
	else {
		return ;
		} // end what to do when the values aren't all filled in.
	
	} // end function

