/*
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 = window.document.body.offsetTop-40;
	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);
}

//	newhome
$(document).ready(function(){ 
       $("ul.sf-menu").supersubs({ 
           minWidth:    12,   // minimum width of sub-menus in em units 
           maxWidth:    37,   // maximum width of sub-menus in em units 
           extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                              // due to slight rounding differences and font-family 
       }).superfish({autoArrows: false});  // call supersubs first, then superfish, so that subs are 
                        // not display:none when measuring. Call before initialising 
                        // containing tabs for same reason. 
					
	$('.menu', '#sitenav').bgiframe();
	
    $("li.nav","#sitenav").hoverIntent(
		function() { 
			if(	this.id	!= 'n1'){
				$('td.column3 div.combo').css('visibility', 'hidden');
				$('td.column2 div.combo').css('visibility', 'hidden');
			}
			$('#leftmenuwrapper').removeClass('leftmenuwrapper');
			hideAll();
			$(this).addClass("sfhover");
		},
		function() { 
			$('td.column3 div.combo').css('visibility', 'visible');
			$('td.column2 div.combo').css('visibility', 'visible');
			$('#leftmenuwrapper').addClass('leftmenuwrapper');
			$(this).removeClass("sfhover");
		}  
	);
 });
   
 
/**
* hoverIntent is similar to jQuery's built-in "hover" function except that
* instead of firing the onMouseOver event immediately, hoverIntent checks
* to see if the user's mouse has slowed down: see http://cherne.net/brian/resources/jquery.hoverIntent.html
**/
(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:0,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);	

function hideAll() {
	$('.sfhover').removeClass('sfhover');
	$('.hover').removeClass('hover');
}
//JQuery BGIframe
(function(a){a.fn.bgIframe=a.fn.bgiframe=function(c){if(a.browser.msie&&/6.0/.test(navigator.userAgent)){c=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},c||{});var d=function(e){return e&&e.constructor==Number?e+"px":e},b='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+c.src+'"style="display:block;position:absolute;z-index:-1;'+(c.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(c.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":d(c.top))+";left:"+(c.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":d(c.left))+";width:"+(c.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":d(c.width))+";height:"+(c.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":d(c.height))+';"/>';return this.each(function(){if(a("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(b),this.firstChild)}})}return this}})(jQuery);
//-->