var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=no,location=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=0,top=0";
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

/* 
 * Hovers li's in IE as it does not support CSS hovers on LI tags 
 * Requires the hover style to also apply to the class .over 
*/
function assignHoverNav()
{

	var menu = document.getElementById('nav');
	if (!menu) return false;
	var index=0

	var elems = menu.getElementsByTagName('li');
	if (!elems) return false;

	for(index=0;index<elems.length;index++)
	{
		var li = elems[index];
		li.onmouseover = function () 
		{
			this.className += " over";
			//if (this.parentNode.parentNode.tagName == 'LI')
		}

		li.onmouseout = function ()
		{
			//if (this.parentNode.parentNode.tagName != 'LI') 
			this.className=this.className.replace("over", "");
		}
	}

	
}
if (window.attachEvent) window.attachEvent("onload", assignHoverNav);
	else window.onload = assignHoverNav;

