
		function calculateBMI(form) {
			var fieldsPresent = allFieldsPresent(form);
			var fieldsNumeric = allFieldsNumeric(form);
			if(!fieldsPresent || !fieldsNumeric) return;
		
			var weight = parseInt(form.weight.value);

			//Start: Added by Infosys technologies Ltd QuickBase#1521
			if(form.weightSystem.value == "kg")
				weight = weight*2.2;
			//End: Added by Infosys technologies Ltd QuickBase#1521
				
			var height;

			//Start: Added by Infosys technologies Ltd QuickBase#1521
			var feet = form.unit.value;
			var inches = form.subunit.value;
			//End: Added by Infosys technologies Ltd QuickBase#1521

			//Start: Added by Infosys technologies Ltd QuickBase#1521
			if(form.heightSystem.value == "feet"){
				height = parseInt(feet*12)+parseInt(inches);
				form.feet.value=feet;
				form.inches.value=inches;
			}
			else{
				height = (parseInt(feet*100)+parseInt(inches))/2.54;
				form.feet.value= parseInt(feet*100)+parseInt(inches);	
			}
			//End: Added by Infosys technologies Ltd QuickBase#1521
			
			var bmi=(weight/(height*height))*703;
			form.bmi.value=Math.round(bmi*10)/10;
			
			form.submit();
		}
		
		//Modified by Infosys Tech Ltd
		function allFieldsPresent(form) {
			var allPresent=true;
			if(form.weight.value=="") {
				document.getElementById("weightRequired").style.visibility="visible";
				allPresent=false;
			}
			if(form.unit.value=="") {
				document.getElementById("feetRequired").style.visibility="visible";
				allPresent=false;
			}
			if(form.subunit.value=="") {
				document.getElementById("inchesRequired").style.visibility="visible";
				allPresent=false;
			}
			return allPresent;
		}

		//Modified by Infosys Tech Ltd
		function allFieldsNumeric(form) {
			if(!isDigit(form.weight.value) ||
				 !isDigit(form.unit.value) || !isDigit(form.subunit.value)) {
				document.getElementById("numbersRequired").style.visibility="visible";
				return false;
			}
			document.getElementById("numbersRequired").style.visibility="hidden";
			return true;
		}
		
		function isDigit(d) {   
				var i;
		    for (i = 0; i < d.length; i++) {   
		        var c = d.charAt(i);
		        if (((c < "0") || (c > "9"))) return false;
		    }
		    return true;
		}
