var totalLay = 1;
var menuid = 0;
var currSub = 0;
var timerId = 0;
var startLeft = 26;

var arrMenu = new Array();
arrMenu[0]='mnPokerRoom'; 

var arrMenuWidth = new Array();
for (i=0; i<(totalLay-1); i++) {
  j = i + 1;
  if (document.getElementById(arrMenu[j]) != undefined && document.getElementById(arrMenu[i]) != undefined)
    arrMenuWidth[arrMenu[i]] =  document.getElementById(arrMenu[j]).style.left - document.getElementById(arrMenu[i]).style.left;   
}

function menuHandler(menuid, showflag) {
  if (showflag != 0) { //show menu
    clearTimeout(timerId);
    showMenu(menuid, showflag);
  }
  else { //hide menu after a few sec
    timerId = setTimeout("showMenu('', 0)", 500);
    document.getElementById(menuid + "-b").className = "";
  }
}

function showMenu(menuid, showflag) {
	if (!showflag) {
		if (menuid == '') { // hide all if menunum = 0
			for (i=0; i<totalLay; i++) {
		  	otherLay = document.getElementById(arrMenu[i]);
				if (otherLay) otherLay.style.display = "none";
				othera = document.getElementById(arrMenu[i] + "-a");
				//if (othera) {
       //   othera.style.backgroundColor = "";
       //   othera.style.color = "#333333";
			//	}
      }
		}
		else { // hide just the specified menu
		 	otherLay = document.getElementById(menuid);
			if (otherLay) otherLay.style.display = "none";
			othera = document.getElementById(menuid + "-a");
		//	if (othera)  { 
     //   othera.style.backgroundColor = "";
     //   othera.style.color = "#333333";
		//	}
		}
	}
	if (showflag != 0) { // show the appropriate menu
  	tempLay = document.getElementById(menuid);
  	tempLay.style.display = "block";
  	tempa = document.getElementById(menuid + "-a");
  	if(tempa) {
  	  for (i=0; i<totalLay; i++) {
  	    document.getElementById(arrMenu[i] + "-b").className = "";
  	  }
  	  document.getElementById(menuid + "-b").className = "topmenu2";
  	}
  	
  	//if (tempa) {
    //  tempa.style.backgroundColor = "#F26521";
    //  tempa.style.color = "#ffffff";
  //	}
  }
}

