<!--

function s_menu(on)
{
	this.align = "center";
	
	this.show = s_menu_show;
	this.hide = s_menu_try_hide;
	this.fullhide = s_menu_full_hide;

	this.pos = s_menu_spos;
	this.gs = s_menu_gs;
	
	this._el = new Array();
	this.prefix = "";
	this.oname = on;
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function s_menu_spos(i, t, left, top, width)
{
	this._el[i] = {"type":t , "left":left, "top":top, "width":width, "status" : 0};
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function s_menu_show(i)
{
	var d = document.getElementById(this.prefix+i);

	if(d == null)
		return;

	var p;
	
	p = this.gs(i);
	
	d.style.left = p.left;
	d.style.top = p.top;
	
	this._el[i].status = 1;
	
	d.style.visibility = "visible";
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function s_menu_try_hide(i)
{
	if(document.getElementById(this.prefix+i) == null)
		return;

	this._el[i].status = 2;
	setTimeout(this.oname+".fullhide("+i+")", 200);
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function s_menu_full_hide(i)
{
	var d = document.getElementById(this.prefix+i);

	if(d == null)
		return;
	
	if(this._el[i].status == 2)
	{
		d.style.visibility = "hidden";
		this._el[i].status = 0;
	}
}

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

function s_menu_gs(i)
{
	var p, left, top, type, width, c_width;

	left = this._el[i].left;
	top = this._el[i].top;
	width = this._el[i].width;

	if(this._el[i].type == "center")
	{
		c_width = document.all? document.body.clientWidth : document.documentElement.offsetWidth;

		if(c_width > width)
			left += (c_width-width)/2;
	}

	if(navigator.userAgent.toLowerCase().indexOf("opera") != -1)
		top = top+11;

	p = {"left":left, "top":top};

	return p;
}

//-->