function hover_subnav (ele, state, navbullit) {
	document.getElementById(navbullit).src = state ? "img/arrow_right_orange.gif" : "img/arrow_right_grey.gif";
}

function hover_subnav2 (ele, state, navbullit) {
	document.getElementById(navbullit).src = state ? "img/arrow_right_orange.gif" : "img/arrow_right_grey.gif";
}

function hover_nav_minisite (ele, state, navbullit, kleur) {
	document.getElementById(navbullit).src = state ? "img/arrow_right_minisite"+kleur+".gif" : "img/arrow_right_grey.gif";
}

var closeTimer, activeMenu;
var startLeft = 0;

var hideElements = new Array ();

function hover_nieuws (ele, state) {
	ele.style.backgroundColor = state ? "#af1e2d" : "#000000";
}

function hover (ele, state) {
	ele.style.backgroundColor = state ? "#af1e2d" : "#af1e2d";

	if (state && closeTimer)
		clearTimeout (closeTimer);
	
	if (!state)
		timedClose();
}

function openMenu (id, ele) {
	if (closeTimer)
		clearTimeout (closeTimer);

	if (activeMenu)
		activeMenu.style.visibility = "hidden";

	activeMenu = document.getElementById ("ddmenu" + id);
	activeMenu.style.left = (startLeft + ele.offsetLeft) + 'px';
	activeMenu.style.visibility = "visible";

	for (var i=0; i<hideElements.length; i++) {
		document.getElementById(hideElements[i]).style.visibility = 'hidden';
	}
}

function timedClose () {
	if (closeTimer)
		clearTimeout (closeTimer);
	closeTimer = setTimeout ("_timedClose()", 500);
}

function _timedClose () {
	if (activeMenu) {
		activeMenu.style.visibility = "hidden";
		activeMenu = null;
	}

	for (var i=0; i<hideElements.length; i++) {
		document.getElementById(hideElements[i]).style.visibility = 'visible';
	}
}

function ddnav (url, target, width, height) {
	if (target == "huidig")
		location.href = url;
	else if (target == "nieuw")
		window.open (url);
	else if (target == "popup")
		openPopup (url, "popup", width, height, 1);
	
	return false;
}

function openPopup (url, name, w, h, resizable) {
	var resizable = resizable || 0;
	var opt = "toolbar=0,location=0,scrollbars="+resizable+",directories=0,status=0,menubar=0,resizable="+resizable+","
				+"width="+w+",height="+h+",left="+parseInt((screen.width-w)/2)+",top="+parseInt((screen.height-h)/3);
	var wh = window.open(url, name, opt);
	wh.focus ();
}

function openLogin () {
	openPopup ('login.php', 'login', 350, 180, 0);
	return false;
}

function openLogout () {
	openPopup ('logout.php', 'logout', 350, 180, 0);
	return false;
}

function printv () {
	openPopup ("printv.php", "print", 600, 500, 1);
	return false;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

