window.onload=function () {
	var pageDims=Page.getDims ()
	var main=document.getElementById ("main")
	main.style.height=(pageDims.windowHeight - 160) + "px"
	main.style.visibility="visible"
	main.onmouseover=function () { return mainOnMouseOver } ()
	Common.setElementOpacity (main,0.75)
	document.getElementById ("mainContent").style.height=(pageDims.windowHeight - 160 - 190) + "px"
	
	var refs=document.getElementById ("refs")
	if(undefined!=refs) {
		refs.onmouseover=function () { return refsOnMouseOver } ()
		Common.setElementOpacity (refs,0.5)
	}
	
	initMenu ()
}

function initMenu() {
	var allItems=Common.getElementsByClassName("item","div",document.getElementById ("menu"));
	for(var i in allItems) {
		allItems[i].onmouseover=function(item){return function(){hoverItem(item);};}(allItems[i]);
		allItems[i].onmouseout=function(item){return function(){unhoverItem(item);};}(allItems[i]);
	}
}

function hoverItem (item) {
	item.className=item.className+"Hover"
}
function unhoverItem (item) {
	item.className=item.className.substring(0,item.className.length-5)
}

function refsOnMouseOver () {
	var main=document.getElementById ("main")
	Common.setElementOpacity (main,0.25)
	main.style.zIndex=0
	
	Common.setElementOpacity (this,1.0)
	this.style.zIndex=1
}
function mainOnMouseOver () {
	var refs=document.getElementById ("refs")
	if(undefined!=refs) {
		Common.setElementOpacity (refs,0.25)
		refs.style.zIndex=0
	}
	
	Common.setElementOpacity (this,1.0)
	this.style.zIndex=1
}
