callNav = function()
{
	sfHover("nav");
}

var _HiderContainer = null;

function BrowserDetect() {
	var ua = navigator.userAgent.toLowerCase();
	// browser name
	this.isIE = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) );
	// browser version
	this.versionMinor = parseFloat(navigator.appVersion);
	if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	}
	this.versionMajor = parseInt(this.versionMinor);
	// specific browser shortcuts
	this.isIE5x = (this.isIE && this.versionMajor == 5);
	this.isIE55 = (this.isIE && this.versionMinor == 5.5);
	this.isMac   = (ua.indexOf('mac') != -1);
}


function sfHover(strMenuId) {
	BrowserDetect();
	var navRoot = document.getElementById(strMenuId);
	var sfEls = navRoot.getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].submenu = sfEls[i].getElementsByTagName("UL")[0];
		if(typeof(sfEls[i].submenu)!= "undefined"  )
			sfEls[i].iFrame = iFrameCtrl(sfEls[i].submenu, sfEls[i]);
		
		sfEls[i].onmouseover=function() {
			this.className+=" over";
			if(typeof(this.iFrame)!= "undefined")ShowiFrame(this.iFrame);
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" over\\b"), "");
			if(typeof(this.iFrame)!= "undefined")HideiFrame(this.iFrame);
		}
	}
}

if (window.attachEvent) 
{
	window.attachEvent("onload", callNav);
}



function iFrame(oLayer, oNewHiderContainer) {

	var zIndex = oLayer.style.zIndex;
	if (zIndex == "")
		zIndex = xGetAnyCS(oLayer, "z-index");
	zIndex = parseInt(zIndex);
	if ( isNaN(zIndex) ) {
		zIndex = 2;
	}
	
	oIframe = document.getElementById("hider" + oLayer.id);
	if (!oIframe) {
		zIndex--;
		oNewHiderContainer.insertAdjacentHTML("afterBegin", '<iframe id="hider' + oLayer.id + '" scroll="no" frameborder="0" src="include/DoNotRemove.htm" class="iframe" style="zIndex:'+zIndex+';border:0;sFilter:filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0);"></iframe>');
		oIframe = document.getElementById("hider" + oLayer.id);
	}
	
	return oIframe;
}

function iFrameCtrl(oLayer, oNewHiderContainer) {
	oIframe = iFrame(oLayer, oNewHiderContainer);
	if (oIframe) {
		xMoveTo( oIframe, xLeft(oLayer), xTop(oLayer) );
		xResizeTo( oIframe, xWidth(oLayer), xHeight(oLayer) );
	}
	return oIframe;
}


function HideiFrame(oIframe) {
	xHide( oIframe );
}

function ShowiFrame(oIframe)
{
	xShow(oIframe);
}


function raw_popup(url, name, strFeatures) 
{
	var theWindow = window.open(url, name, strFeatures);
	if(theWindow != null)
		theWindow.focus();
	return theWindow;
}
	

function onKeyPress_Return() 
{     
	if (event.keyCode == 13) 
	{   
		event.cancelBubble = true;
		event.returnValue = false;
	}
}

function onKeyPress_Return(evt,item) 
{
	var e=(window.event)?window.event:evt;
	if(e)
	{
		if (e.keyCode == 13||e.charCode==13||e.which==13) 
		{ 
			if(item != null)
				item.click();
			e.cancelBubble = true;
			e.returnValue = false;
		}
	}
}

function selectTab(group,tab) 
{
	var element = document.getElementById(group);
	element.className = tab;
}