function GetParentByTagName(obj, tagName)
{
	return obj.tagName == tagName ? obj : (obj.parentNode ? GetParentByTagName(obj.parentNode, tagName) : null);
}
function HideFloatDivs()
{
	var obj = event.srcElement;
	var activeObject = GetParentByTagName(obj, "DIV");
	var linkObject = GetParentByTagName(obj, "A");
	if (linkObject) return false;
	var divs = document.body.getElementsByTagName("DIV");
	for (var i = 0; i < divs.length; i++)
	{
		var div = divs[i];
		if (div.style.position == "absolute" && div.style.visibility == "visible" && div != activeObject)
		{
			div.style.visibility = "hidden";
		}
	}
}

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function demo_bmi_DoFSCommand(command, args) {
	var demo_bmiObj = isInternetExplorer ? document.all.demo_bmi : document.demo_bmi;
    document.getElementById("bmiMin20").className = (args < 20) ? "highlight" : "normal";
    document.getElementById("bmi2025").className = (args >= 20 && args < 25) ? "highlight" : "normal";
    document.getElementById("bmi2530").className = (args >= 25 && args < 30) ? "highlight" : "normal";
    document.getElementById("bmi30Plus").className = (args >= 30) ? "highlight" : "normal";
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub demo_bmi_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call demo_bmi_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function demo_taille_DoFSCommand(command, args) {
	var demo_tailleObj = isInternetExplorer ? document.all.demo_taille : document.demo_taille;
    document.getElementById("tailleMin94").className = (args < 94) ? "highlight" : "normal";
    document.getElementById("taillen80102").className = (args >= 80 && args < 102) ? "highlight" : "normal";
    document.getElementById("taille88Plus").className = (args >= 88) ? "highlight" : "normal";
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub demo_taille_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call demo_taille_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}
