function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
}



function screening() {
	var checkCounter = 0;
	var screeningMesg;
	document.getElementById("screening-score").style.display = "block";
	for (var i=1; i<=9; i++) {
		if (document.getElementById("check" + i).checked == true) {
			checkCounter++;
		}
	}
	if (checkCounter < 8) {
		document.getElementById("screening-mesg").innerHTML = 
		"如果你有一個或多個空格未勾選，即表示你可能需要和醫生討論患糖尿病的風險，以及應採取以降低罹病風險的措施。";
	} else {
		document.getElementById("screening-mesg").innerHTML  = "恭喜！你得糖尿病的風險可能不高。" ;	
	}
}


/*  CALCULATE BMI  */
function calcEnglish(form, feet, inches, pounds) {
   if ((! inches) || isNaN(inches)){
	   inches = 0;
   }
   
   if ((pounds <= 0) || isNaN(pounds)){
	   alert ('Please enter your weight.');
	   return false;
   }
   
      if (((inches <= 0) || isNaN(inches)) && ((feet <= 0) || isNaN(feet))){
	   alert ('Please enter your height.');
	   return false;
   }
   
   TotalInches = eval(feet*12) + eval(inches)
   form.calcval.value = Math.round(pounds * 703 * 10 / TotalInches / TotalInches) / 10
   return false;
}

function calcMetric(form, meters, kilograms) {
	if ((kilograms <= 0) || isNaN(kilograms)){
		alert ('Please enter your weight.');
		return false;
	}
	if ((meters <= 0) || isNaN(meters)){
		alert ('Please enter your height.');
		return false;
	}

	form.calcval.value = Math.round(kilograms * 10 / meters / meters) / 10
}

