	/**
	 * Set the X and Y mouse coordinates
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @param 	object		e		window event
	 * @return 	void
	 */
	function setMouseCoord(e) {
	
		mouseX = getMouseX(e);
		
		mouseY = getMouseY(e);
		
		return true;
	
	} // setMouseCoord()

	/**
	 * Create a submenu
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @param 	integer		id					id of page to show submenu for
	 * @param		object		menuitem		menuitem that invoked the command
	 */
	function createSubMenu(id, menuitem) {
	
		var submenu = document.createElement('div');
			
		submenu.setAttribute('id', 'submenu' + id);
		
		submenu.className = 'submenu';

		submenu.style.top = getRealDistance(menuitem, 0, 'Top') + 'px';
		
		submenu.style.left = getRealDistance(menuitem, 0, 'Left') + parseInt(menuitem.offsetWidth) + 'px';
		
		submenu.innerHTML = "<a href='/kunstuitleen.html'>Particulieren</a>";

		submenu.innerHTML += "<a href='/kunstuitleen_bedrijven.html'>Bedrijven</a>";
		
		document.body.appendChild(submenu);
		
		return document.getElementById('submenu' + id);
	
	} // createSubMenu()
	
	/**
	 * Show a submenu, if available.
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @param 	integer		id					id of page to show submenu for
	 * @param		object		menuitem		menuitem that invoked the command
	 * @return 	void
	 */
	function showSubMenu(id, menuitem) {
	
		if ( id == 85 || id == 18 || id == 32 || id == 57 ) {
		
			var submenu = document.getElementById('submenu' + id);
			
			if ( submenu == 'undefined' || submenu == null ) {
			
				submenu = createSubMenu(id, menuitem);
				
			}
		
			submenu.style.visibility = 'visible';
				
		}

	} // showSubMenu()
	
	/**
	 * Hide a submenu, if available.
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @param 	integer		id					id of page to show submenu for
	 * @param		object		menuitem		menuitem that invoked the command
	 * @return 	void
	 */
	function hideSubMenu(e, id, menuitem) {
	
		// Catch the event in explorer.
	
		if (!e) var e = window.event;

		// get the submenu with given id.
		
		var submenu = document.getElementById('submenu' + id);
		
		// We only hide the submenu if the current mouse-position is not within the
		// rectangle of the submenu.
		
		if ( typeof submenu != 'undefined' && submenu && submenu != 'null' ) {

			var X1 = parseInt(getRealDistance(submenu, 0, 'Left'));
		
			var Y1 = parseInt(getRealDistance(submenu, 0, 'Top'));
		
			var X2 = parseInt(X1) + parseInt(submenu.offsetWidth);
		
			var Y2 = parseInt(Y1) + parseInt(submenu.offsetHeight);
		
			if ( !in_rectangle(e, X1, Y1, X2, Y2) ) {

				submenu.style.visibility = 'hidden';
		
			}
			
		}

	} // hideSubMenu()
	
	/**
	 * Get the real distance from the given object to the left or topside
	 * (direction) of the window.
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @param object obj
	 *		The object to get the real distance of.
	 * @param integer x
	 *		The distance
	 * @param string direction
	 *		'Left' for the distance to the left,
	 *		'Top' for the distance to the top.
	 * @return integer x
	 *		The distance found.
	 * @access private
	 */
	function getRealDistance(obj, x, direction) {
	
		if ( typeof(obj) == 'undefined' || obj == null ) return x;
	
		var offset = eval('obj.offset' + direction);
		
		if ( typeof(offset) == 'undefined' || offset == null ) {
		
			return x;
			
		}
			
		var extra = 0;
		
		try {
		
			eval ('extra = obj.offset' + direction);
			
			x += extra;
			
			try {
			
				return getRealDistance(obj.offsetParent, x, direction);
				
			} catch (f) {
				
				return x;
			
			}
						
		} catch (e) {
				
			return x;
			
		}
		
	} // getRealDistance()
	
	/**
	 * See whether current mouse-position is in the scope of the rectangle given.
	 * 
	 * @author R.J.T. de Vries <rdevries@thirdwave.nl>
	 * @return 	boolean		true/false
	 */
	function in_rectangle(e, X1, Y1, X2, Y2) {
	
		var mouseX = getMouseX(e) + getScrollX();
		
		var mouseY = getMouseY(e) + getScrollY();
		
		if ( mouseX >= X1 && mouseX <= X2 && mouseY >= Y1 && mouseY <= Y2 ) {
		
			return true;
			
		}
		
		return false;
		
	} // in_rectangle()
	
	/**
	* Get the cursor X position, related to the given event.
	* 
	* @author R.J.T. de Vries <rdevries@thirdwave.nl>
	* @param object e
	*	 The given event.
	* @return mixed
	*		false on Failure, mouse x position on success.
	* @access public
	*/
	function getMouseX(e) {
	
		var x = 0;
	
		if (!e) 							var e = window.event;
	
		if (e.clientX)				return ( e.clientX );
		
		else									return false;
	
	} // getMouseX()
	
	/**
	* Get the cursor Y position, related to the given event.
	* 
	* @author R.J.T. de Vries <rdevries@thirdwave.nl>
	* @param object e
	*	 The given event.
	* @return mixed
	*		false on Failure, mouse y position on success.
	* @access public
	*/
	function getMouseY(e) {
	
		var x = 0;
	
		if (!e) 							var e = window.event;
	
		if (e.clientY)				return ( e.clientY );
			
		else									return false;
	
	} // getMouseY()

	/**
	* What's the x-axis scroll position of the current window?
	* 
	* @author R.J.T. de Vries <rdevries@thirdwave.nl>
	* @return integer scroll
	*		The scrollY in pixels
	* @access public
	*/
	function getScrollY() {
	
		if ( typeof document.body.scrollTop != 'undefined' ) {
			
			return document.body.scrollTop;
			
		}
		
	} // getScrollY()
	
	/**
	* What's the y-axis scroll position of the current window?
	* 
	* @author R.J.T. de Vries <rdevries@thirdwave.nl>
	* @return integer scroll
	*		The scrollX in pixels
	*/
	function getScrollX() {
	
		if ( typeof document.body.scrollLeft != 'undefined' ) {
		
			return document.body.scrollLeft;
			
		}
	
	} // getScrollX()
	