function CalcIt(form) {
	
	form.final.value = 1;
height =  Number(form.ht.value);
	if (form.hu.selectedIndex == 0) {		//  if height units are "inches"
		heightInches = height;
		heightMeters = height * 2.54 / 100;
	} else {									// else if height units are "cm".
		heightInches = height / 2.54;
		heightMeters = height / 100;
	}
	form.final.value =heightInches;
 

	if (form.Gender.selectedIndex == 1)  {  // sex is female.
		  // Devine Formula
			idPivot = 45.5;
			idSlope = 2.3;
		
		
	} else {								// sex is male.
		
			idPivot = 50;
			idSlope = 2.3;
		
	}
	
	var idKg = idPivot + idSlope * (heightInches - 60);
	form.final.value =rounding(idKg,10);
	return true;}
function feetAndInches(form) {
	var inchies = 1;


	if (form.hu.selectedIndex == 0) form.ht.value = inchies;
	if (form.hu.selectedIndex == 1) form.ht.value = rounding( inchies * 2.54,0);
	return true;
}
function inchesCm(form) {
	var height = Number(form.ht.value);
	if (height > 0) {
		if (form.hu.selectedIndex == 0) { // is now inches, was cm.
			
			form.ht.value = rounding( height / 2.54,1) ; 
		} else {
			form.ht.value = rounding( height * 2.54,0);  }  
		form.ht.select()
		form.ht.focus()
	}
	return true;
}
function rounding(number,decimal) {
	multi = Math.pow(10,decimal);
	number = Math.round(number * multi) / multi;
	return number;
}
