var curMenuItem="";
var curOuterDiv="";
var curParentItem="";
var opl=0;
var fi;
var fo;
var objDiv;

function showMenu(innerDiv,outerDiv,parentDiv){	
	opl=0;
	showList(innerDiv,outerDiv,parentDiv);
	fadeIn();
}

function showList(innerDiv,outerDiv,parentDiv){	
	if(curMenuItem!="" && curMenuItem!=outerDiv){
		document.getElementById(curMenuItem).innerHTML="";	
		//document.getElementById(curParentItem).style.background='#f1f1f1';
	}
	curMenuItem=outerDiv;
	curParentItem=parentDiv;	
	curOuterDiv=outerDiv;
	//document.getElementById(parentDiv).style.background='#CDD6DC';	
	iHtml=document.getElementById(innerDiv).innerHTML;
	document.getElementById(outerDiv).innerHTML=iHtml;	
}

function hideMenu(){
	//document.getElementById(curParentItem).style.background='#f1f1f1';
	if(curMenuItem != "" && curOuterDiv != ""){
	document.getElementById(curOuterDiv).innerHTML="";
	}
}

function fadeIn(){
	if(opl<=70){			
		if(navigator.appName.indexOf("Microsoft")!=-1){
			opl=opl+10;
			setOpacity();
			fi=setTimeout("fadeIn()",5);
		}else{
			opl=opl+2;
			setOpacity();
			fi=setTimeout("fadeIn()",1);
		}
		
	}else{
		opl=0;
		clearTimeout(fi);
	}	
}

function setOpacity(){	
	if(curMenuItem != ""){
	objDiv = document.getElementById(curMenuItem).style;
	objDiv.opacity = opl;		
    objDiv.MozOpacity = (opl / 100);
    objDiv.KhtmlOpacity = (opl / 100);
    objDiv.filter = "alpha(opacity=" + opl + ")"; 
	}
}

