// Menus functions
var m_count = 0;
var m_clock = new Array();
mnuHost = 'mnuHost';
mnuDomain = 'mnuDomain';
mnuReseller = 'mnuReseller';
mnuOrder = 'mnuOrder';
mnuiServer = 'mnuiServer';
mnuCMS = 'mnuCMS';
function $(id){
	if (document.getElementById(id)){
		return document.getElementById(id);
	}else if(document.all[id]){
		return document.all[id];
	}
}
var Menu = {
	hideAll : function(){
		var mnuList = new Array(mnuHost,mnuDomain,mnuReseller,mnuOrder,mnuiServer,mnuCMS);
		var o = null;
	},
	show : function(id,x,y){
		y = 136 + 30 + document.getElementById('Page').offsetTop;
		if (document.getElementById(id)){
		obj = document.getElementById(id);
		obj.style.display = '';
		obj.style.top = y + 'px';
		obj.style.left = x - obj.offsetWidth + 'px';
		obj.style.filter = 'alpha(opacity=90)';
		}
	},
	hide : function(id){
		if (document.getElementById(id)||document.all[id]){
			if (document.getElementById(id)){
			obj = document.getElementById(id);
			}else if(document.all[id]){
			obj = document.all[id];
			}
			obj.style.display = 'none';
		}
	},
	create : function (){
		m_count++;
		this.id = 'MNU_' + m_count;
		this.items = new Array();
		this.addItem = function(text,url){
			this.items[this.items.length] = new Array(text,url);
		}
		this.addLine = function(){this.items[this.items.length]=new Array('-')}
		this.Xpos = event.x;
		this.Ypos = event.y;
		this.itemHeight = 25;
		this.handle = null;
		this.show = function(){
			obj = document.createElement('div');
			obj.id = this.id;
			obj.style.position = 'absolute';
			obj.style.background = 'white';
			obj.style.border = '1 solid #bcbcbc';
			obj.style.width = 120;
			obj.style.top = this.Ypos;
			obj.style.left = this.Xpos;
			obj.innerHTML = '<table border=0 cellpadding=0 cellspacing=0>';
			for (i=0;i<this.items.length;i++){
				if (this.items[i][0]!='-'){
				obj.innerHTML += '<tr><td style="font-family:tahoma;font-size:8pt;height:' + this.itemHeight + '" dir=rtl>' + this.items[i][0] + '</td></tr>';
				}else{
				obj.innerHTML += '<tr><td style="font-family:tahoma;font-size:8pt" dir=rtl><hr></td></tr>';
				}
			}
			obj.innerHTML += '</table>';
			document.body.appendChild(obj);
			this.handle.onmouseout = function(){m_clock[m_count] = setTimeout("document.getElemenetById('" + this.id + "').style.display = 'none'",2000)}
		}
	}
}