var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody()
{
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera) ? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight)
{
	
	if (ie||ns6)
	{
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		if (position=="center")
		{
			pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
			horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
			vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
			
			if (window.opera && window.innerHeight) //compensate for Opera toolbar
			vertpos=pgyoffset+window.innerHeight/2-imgheight/2
			vertpos=Math.max(pgyoffset, vertpos)
		}
		else
		{
			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
		}
		
		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"
		crossobj.innerHTML='<div id="dragbar" style="min-width:' + imgwidth + '" align="right"><span id="closetext" class="content" onClick="closepreview()"><img src="images/close.gif" alt="sluiten"></span></div><img src="'+which+'" onClick="closepreview()">'
		crossobj.style.visibility="visible"
		
		
		return false
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true
}



function moviePopup(which, e, position, imgwidth, imgheight)
{
	if (ie||ns6)
	{
		crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
		
		if (position=="center")
		{
			pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
			horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
			vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
			
			if (window.opera && window.innerHeight) //compensate for Opera toolbar
			vertpos=pgyoffset+window.innerHeight/2-imgheight/2
			vertpos=Math.max(pgyoffset, vertpos)
		}
		else
		{
			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
		}

		crossobj.style.left=horzpos+"px"
		crossobj.style.top=vertpos+"px"
		crossobj.innerHTML='<div id="dragbar" style="min-width:' + imgwidth + '" align="right"><span id="closetext" class="content" onClick="document.WinMedia.Stop();closepreview()"><img src="wc_images/close.gif" alt="sluiten"></span></div><OBJECT ID="WinMedia" standby="Loading Microsoft Windows Media Player compents..." TYPE="application/x-oleobject"><embed src="'+which+'" loop="false" width="320" height="240" autoStart="true" Controls="console" name="WinMedia" onClick="document.WinMedia.Stop();closepreview()"></OBJECT>'
		crossobj.style.visibility="visible"
		
		
		return false
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true
}

function closepreview()
{
	crossobj.style.visibility="hidden"
}

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx+"px"
crossobj.style.top=tempy+event.clientY-offsety+"px"
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


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];}
}	




/**
* CSShiarchMenu v0.5
*	written by: me[AT]daantje[DOT]nl
*	last update: Sun Oct 23 23:05:23 CEST 2005
*
*	Documentation:
*		Build this small script cause all the gpl-ed scripts I found where too big
*		and had too many options I never going to use, or the config for the menu
*		was not easy to set with a PHP routine.
*
*	License:
*		Use this script any way you like...
*/

//declare
var submenu = new Array();
var tmrCSSmenu = new Array();
var adj = new Array();
var last_zIndex = 10000;
var lastOverId = '';


// EXAMPLE CONFIG
var alignSubmenu 	= 'bottom';		//bottom or right side of the main button.
var useLastItemCSS	= true;			//generate last menu item too
									//if false, it will behave as a normal item
									//and the css menuItemLast class will not be used
var adjustFirst		= false;		//overlap the first submenu too?
var adjustTop		= 0;			//move the submenu's some pixels. Positive number (10) for down, negative (-10) for up.
var adjustLeft		= 0;			//move the submenu's some pixels. Positive number (10) for right, negative (-10) for left.

/*
//fisrt submenu tree
submenu['menu1'] = new Array();
submenu['menu1'][0] = menuItem('my own website','http://www.daantje.nl','_top');
submenu['menu1'][1] = menuItem('other sites');
	submenu['menu1_1'] = new Array();
	submenu['menu1_1'][0] = menuItem('google','http://www.google.nl','demoFrame');
	submenu['menu1_1'][1] = menuItem('/.','http://www.slashdot.org','demoFrame');
	submenu['menu1_1'][2] = menuItem('Open in _BLANK:');
		submenu['menu1_1_2'] = new Array();
		submenu['menu1_1_2'][0] = menuItem('check test','http://www.google.nl','_blank');
		submenu['menu1_1_2'][1] = menuItem('test again','http://www.slashdot.org','_blank');
submenu['menu1'][2] = menuItem('This should be the last one');

//second submenu tree
submenu['menu2'] = new Array();
submenu['menu2'][0] = menuItem('project 1','http://www.daantje.nl','_self');
submenu['menu2'][1] = menuItem('project 2');
*/

// END OF EXAMPLE CONFIG


//build or unhide submenu div...
function buildSubmenu(obj){
	lastOverId = obj.id;

	//get common part of div id
	menuPath = obj.id.split('_');

	//unset mousout of parent menus and make sure they are visible...
	x = "div";
	for(i=0;i<menuPath.length;i++){
		x+= '_' + menuPath[i];
		if(document.getElementById(x)){
			if(tmrCSSmenu[x])
				window.clearTimeout(tmrCSSmenu[x]);
			document.getElementById(x).style.visibility = 'visible';
		}
	}

	//check if we have a submenu of the obj...
	if(submenu[obj.id]){
		//calc position of mouseover
		d = obj;
		if(d){
			L_pos = d.offsetLeft + d.offsetWidth;
			T_pos = d.offsetTop;
			while(d.offsetParent){
				d = d.offsetParent;
				L_pos+= d.offsetLeft;
				T_pos+= d.offsetTop;
			}
		}

		//patch first submenu to go right below the main buttons...
		if(obj.className.indexOf('menuItem') < 0 && alignSubmenu == 'bottom'){
			L_pos-= obj.offsetWidth;
			T_pos+= obj.offsetHeight;
		}

		//move the submenu (overlap?)
		if((adjustTop || adjustLeft) && (adjustFirst || (!adjustFirst && obj.className.indexOf('menuItem') >= 0))){
			L_pos+= adjustLeft;
			T_pos+= adjustTop;
		}

		//Only parse when position is higher than 0,0... Else we dont have the right position!
		if(L_pos > 0 && T_pos >0){
			//check if allready build...
			c = document.getElementById('div_' + obj.id);
			if(c){
				//unhide...
				c.style.visibility = 'visible';
				c.style.zIndex = last_zIndex++;

				//hard replace
				c.style.top = (T_pos - 1) + "px";
				c.style.left = (L_pos - 1) + "px";
			}else{
				//build new div
				subObj = document.createElement('div');
				subObj.id = 'div_' + obj.id;
				subObj.className = 'submenu';
				subObj.style.position = 'absolute';
				subObj.style.zIndex = last_zIndex++;
				subObj.style.top = (T_pos - 1) + "px";
				subObj.style.left = (L_pos - 1) + "px";

				//write div to the body...
				document.getElementsByTagName('body')[0].appendChild(subObj);

				//build html for submenu
				content = "";
				m = submenu[obj.id];
				for(i=0;i<m.length;i++){

					//determin target for onclick...
					//	(sorry, I should rewrite this routine...)
					if(m[i][1]){
						if(m[i][1].substring(0,11) == 'javascript:'){
							act = m[i][1].substring(11);
						}else{
							if(!m[i][2] || m[i][2] == '_self')
								act = "self.location.href='" + m[i][1] + "';";
							else if(m[i][2] == '_top')
								act = "top.location.href='" + m[i][1] + "';";
							else if(m[i][2] == '_parent')
								act = "parent.location.href='" + m[i][1] + "';";
							else if(m[i][2] == '_blank')
								act = "window.open('" + m[i][1] + "');";
							else
								act = "window.frames['"+m[i][2]+"'].location.href='" + m[i][1] + "';";
						}
					}

					//make item
					content+= "<div onmouseout=\"hideSubmenu(this)\" onmouseover=\"buildSubmenu(this)\" "+ (m[i][1] ? "onclick=\""+ act + "\" " : "") +"class=menuItem" + (i==0 ? 'First' : (i==(m.length -1) && useLastItemCSS ? 'Last' : '')) + " id=\"" + obj.id + "_" + i +"\">" + m[i][0] + "</div>";
					adj[i] = obj.id + "_" + i;
				}

				//insert new menu
				subObj.innerHTML = content;
			}
		}
	}
}

//hide a submebu div
function hideSubmenu(obj){
	//get common part of div id
	closePath = obj.id.split('_');

	//hide path
	x = "div";
	for(i=0;i<closePath.length;i++){
		x+= '_' + closePath[i];
		if(document.getElementById(x))
			tmrCSSmenu[x] = window.setTimeout("document.getElementById('"+x+"').style.visibility = 'hidden';",200);
		//The timeout above is needed for MSIE browsers... Or else the menu's will disapear on EVERY mousout!!!
		//Please get a normal browser like Firefox, Mozilla or Opera!!
	}
}

//add an menu item to the config array (called in the config lines)
function menuItem(txt,url,tar){
	return new Array(txt,url,tar);
}

//change div's on mouse over and out...
document.onmouseover = function(e){
	obj = document.all ? event.srcElement : e.target;
	if(obj.className == 'menuItemFirst' || obj.className == 'menuItem' || obj.className == 'menuItemLast')
		obj.className+='Over';
}
document.onmouseout = function(e){
	obj = document.all ? event.srcElement : e.target;
	if(obj.className == 'menuItemFirstOver' || obj.className == 'menuItemOver' || obj.className == 'menuItemLastOver')
		obj.className = obj.className.substring(0,(obj.className.length - 4));
}

//*** Patch for firefox bug with focus on mouseover...
//		This function should be called onMouseOver of every iFrame that's under the menu structure.
function iFramePatch(){
	if(!document.all && lastOverId)
		hideSubmenu(document.getElementById(lastOverId));
}




submenu['menu1'] = new Array();
submenu['menu1'][0] = menuItem('&nbsp;&nbsp;Feestje?','feestje.php','_self');
submenu['menu1'][1] = menuItem('&nbsp;&nbsp;Kwaliteit','kwaliteit.php','_self');
submenu['menu1'][2] = menuItem('&nbsp;&nbsp;Buffetten','buffetten.php','_self');
submenu['menu1'][3] = menuItem('&nbsp;&nbsp;Salades','salades.php','_self');
submenu['menu1'][4] = menuItem('&nbsp;&nbsp;Schotels','schotels.php','_self');
submenu['menu1'][5] = menuItem('&nbsp;&nbsp;Garnituren','hapjes.php','_self');
submenu['menu1'][6] = menuItem('&nbsp;&nbsp;Luxe hapjes','hapjes.php','_self');
submenu['menu1'][7] = menuItem('&nbsp;&nbsp;Dranken','dranken.php','_self');
submenu['menu1'][8] = menuItem('&nbsp;&nbsp;Lunches','lunches.php','');
submenu['menu1'][9] = menuItem('&nbsp;&nbsp;Personeel','personeel.php','_self');
submenu['menu1'][10] = menuItem('&nbsp;&nbsp;Verhuur','verhuur.php','_self');
submenu['menu1'][11] = menuItem('&nbsp;&nbsp;Prijzen','prijzen.php','_self');



defaultStatus="Catering de Toren";