// ===================================================================
// Author: Kolibrie Creatieve Media (c) 2009
// http://www.kolibrie.net/
// ===================================================================

function objRef(id) {return document.getElementById(id)}
function styleRef(id) {return this.objRef(id).style}

function checkEnter(event) {
	code=(document.layers)?event.which:code=event.keyCode
	if (code==13) document.frmZoekmachine.submit();
}	

function hl(id){
	b=id.src;
	s=(b.substring(b.length-4,b.length-5)==0)?'1':'0';
	id.src=(b.substring(b.length-5,0)+s+b.substring(b.length,b.length-4));
}

function hlbg(obj){
	// wisselt niet echt mooi in IE 
	b=obj.style.backgroundImage;
	s=(b.substring(b.length-5,b.length-6)==0)?'1':'0';
	obj.style.backgroundImage=(b.substring(b.length-6,0)+s+b.substring(b.length,b.length-5));
}


// *** BEGIN PULLDOWN JAVASCRIPT ***
// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.
function whichBrs() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("staroffice") != -1) return 'Star Office';
	if (agt.indexOf("beonex") != -1) return 'Beonex';
	if (agt.indexOf("chimera") != -1) return 'Chimera';
	if (agt.indexOf("netpositive") != -1) return 'NetPositive';
	if (agt.indexOf("phoenix") != -1) return 'Phoenix';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("skipstone") != -1) return 'SkipStone';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) {
	if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
	return navigator.userAgent.substr(0,agt.indexOf('\/'));}
	else return 'Netscape';} else if (agt.indexOf(' ') != -1)
	return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;
}

var the_timeout;

function initialize(s) {
//	alert(s);
	if (s!='home') styleRef('pulldownmenus').top='125px';
	setMiddle(960)
	for (i=1;i<16;i++) setShadow(i);
}

var xOffset=0;
function setMiddle(breedte) {
	if (breedte<1) breedte=960
	if (window.innerWidth) xOffset=parseInt((window.innerWidth-breedte)/2)          // FireFox en Safari
	else if (document.all) xOffset=parseInt((document.body.clientWidth-breedte)/2)  // Internet Explorer
	else xOffset=80
	if (xOffset<10) xOffset=10;
	browserName = whichBrs();
	if (browserName=='Firefox' || browserName=='Safari') xOffset=xOffset-10;
	styleRef('pulldownmenus').left=xOffset+'px';
	styleRef('pulldownmenus').visibility='visible';
}

function menuaan(id) {
	if (the_timeout) clearTimeout(the_timeout);
	for (i=1;i<=16;i++) {
		if (objRef('pdb'+i)) {
			b=objRef('pdb'+i).src;
			s=(i==id)?'1':'0';
			objRef('pdb'+i).src=(b.substring(b.length-5,0)+s+b.substring(b.length,b.length-4));
		}
	}
	for (i=1;i<16;i++) {
		if (objRef('pdm'+i)) styleRef('pdm'+i).visibility=(i==id)?'visible':'hidden';
		if (objRef('pds'+i)) styleRef('pds'+i).visibility=(i==id)?'visible':'hidden';
	}
}

function menuuit(id){
	if (objRef('pdb'+id)) {
		b=objRef('pdb'+id).src;
		s='0';
		objRef('pdb'+id).src=(b.substring(b.length-5,0)+s+b.substring(b.length,b.length-4));
	}
	if (objRef('pdm'+id)) styleRef('pdm'+id).visibility='hidden';
	if (objRef('pds'+id)) styleRef('pds'+id).visibility='hidden';
}

function shsm(id) {
	if (objRef('pdm'+id)) {
		styleRef('pdm'+id).display=(styleRef('pdm'+id).display=='block')?'none':'block';
		setShadow(id.substring(1,0));
		hl(objRef('t'+id));
	}
}

function setShadow(id) {
	if (objRef('sbody'+id)) {
		l=parseInt(objRef('pdmstop'+id).offsetTop);
		styleRef('sbody'+id).clip='rect(0px 215px '+(l-18)+'px 0px)';
		styleRef('sbottom'+id).top=l+'px';
	}
}

function bg(id,s) {
	menu=id.substring(1,2)
	switch (s) {
		case 0: { 
//			styleRef(id).background='transparent';
			styleRef(id).color='#ff6e00';
			the_timeout = setTimeout("menuuit(menu);", 500);
			break
		}
		case 1: {
//			styleRef(id).background='#ff5a00';
			styleRef(id).color='#003796';
			if (the_timeout) clearTimeout(the_timeout);
			break
			}
		case 2: {
//			styleRef(id).background='#29217f';
			the_timeout = setTimeout("menuuit(menu);", 500);
			break
		}
	}
}
// *** EINDE PULLDOWN JAVASCRIPT ***