var y,x,sy,sx,wh,ww
function G_wd()
{
	sx=FF?window.scrollX:document.body.scrollLeft
	sy=FF?window.scrollY:document.body.scrollTop
	ww=(FF?window.innerWidth:document.body.clientWidth)
	wh=(FF?window.innerHeight:document.body.clientHeight)
}

var FF=!document.all;MENU_t=new Array(),MENU_z=99999,MENU_w=document

function _MENU(t,e,p,w)
{
	G_wd()
	if(p)
	{
		p=p.id.substr(3)
		var d="Mp_"+p
		t=MENU_w.getElementById("Mq_1"+p)
		if(!t)
			t=MENU_w.getElementById("Mq_2"+p)
	}
	else
		var d="Mp_"+t.id.substr(4)
	clearTimeout(MENU_t[d])
	t.onmouseout=function(){_MENU(this,1)}
	if(e)
	{
		MENU_t[d]=setTimeout("MENU_TX('"+d+"',100)",50)
		_MENU_over(t)
	}
	else
	{
		p=MENU_w.getElementById(d)
		if(p)
		{
			p.onmouseover=function(){_MENU(0,0,this)}
			FF?p.style.opacity="":p.style.filter=""
			MENU_z++
			p.style.zIndex=MENU_z
			item_XY(t)
			d=parseInt(t.id.substr(3,1))
			i_Y=i_Y+parseInt(d==1?i_H-1:0)
			if(i_Y+p.offsetHeight>wh)
				i_Y=wh-p.offsetHeight-2
			p.style.top=i_Y
			p.style.left=i_X+parseInt(d==2?i_W+1:0)
			p.style.visibility="visible"
			p.onmouseout=function(){_MENU(0,1,this)}
			_MENU_over(t)
		}
	}
}

function _MENU_over(t)
{
	var i=0
	while(t&&i<3)
	{
		t=t.offsetParent?t.offsetParent:t.parentNode
		if(t&&t.id&&!t.id.indexOf("Mp_"))
		{
			_MENU(0,0,t)
			break
		}
		i++
	}
}

function MENU_TX(d,v)
{
	clearTimeout(MENU_t[d])
	var o=MENU_w.getElementById(d)
	if(o)
	{
		if(v>19)
		{
			v=v-10
			FF?o.style.opacity=v/100:o.style.filter="alpha(opacity="+v+")"
			MENU_t[d]=setTimeout("MENU_TX('"+d+"',"+v+")",50)
		}
		else
		{
			o.style.visibility=""
			FF?o.style.opacity="":o.style.filter=""
			o.style.top=-900
		}
	}
}

var i_Y=0,i_X=0,i_H=0,i_W=0

function item_XY(o)
{
	i_Y=0
	i_X=0
	i_H=parseInt(o.offsetHeight)
	i_W=parseInt(o.offsetWidth)
	if(o.offsetParent)
	{
		while(1)
		{
			i_Y+=o.offsetTop
			i_X+=o.offsetLeft
			if(!o.offsetParent)
				break
			o=o.offsetParent
		}
	}
	else if(o.x)
	{
		i_Y+=o.y
		i_X+=o.x
	}
}