var mstatus=true; var sel; var sm; var timer1=false; var timer2=false; var mstep=30; var cm=null; var hide_delay=400; var show_delay=200; var tstat=0;

//isNS4 = (document.layers) ? true : false;
//isIE4 = (document.all && !document.getElementById) ? true : false;
//isIE5 = (document.all && document.getElementById) ? true : false;
//isNS6 = (!document.all && document.getElementById) ? true : false;

function switchDiv(objElement,bolVisible){
	if(!bolVisible){ 
		//new Effect.Fade(objElement,{duration: 0.2}); 
		//objElement.style.display="none";
		$j(objElement).fadeOut("fast");
	} else { 
		//new Effect.Appear(objElement,{duration: 0.2}); 
		//objElement.style.display="";
		$j(objElement).fadeIn("fast");
	}
	
	if(objElement.parentNode.nodeName == 'LI') { if(!bolVisible) { objElement.parentNode.className=''; } else { objElement.parentNode.className='amenu'; } }
	return 1;
}
function show(el,m) { if (m!=null) { m=document.getElementById(m); } if ((el==null) && (cm)) { mstatus=true; cm=null; movefx() } else if ((m!=cm) && (m)) { if (cm!=null) switchDiv(cm,false); switchDiv(m,true); fxel=el; fxm=m; fxrect=0; mstatus=true; } if (m) cm=m; if (tstat==1) { clearTimeout(timer1); tstat=0 } if (tstat==0) { clearTimeout(timer2); tstat=1 } }
function hidemenu(b) { if (b)  { tstat=1; timer1=setTimeout("show(null)",hide_delay); } else { tstat=0; show(null); } }
function showmenu(el,m,b) { sel=el; sm=m; if (b)  { timer2=setTimeout("show(sel,sm)",show_delay); } }
function cancelhide() { if (!mstatus) { mstatus=true; } tstat=0; clearTimeout(timer1); }
function cancelshow() { sel = false; sm = false; tstat=0; clearTimeout(timer2); }
function movefx() { switchDiv(fxm,false); mstatus=true; return 1 }
