var timeout_id;
function show_menu()
{
	document.all['Layer2'].style.visibility = "visible";
}
function hide_menu()
{
	document.all['Layer2'].style.visibility = "hidden";
}
function set_timeout()
{
	timeout_id = window.setTimeout('hide_menu()',2000);
}
function clear_timeout()
{
	if (timeout_id != "")
	{
		window.clearTimeout(timeout_id);
	}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function jump_to_layer(thing,layer_name)
{
	clear_timeout();
	
	var Xcoord = relPosX(thing);
	var Ycoord = relPosY(thing);
	var Wcoord = 0 + 10;
	var Hcoord = 22 + 10;

	document.all[layer_name].style.top= Ycoord + Hcoord;
	document.all[layer_name].style.left= Xcoord + Wcoord;
	document.all[layer_name].style.visibility = "visible";
}

function relPosX(which) {
	var elem = which;
	var pos = elem.offsetLeft;
	while (elem.offsetParent != null) 
	{
		elem = elem.offsetParent;
		pos += elem.offsetLeft;
		if (elem.tagName == 'BODY')
		{
			break;
		}
	}

	return pos;
}

function relPosY(which) 
{
	var elem = which;
	var pos = elem.offsetTop;
	while (elem.offsetParent != null) 
	{
		elem = elem.offsetParent;
		pos += elem.offsetTop;
		if (elem.tagName == 'BODY')
		{
			break;
		}
	} 
	
	return pos;
}
