<!-- dropdownmenu -->
function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.mac = (navigator.userAgent.indexOf("Mac") != -1); 
	this.opera = (navigator.userAgent.indexOf("Opera") != -1); 
	this.min = (this.ns||this.ie)
}
var browser = new BrowserCheck();

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

var openMenu = null;
var activeMenu = null;
function LBM_openMenu(menu, dropdownId, offsetX, offsetY){
	// stop menu close timer
	LBM_hideTimerIntercepted();
	
	// if an open menu exists, hide it (also strips style classes)
	if(openMenu != null){
		LBM_hideDiv(openMenu);
	}
	openMenu = dropdownId;
	
	// if an menu with the active class exists, remove the class
	if(activeMenu != null){
		activeMenu.className="";
		//alert("we vinden iets");
	}
	activeMenu = menu;
	
	// find the dropdown to open
	object = MM_findObj(dropdownId);

	// if nu dropdown was found, return
	if(object == null){
		return;
	}
	
	// set active class for this menu
	menu.className="active";

	offsetY += LBM_getOffsetY(menu);
	offsetX += LBM_getOffsetX(menu);
	
	object.style.top = offsetY + menu.offsetHeight + "px";
	object.style.left = offsetX + "px";
	
	// make dropdown visible
	object.style.visibility='visible';
	
	// position IFrame
	LBM_positionIFrame(object);
}

var timer = null;
function LBM_hideTimerStart(elemid){
	// stop menu close timer
	LBM_hideTimerIntercepted();
	// start a new timer
	var f = "LBM_hideDiv('" + elemid + "')";
	timer = setTimeout(f,500);
}
function LBM_hideTimerIntercepted(){
	// if a timer exists, stop it
	if(timer != null){
		clearTimeout(timer);
	}
}
function LBM_hideDiv(elemid){
	// close the menu
	if((elem = MM_findObj(elemid)) != null){
		elem.style.visibility="hidden";
		if(activeMenu != null){
			activeMenu.className="";
		}
		LBM_hideIFrame();
	}
}

function LBM_positionIFrame(elem){
	if(browser.ie){
		IfrRef = document.getElementById("DivShim");
		if(IfrRef == null){
			IfrRef = LBM_createIFrame();
		}
		if(IfrRef != null){
			IfrRef.style.width = elem.offsetWidth;
			IfrRef.style.height = elem.offsetHeight;
			IfrRef.style.top = elem.style.top;
			IfrRef.style.left = elem.style.left;
			IfrRef.style.zIndex = elem.style.zIndex;
			IfrRef.style.display = "block";
		}
	}
}
function LBM_hideIFrame(){
	if(browser.ie){
		IfrRef = document.getElementById("DivShim");
		if(IfrRef != null){
			IfrRef.style.display = "none";
		}
	}
}
function LBM_createIFrame(){
	body = document.getElementsByTagName("body");
	IfrRef = document.createElement("iframe");
	IfrRef.id = "DivShim";
	IfrRef.src="javascript:false;";
	IfrRef.scrolling="no";
	IfrRef.frameborder="0";
	IfrRef.style.position="absolute";
	IfrRef.style.top="0";
	IfrRef.style.left="0"; 
	IfrRef.style.display="none";
	body[0].appendChild(IfrRef);
	return IfrRef;
}

function LBM_getOffsetX(node){
	var offsetX = node.offsetLeft;
	
	var parentOffsetNode = node.offsetParent;
	while(parentOffsetNode != null){
		offsetX += parentOffsetNode.offsetLeft;
		parentOffsetNode = parentOffsetNode.offsetParent;
	}	
	
	return offsetX;
}

function LBM_getOffsetY(node){
	var offsetY = node.offsetTop;
	
	var parentOffsetNode = node.offsetParent;
	while(parentOffsetNode != null){
		offsetY += parentOffsetNode.offsetTop;
		parentOffsetNode = parentOffsetNode.offsetParent;
	}
	
	return offsetY;
}

/* -|-|-|- OPENWINDOWS  -|-|-|- */
function openWindow(myurl) {
	window.open(myurl,'mywindow','width=380,height=370');
}
/* -|-|-|- forumProfilePop(x) -|-|-|- */
function forumProfilePop(x) {
	var winHan = window.open(x + '&popup=1','profile','width=400,height=300');
	winHan.focus();
}

