			var oldbox = 0;
			var oldboxwidth = 0;
			var hiddenelement = 0;
			var currentBackground = "";
			var currentlyLoadingBackground = 0;

			function addLoadEvent(func)
			{
				var oldonload = window.onload;
				if (typeof func != 'function')
				{
					alert(func + " is geen functie!");
					return;
				}
				if (typeof window.onload != 'function')
				{
					window.onload = func;
				}
				else
				{
					window.onload = function()
					{
						if (oldonload)
						{
							oldonload();
						}
						try
						{
							func();
						}
						catch(err)
						{
							if (isLoggedIn && err.name != "NS_ERROR_DOM_RANGE_INVALID_NODE_TYPE_ERR")
								alert("JavaScript fout: " + err.name + ": " + err.message + " in regel " + err.lineNumber + ". " + err.description);
						}
					}
				}
			}
			function getBrowserWidth()
			{
				if (window.innerWidth)
				{
					return window.innerWidth;
				}
				else if (document.documentElement && document.documentElement.clientWidth != 0)
				{
					return document.documentElement.clientWidth;
				}
				else if (document.body)
				{
					return document.body.clientWidth;
				}
				return 0;
			}
			function HideBackground()
			{
				bg0 = document.getElementById('background0');
				bg1 = document.getElementById('background1');
				if (bg0 != 0 && bg1 != 0)
				{
					bg0.src = bg1.src;
					setTimeout('new Effect.Fade(bg1, {duration: 0})', 200);
				}
				currentlyLoadingBackground = 0;
			}

			function ChangeBackground(id)
			{
				if (currentlyLoadingBackground == 0)
				{
					if (currentBackground != id)
					{
						currentBackground = id;
						currentlyLoadingBackground = 1;
						element = document.getElementById('background1');
						if (element != 0)
						{
							document.getElementById('background1').src = '/images/backgrounds/'+id+'_background'+tImage;
							new Effect.Appear('background1');
						}
						setTimeout('HideBackground()', 700);
					}
				}
			}
			function CreateLatestUpdatesDraggable()
			{
				if (document.getElementById('latestupdates') != null)
					new Draggable('latestupdates', {revert: false});
			}

			function RestoreSelectBoxWidth()
			{
//				if (browser == 'ie')
				{
					if (oldboxwidth != 0 && oldbox != 0)
						oldbox.style.width = oldboxwidth;
					oldboxwidth = 0;
					oldbox = 0;
				}
			}

			function GrowSelectBox(box)
			{
//				if (browser == 'ie')
				{
					if (oldbox != 0 && oldbox != box)
						RestoreSelectBoxWidth(oldbox);
					if (box.style.width != '')
					{
						oldboxwidth = box.style.width;
						box.style.width = '';
						box.style.zIndex = 10;
						oldbox = box;
					}
				}
			}

                        function ShowHiddenElement()
                        {
//                              if (browser == 'ie')
                                {
                                        if (hiddenelement != 0)
                                                hiddenelement.style.display = '';
					hiddenelement = 0;
                                }
                        }

                        function HideElement(elementid)
                        {
				var e = document.getElementById(elementid);
//                              if (browser == 'ie')
                                {
                                        if (hiddenelement != 0 && e != hiddenelement)
                                                ShowHiddenElement(hiddenelement);
                                        if (e.style.display != 'none')
                                        {
                                                e.style.display = 'none';
						hiddenelement = e;
                                        }
                                }
                        }

                        function GetScrollXY()
                        {
                                        var scrOfX = 0, scrOfY = 0;
                                        if(typeof(window.pageYOffset == 'number'))
                                        {
                                                //Netscape compliant
                                                scrOfY = window.pageYOffset;
                                                scrOfX = window.pageXOffset;
                                        }
                                        else if(document.body && (document.body.scrollLeft || document.body.scrollTop))
                                        {
                                                //DOM compliant
                                                scrOfY = document.body.scrollTop;
                                                scrOfX = document.body.scrollLeft;
                                        }
                                        else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop))
                                        {
                                                //IE6 standards compliant mode
                                                scrOfY = document.documentElement.scrollTop;
                                                scrOfX = document.documentElement.scrollLeft;
                                        }
                                        return [scrOfX, scrOfY];
                        }

