/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
/*--------------- DANIEL PEDERSEN @ FYNSKE MEDIER ---------------*/
/*------------------------- 27-04-2011 --------------------------*/
/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
var closetimer;
/*---------------------------------------------------------------*/
function topmenu_control(head,show,allheads,subs) {

	allheads = allheads.split(",");
	
	if(show == 1) {
		clearTimeout(closetimer);
		var c = 0;
		while(c < allheads.length) {
			if(allheads[c] != head) {
				topmenu_closesub(allheads[c]);
			}
			c++;
		}
	}
	
	var timeout_out = 300;
	var timeout_in = 200;

	if(show == 1) {
		document.getElementById("topmenu_head_"+head).style.backgroundColor = "#a4a4a4";
		document.getElementById("topmenu_head_"+head).style.fontWeight = "bold";
		if(subs > 0) {
			document.getElementById("topsubmenu_"+head).style.display = "block";
			document.getElementById("breadcrumbs").style.display = "none";
		}
	} else {
		closetimer = setTimeout("topmenu_closesub("+head+")",timeout_out);
	}

}
/*---------------------------------------------------------------*/
function topmenu_closesub(head) {

	document.getElementById("topsubmenu_"+head).style.display = "none";
	document.getElementById("topmenu_head_"+head).style.backgroundColor = "";
	document.getElementById("topmenu_head_"+head).style.fontWeight = "normal";
	document.getElementById("breadcrumbs").style.display = "block";
	
}
/*---------------------------------------------------------------*/
/*------------------------- END OF FILE -------------------------*/
/*---------------------------------------------------------------*/
