<!--
function swap(x){
	var str=x.src;
	if (str.indexOf('_h.gif')==-1){
		str=str.replace('.gif','_h.gif');
	}
	x.src=str;
}
function swapBack(x){
	var str=x.src;
	if (str.indexOf('_h.gif')){
		str=str.replace('_h.gif','.gif');
	}
	x.src=str;
}
function hide(){
	var allDivsnavcontainer=document.getElementById('navcontainer').getElementsByTagName("DIV");
	for (var j=0; j<allDivsnavcontainer.length; j++){
		allDivsnavcontainer[j].style.visibility='hidden';
	}
}
function show(m){
	hide();
	document.getElementById(m).style.visibility='visible';
}
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=640,height=480,left = 192,top = 144');");
}
function popUpLarge(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=600,left = 112,top = 84');");
}
var ic = 5;     // Number of alternative images
function pickRandom(range) {
if (Math.random)
return Math.round(Math.random() * (range-1));
else {
var now = new Date();
return (now.getTime() / 1000) % range;
}
}
var choice = pickRandom(ic);

// Body Mass Index Calculator

function stripBlanks(fld) {
	var result = "";
	var c = 0;
	for (i=0; i < fld.length; i++) {
		if (fld.charAt(i) != " " || c > 0) {
			result += fld.charAt(i);if (fld.charAt(i) != " ") c = result.length;
		}
	}
	return result.substr(0,c);
}

function calc(thisform) {
	var d = "2.54,2.2";
	cv = d.split(',');
	var h1 = stripBlanks(thisform.h1.value);
	var h2 = stripBlanks(thisform.h2.value);
	var h = Number(h1 * 12) + Number(h2);
	if (h == '') {
		alert("You must enter your height");
		thisform.h1.focus();
		return false;
	}
	if (h != Number(h) || (h = Number(h*cv[0]/100)) < 1 || h > 2.5) {
		alert("Invalid height entered");
		thisform.h.focus();
		return false;
	}
	var w = stripBlanks(thisform.w.value);
	if (w == '') {
		alert("You must enter your weight");
		thisform.w.focus();
		return false;
	}
	if (w != Number(w) || (w = Number(w/cv[1])) < 25 || w > 250) {
		alert("Invalid weight entered");
		thisform.w.focus();
		return false;
	}
	thisform.f.value = Math.round(w / (h*h)*100)/100;
}

//-->