startList = function() {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementById("nav");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
	
	window.onload=startList;
	
map_popup = function(){
	MyWindow=window.open('map.html','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=485,height=540'); 
	return false;
	}
	
sendinfo_popup = function(){
	MyWindow=window.open('sendinfo.php','MyWindow2','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=485,height=450'); 
	return false;
	}
	
function validate_email(field,alerttxt){
	with (field){
		apos=value.indexOf("@")
		dotpos=value.lastIndexOf(".")
		if (apos<1||dotpos-apos<2){
			alert(alerttxt);
			return false;
		}else{
			return true;
		}
	}
}

function validate_required(field,alerttxt){
	with (field){
		if (value==null||value==""){
			alert(alerttxt);
			return false;
		}else{
		return true;
		}
	}
}
	
function validate_form(thisform){
	with (thisform){
		if(validate_required(navn,"Du skal udfylde dit Navn!")==false){
			navn.focus();
			return false;
		}
		if(validate_required(email,"Du skal udfylde din e-mail-adresse!")==false){
			email.focus();
			return false;
		}else if (validate_email(email,"Dette er ikke en gyldig e-mail-adresse")==false){
			email.focus();
			return false;
		}
		if(validate_required(kommentar,"Du skal udfylde en kommentar!")==false){
			kommentar.focus();
			return false;
		}
	}
}
function bmi()
{

if (isNaN(parseInt(document.example.hojde.value))) {
   alert("Du skal angive din højde i cm.");
   return false;
}

if (isNaN(parseInt(document.example.vagt.value))) {
   alert("Du skal angive din vægt i kg.");
   return false;
}


var hojde=eval(document.example.hojde.value/100);

var vagt=document.example.vagt.value;

var bmi=eval(vagt/(hojde*hojde));

var bmi=String(bmi);

var bmi=bmi.slice(0,4);

document.example.answer.value=bmi;

}

