/*Aanroep vanuit de site

onmouseover="openMenu('ddmenu703',this)" onmouseout="timedClose()

*/

var GBcloseTimer, GBactiveMenu, activeEle;
var GBstartLeft = 5;

function hover (ele, state) {
	if (state && GBcloseTimer)
		clearTimeout (GBcloseTimer);
	
	if (!state)
		timedClose();
}



function openMenu (id, ele) {

	activeEle = ele;
	
	if (GBcloseTimer)
		clearTimeout (GBcloseTimer);

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

	if (id) {
	  GBactiveMenu = document.getElementById (id);
	  GBactiveMenu.style.left = (GBstartLeft + activeEle.offsetLeft) + 'px';
	  var jochem = document.getElementById('ddmenuIframe');
	  jochem.style.left = (parseInt(GBactiveMenu.style.left))+'px';
	  jochem.style.width = GBactiveMenu.style.width;
		jochem.style.height = GBactiveMenu.style.height;
		jochem.style.visibility = 'hidden';
		
		GBactiveMenu.style.visibility = "visible";
		
	}
}

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

function _timedClose () {
	if (GBactiveMenu) {
		GBactiveMenu.style.visibility = "hidden";
		GBactiveMenu = null;
	}
	if (activeEle) {
		activeEle.style.backgroundColor = "transparent";
		activeEle = null;
	}
	//var jochem = document.getElementById('ddmenuIframe');
  //jochem.style.visibility = 'hidden';

}

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);
	window.open(url, name, opt);
}

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