function dosearch() {
	location = '/index/root/search/' + q.value;
}

function openwin(url,w,h) {
	window.open (url, "_blank","toolbar=no,location=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",resizeable=no,status=yes");
}

function tejater() {
	window.open ("http://sghl.nl/tejater", "_blank");
}

function mededelinghuurders() {
	window.open ("http://sghl.nl/mededeling", "_blank","toolbar=no,location=no,menubar=no,scrollbars=no,width=396,height=424,resizeable=no,status=no");
}

function ruimtereserveren() {
	window.open ("/formulier/reserveren", "_blank","toolbar=no,location=no,menubar=no,scrollbars=yes,width=900,height=650,resizeable=no,status=no");
}

function changemenu() {
	location = 'index.php?action=menu&loc=' + parent.menu.document.frm.sitesel.options[parent.menu.document.frm.sitesel.selectedIndex].value;
}

function confirmSubmit() {
	var agree = confirm("Zeker weten?");
	if(agree) {
		return true;
	}
	else {
		return false;
	}
}

function rel() {
	self.opener.location.reload();
	setTimeout("window.close()",1400);
}

function confirmSubmit() {
	var agree = confirm("Zeker weten?");
	if(agree) {
		return true;
	}
	else {
		return false;
	}
}

function browserObject() {
	this.ver = navigator.appVersion;

	this.docId = (document.getElementById && document.defaultView) ? true : false;
	this.docLay = document.layers ? true : false;
	this.docAll = document.all ? true : false;
	
	this.compatible = ( this.docId || this.docLay || this.docAll );

	this.width = null; //to be set later after document is loaded;
	this.height = null; //to be set later after document is loaded;
	return this;
}
var browser = new browserObject();

var _oBody; // Will hold pointer to document body

function initBrowserComp() {
	if (browser.compatible) { // browser compatible ?
		if (browser.docAll) {
			// IE6 with right doctype needs 'document.documentElement'
			if(document.documentElement && document.body.clientHeight == 0) _oBody = document.documentElement;
			else _oBody = document.body;
			browser.width = _oBody.clientWidth;
			browser.height = _oBody.clientHeight;
		}
		else if (browser.docId) {
			browser.width = window.innerWidth;
			browser.height = window.innerHeight;
			_oBody = document.body;
		}
		else if (browser.docLay) {
			browser.width = window.innerWidth;//-20;
			browser.height = window.innerHeight;//-20;
		}
	}
}

function initall() {
	initBrowserComp();
	window.onresize = initall;
	checkScroll();
}
var _iY, _iH;

function checkScroll() {
	var iY = (browser.docLay) ? window.pageYOffset : _oBody.scrollTop;
	var iH = 32;
	iY += browser.height - iH;
	if((_iY != iY) || (_iH != iH))
	{
		changeMenu(0);
		layerMoveIn(0,iY);
	}
	_iY = iY;
	_iH = iH;
	setTimeout('checkScroll()',10);
}

function layerMoveIn(iX,iY) {
	var oSL = layerGetRef('balk');

	if (browser.docLay) {
		oSL.moveTo(iX, iY);
	}
	else {
		oSL.style.left= iX +'px';
		oSL.style.top = iY +'px';
	}
	setTimeout('changeMenu(1)', 2000);
}


function changeMenu(ID) {
	var oSL = layerGetRef('balk');
	if(ID==0)
	{
		oSL.style.visibility = 'hidden';
	}
	if(ID==1)
	{
		oSL.style.visibility = 'visible';
	}
}

function layerGetRef(sID) {
	if (browser.docId) return document.getElementById(sID);
	else if (browser.docLay) return document.layers[sID];
	else if (browser.docAll) return document.all[sID];
}

function isDefined(vElt) {
	var UNDEF;
	var bDef = (vElt == UNDEF) ? false : true;
	return bDef;
}

function navKnop(MyNaam, MyURL) {
	var T;
	/*T = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="177" HEIGHT="22" id="Untitled-1" ALIGN="">';
	T = T + '<PARAM NAME=movie VALUE="http://sghl.nl/templates/g/menu000.swf?naam=' + MyNaam + '&gotourl='+ MyURL + '">';
	T = T + '<PARAM NAME=quality VALUE=high>';
	T = T + '<PARAM NAME=bgcolor VALUE=#FFD533>';
	T = T + '<EMBED src="http://sghl.nl/templates/g/menu000.swf?naam=' + MyNaam + '&gotourl=' + MyURL + '" quality=high bgcolor=#FFD533 WIDTH="177" HEIGHT="22" NAME="Untitled-1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
	T = T + '</OBJECT><br>';*/
	T = "<a href=\"" + MyURL + "\" class=\"menuItem\">" + MyNaam + "</a>";
	document.write(T);
}