var k;
var count=6;
w=(screen.width-260)/count;
k=Math.round(w);
//k=parseInt(k); 

var hideTimeout = null;

function setHideTimeout() { hideTimeout = setTimeout("hideAll();", 500); }

function stopHideTimeout() {
  if( hideTimeout != null ) {
    clearTimeout( hideTimeout );
    hideTimeout = null;
  }
}

function hideAll() {
  if( hideTimeout != null ) {
    clearTimeout( hideTimeout );
    hideTimeout = null;
  }

  for( var i=1; i<count; i++ ) {
	if( document.all && document.all["menu"+i] && document.all["menu"+i].style) {  //for MSIE >=4.0 
	  document.all["menu"+i].style.visibility="hidden";
	} else if ( document.getElementById && document.getElementById("menu"+i)) //for Netscape >=6.0
    		document.getElementById("menu"+i).style.visibility="hidden";
  }//for i
}

function hideAll2m(n) {
  for( var j=1; j<count; j++ ) {
	if( document.all ) {  //for MSIE >=4.0
	  if (document.all[n+"menu"+j]) document.all[n+"menu"+j].style.visibility="hidden";
	} else if ( document.getElementById ) { //for Netscape >=6.0
    		if( document.getElementById(n+"menu"+j) ) document.getElementById(n+"menu"+j).style.visibility="hidden";
	} else {if (document.getElementById(n+"menu"+j)) document.getElementById(n+"menu"+j).visibility="hidden";}
  }//for
}

function show(n) {
  hideAll();
  var s=0;
  if( document.all ) {  //for MSIE >=4.0
    if (n==1) s=7;
    if (document.all["menu"+n]) {
		document.all["menu"+n].style.left=s+1+k*(n-1);
		document.all["menu"+n].style.visibility="visible";
		//document.all["tb"+n].style.background = "#0066CC";
    }
  } else if ( document.getElementById ) { //for Netscape >=6.0
    if (document.getElementById("menu"+n)) {
			//document.getElementById("menu"+n).style.left=k*(n-1) - 200;
			//document.getElementById("menu"+n).style.left=s+1+k*(n-1);
			document.getElementById("menu"+n).style.left=k*(n-1);
			document.getElementById("menu"+n).style.visibility="visible";
			//document.getElementById("tb"+n).style.background = "#0066CC";
    }
  }
}
