Application = {
	initialize: function() {
		Application.setHover('menu');
		Application.MM_preloadImages('img/menu-on.gif');
	},
	
	setHover: function(idName) {
		if (document.all && document.getElementById) {
			var menu = document.getElementById(idName);
			var i;
			for (i=0; i<menu.childNodes.length; i++) {
				var node = menu.childNodes[i];
				if (node.nodeName == "LI") {
					node.onmouseover = function() {
						Element.addClassName(this, 'over');
					}
					node.onmouseout = function() {
						Element.removeClassName(this, 'over');
					}
				}
			}
		}
	},
	
	MM_preloadImages: function() { //v3.0
		var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=Application.MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
}
	
function popUp(URL, chooseWidth) {
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var ie = /msie/i;
	var w;
	var h;
	if (chooseWidth == true) {
		w = chasm * 0.65;
		h = mount * 0.65;
	} else if (chooseWidth > 0) {
		w = chooseWidth;
		h = 240;
	} else {
		w = 400;
		h = 360;
	}

	var features =
		'width=' + w + 
		',height=' + h + 
		',left=' + ((chasm - w - 10) * .5) + 
		',top=' + ((mount - h - 150) * .5);
		
	if (chooseWidth) {
		features += ',scrollbars=1,resizable=1';
	}
			
	if (!new_window) 
	{
		var new_window = window.open (URL, 'HigherGround', features);
		if (new_window) new_window.focus();
	}
}

window.onload = Application.initialize;