
	// Cross-browser element retrieval
	function fetchElement(name)
	{
		if (document.getElementById) 
		{
			return document.getElementById(name);
		} 
		else if (document.all)
		{
			return document.all[name];
		}
	}
	
	// Returns the height in px of an element.
	function getElementHeight(obj) 
	{ 
		return obj.offsetHeight; 
	}
	
	// Adjusts the bottom bar position to sit at the bottom of the screen.
	function repositionBottomBar()
	{
		var bottomBar = fetchElement("lowerMenu");
		var windowHeight = document.body.offsetHeight;
		var contentHeight = getElementHeight(fetchElement("page"));
		
		// This only needs to happen if the window's taller than the content
		if (contentHeight < windowHeight)
		{
			// Stop the black bar from going overtop of the content if the window is too small.
			minTop = (contentHeight - bottomBar.offsetHeight) + 50;
			newTop = windowHeight - bottomBar.offsetHeight;
			if (newTop < minTop) newTop = minTop;
			
			// Absolutely position the black bar to the bottom of the window.
			if (bottomBar.style.position != "absolute") bottomBar.style.position = "absolute";
			if (bottomBar.style.left == "") bottomBar.style.left = 0 + "px";
			bottomBar.style.top = newTop + "px";
		}
		bottomBar.style.left = fetchElement("page").style.left;
	}
