var g_activemnu='';
var g_activesrc='';
var g_activeimg='';
menuDelay = null;
var showDelay = 550;
var hideDelay = 300;

var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

if(ns4){origWidth=innerWidth;origHeight=innerHeight;onresize=function(){if(innerWidth!=origWidth||innerHeight!=origHeight)location.reload()}}

function getElement(id,doc) {
	if (!doc) { doc = document; }
	if (ie5||ns6)
		return(doc.getElementById(id));
	else if (ie4)
		return(doc.all[id]);
	else if (ns4)
		return(doc.layers[id]);
	else
		return null;
}

function styleObject(e) {
	return (ns4 ? e : e.style);
}

function showElement() {
	
	var e = getElement('mnu'+g_activemnu); 
	if (e) {
		cancelDelay();
		so = styleObject(e);
		so.visibility = "visible";
		so.zIndex = 10;
	}
}

function showElementDelayed(){
	menuDelay = window.setTimeout("showElement()",showDelay);
}

function hideElement(e) {
	so = styleObject(e);
	so.visibility = "hidden";
	so.zIndex = -1;
}

function menuSafeBrowser() {
	if (ie4 || ie5 || ns6) { return true; }
	return false;
}

function hideMenus() {
	var i,e,code;
	cancelDelay();
		
	if (g_activeimg != ''){
		e = getElement(g_activeimg);
		if (e) (e.src='/images/'+g_activesrc); 
		g_activemnu='';	g_activesrc='';g_activeimg='';
	}

	for (i = menuList.length; i--;) {
		code = menuList[i];
		e = getElement("mnu"+ code);
		if (e) { hideElement(e,true);
		 }
	}	
}

function m_i() {
	if (!menuSafeBrowser()) { return; }
	cancelDelay();
}

function mOver(code,img,is) {
	if (!menuSafeBrowser()) { return; }
	hideMenus();
	
	if (!code) { return; }
	e = getElement("mnu"+ code);
	g_activemnu=code;
	if (e) {  showElementDelayed(); 			
	}
	e = getElement(img);
	if (e) { (e.src='/images/'+is+'O.gif'); 
		g_activesrc = is +'.gif';
		g_activeimg = img;
	}
	
}



function mOut() {
	if (!menuSafeBrowser()) { return; }
	hideMnusDelayed();
}

function hideMnusDelayed() {
	if (!menuSafeBrowser()) { return; }
	cancelDelay();
	menuDelay = window.setTimeout("hideMenus()",hideDelay);
}

function cancelDelay() {
	window.clearTimeout(menuDelay);
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=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 iRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function si() { 
  var i,j=0,x,a=si.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function wI(s){if(isW)document.write("<img alt='' src='"+s+"'>");}
function wT(s){if(isW)document.write(s);}
function wLogo(){isW ? wI('/images/logos1024.gif'):document.write('<img src="/images/logos800.gif">'); }
function wCS(){if(!isW)document.write("<!"+"--");}
function wCE(){if(!isW)document.write("--"+">");}
function nwCS(){if(isW)document.write("<!"+"--");}
function nwCE(){if(isW)document.write("--"+">");}
function modlayout(){
		
		var isWide=(document&&document.body.clientWidth&&document.body.clientWidth>=905&&document.getElementById);
		sdisplay = (isWide? '':'none')
		var e = getElement('rightCol'); 
		if (e) {
			so = styleObject(e);
			so.display = sdisplay;
			}
		}


