/**
 * This function creates a loading queue for the page and adds events to it. 
 * Using this function is a good idea when you need to load a lot of different
 * things along side the page.
 */
function addLoadEvent(func) {
	var oldonload = window.onload;

	if (typeof window.onload != 'function')
		window.onload = func;
	else
		window.onload = function() {
			oldonload();
			func();
		}
}

//function $(e) { return document.getElementById(e); }

addLoadEvent(function() {
	var browser_sucks = /*@cc_on!@*/false;
	
	if (browser_sucks) {
		var drops = document.getElementById('mainnav').getElementsByTagName('li');
		
		for (x in drops) {
			if (drops[x].className != 'subs')
				continue;
		
			drops[x].onmouseover = function() { 
				this.className = 'hovered'; 
				
				var sels = document.getElementsByTagName('select');
				
				for (x in sels) {
					if (typeof(sels[x]) != 'object') continue;
					sels[x].style.visibility = 'hidden';
				}
			};
			
			drops[x].onmouseout  = function() { 
				this.className = 'subs'; 
				
				var sels = document.getElementsByTagName('select');
				
				for (x in sels) {
					if (typeof(sels[x]) != 'object') continue;
					sels[x].style.visibility = 'visible';
				}
			};
		}
	}
	
	if (document.getElementById('navcolumn').offsetHeight > document.getElementById('bodycopy').offsetHeight)
		document.getElementById('bodycopy').style.height = '600px';
});
