/*
Designed by <theFactor.e>
http://www.tfe.nl

CVS Header Information:  
    $Source$
    $Revision$
    $Date$
    $Name$
    $Author$
*/

<!--
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();

/* -|-|-|- ALGEMEEN  -|-|-|- */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}

function addUnLoadEvent(func) {
	var oldonunload = window.onunload;
	if (typeof window.onunload != 'function') {
		window.onunload = func;
	} else {
		window.onunload = function() {
			if (oldonunload) {
				oldonunload();
			}
			func();
		}
	}
}

/* -|-|-|- SHOWDIV  -|-|-|- */
var zetindex='1000';
function showDiv(x) {
	if (document.all || document.getElementById) {
		if(document.getElementById) {
			el = document.getElementById(x);
		} else {
			el = document.all[x];
		}
	}
	else {
		if (document.layers) {
			var q0=document.layers,dd="";
			for(var s=0;s<q0.length;s++) {
				dd='document.'+q0[s].name;
				if(eval(dd+'.document.'+x)) {
					el=eval(dd+'.document.'+x);
					break;
				}
			}
		}
	}
	if (el) {
		el.style.display='block'; 
		if (document.layers) el.style.visibility='visible';
		el.style.zIndex=zetindex;
		if (x.substring(0,6) == 'topnav') { 
			if (!browser.opera) TFE_positionIFrame(el); // Extra iframe voor topmenu's om over pulldowns te gaan, behalve voor Opera, die snapt het gewoon
		}
		zetindex++;
	}
}

function hideDiv(x) {
	if (document.all || document.getElementById) {
		if(document.getElementById) {
			el = document.getElementById(x);
		} else {
			el = document.all[x];
		}
	}
	else {
		if (document.layers) {
			var q0=document.layers,dd="";
			for(var s=0;s<q0.length;s++) {
				dd='document.'+q0[s].name;
				if(eval(dd+'.document.'+x)) {
					el=eval(dd+'.document.'+x);
					break;
				}
			}
		}
	}
	if (el) {
		el.style.display='none'; 
		if (document.layers) el.style.visibility='hidden';
		if (x.substring(0,6) == 'topnav') TFE_hideIFrame(el); // Extra iframe voor topmenu's om over pulldowns te gaan
	}
}
function buttonNormal(x) {
	$("div." + x + " div.button").css("background-position", "0 0");
}
function buttonHover(x) {
	$("div." + x + " div.button").css("background-position", "0 -25px");
}

/* -|-|-|- SHOWMENU  -|-|-|- */
var timeout=0;
function showMenu(x) {
	hideLeft();
	clearTimeout(timeout);
	showDiv(x);

}
function showMenu2(x) {
	hideLeft();
	clearTimeout(timeout);
	hideIt();
	showDiv(x);
	buttonHover(x);
}
function hideMenu() {
	timeout=setTimeout('hideIt()',1000);
}
function hideIt() {
	
	buttonNormal('menu1');
	buttonNormal('menu2');
	buttonNormal('menu3');
	buttonNormal('menu4');
	
	hideDiv('menu1');
	hideDiv('menu2');
	hideDiv('menu3');
	hideDiv('menu4');
	hideDiv('topnav1');
	hideDiv('topnav2');
	hideDiv('topnav3');
	hideDiv('topnav4');
	hideDiv('topnav5');
}

function TFE_positionIFrame(elem){
	if(browser.ie){
		IfrRef = document.getElementById("DivShim");
		if(IfrRef == null){
			IfrRef = TFE_createIFrame();
		}
		if(IfrRef != null){
			IfrRef.style.width = elem.offsetWidth;
			IfrRef.style.height = elem.offsetHeight;
			IfrRef.style.top = elem.offsetTop;
			IfrRef.style.left = elem.offsetLeft;
			IfrRef.style.zIndex = elem.style.zIndex-1;
			IfrRef.style.display = "block";
		}
	}
}
function TFE_hideIFrame(){
	if(browser.ie){
		IfrRef = document.getElementById("DivShim");
		if(IfrRef != null){
			IfrRef.style.display = "none";
		}
	}
}
function TFE_createIFrame(){
	var topmenu = document.getElementById("topmenu");
	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";
	topmenu.appendChild(IfrRef);
	return IfrRef;
}

/* -|-|-|- SETPOS  -|-|-|- */
function setPos(ob,x,y) {
	var lm = MM_findObj(ob);
	lm.style.left = x + 'px';
	lm.style.top = y + 'px';
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj) {
	var curtop = 0-window.document.body.offsetTop;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

/* -|-|-|- SHOWLEFTMENU  -|-|-|- */
function showLeftMenu(ob) {
	hideIt();
	clearTimeout(timeout);
	showDiv(ob);
}

function showLeftMenuLinkRoot(links,submenu,xp,yp) {
	hideLeft();
	hideIt();
	var linkobj = MM_findObj(links);
	var yyy = findPosY(linkobj)-yp;
	setPos(submenu,'180',yyy);
	clearTimeout(timeout);
	showDiv(submenu);
}
function showLeftMenuLinkRoot2(links,submenu,xp,yp) {
	hideLeft();
	hideIt();
	var linkobj = MM_findObj(links);
	var yyy = findPosY(linkobj)-yp;
	if(browser.ie) setPos(submenu,'196',yyy);
	else setPos(submenu,'180',yyy);
	clearTimeout(timeout);
	showDiv(submenu);
}
function showLeftMenuLink(links,submenu,xp,yp) {
	hideIt();
	var linkobj = MM_findObj(links);
	var xxx = linkobj.offsetWidth+xp+30;
	var yyy = findPosY(linkobj)-yp+1;
	setPos(submenu,xxx,yyy);
	clearTimeout(timeout);
	showDiv(submenu);
}
function hideLeftMenu() {
	timeout=setTimeout('hideLeft()',1000);
}
function hideLeft() {
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == 'dropdown1' || x[i].className == 'dropdown2')
			x[i].style.display='none';
	}
}
function hideLeft2() {
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == 'dropdown2')
			x[i].style.display='none';
	}
}

function setPos(ob,x,y) {
	var lm = MM_findObj(ob);
	lm.style.left = x + 'px';
	lm.style.top = y + 'px';
}

/* -|-|-|- SHOWSEARCH  -|-|-|- */
function showSeach() {
	if (document.getElementById('searchLayer').style.display == 'block') {
		document.getElementById('searchLayer').style.display = 'none';
		document.getElementById('arrowmoreoptions').src = 'images/ar_orangeleft.gif';
		
	} else {
		document.getElementById('searchLayer').style.display = 'block';
		document.getElementById('arrowmoreoptions').src = 'images/ar_orangedown.gif';
	}
}

function setBodyHeight() {
	if (browser.ie) {
		document.body.style.height=document.documentElement.scrollHeight+'px';
	}
}

window.onload=setBodyHeight;

var stdto2;
var stdtotime = 1500;
var divShown = '';

function showToolDiv(x, on) {
	if (stdto2 != null) window.clearTimeout(stdto2);
	if (on == 1 && divShown != x) {
		showToolDiv(divShown,0);
	} else if (on == 2) {
		//stdto2 = window.setTimeout('showToolDiv2()',stdtotime);
		return;
	}
	if (document.getElementById('t' + x)) {
		document.getElementById('t' + x).className = (on == 1) ? 'searchtoolsover' : 'searchtools';
		document.getElementById('d' + x).style.display = (on == 1) ? 'block' : 'none';
		document.getElementById('d' + x).style.visibility = (on == 1) ? 'visible' : 'hidden';
		divShown = x;
	}
}
function showToolDiv2() {
	if (stdto2 != null) window.clearTimeout(stdto2);
	showToolDiv(divShown, 0);
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->