var curMenu1st=null;
var curMenu2nd=null;
var htimers=new Object();

var isie=3;
if(window.navigator.userAgent.lastIndexOf("MSIE")>=0) isie=1;


function showMenu(id){
	var tobj=document.getElementById("tabmenu");
	var tx=0;
	var tw=0;

	var tw=parseInt(tobj.offsetWidth);
	while(tobj){
  		tx+=parseInt(tobj.offsetLeft);
	  	tobj=tobj.offsetParent;
	}

	var o=document.getElementById(id);
	var po=document.getElementById("p"+id);
	if(htimers[id]){
  		clearTimeout(htimers[id]);
		htimers[id]=0;
	}

	if(o && po){
		x=0;
		y=isie;
	  	o1=po;
		while(o1){
			x+=parseInt(o1.offsetLeft);
			y+=parseInt(o1.offsetTop);
			o1=o1.offsetParent;
		}
		o.style.top=y+parseInt(po.offsetHeight);
		o.style.visibility="hidden";
		o.style.display="block";

		var minW=parseInt(po.offsetWidth)+50;
		if(parseInt(o.offsetWidth)<minW)
			o.style.width=minW;
		var bx=x;
		o.style.left=bx-15;
		o.style.visibility="visible";
	};
};

function hideMenu(id){
  if(htimers[id])
  	clearTimeout(htimers[id]);
  htimers[id]=setTimeout("doHide('"+id+"')",100);
}

function doHide(id){
	var o=document.getElementById(id);
	if(o)
		o.style.display="none";
}

