show=false;
timeout=false;
showSub=false;
showSubSub=false;
timeout2=false;
timeout3=false;
function showMenu (id, el) {
	obj=document.getElementById(id);
	
	clearTimeout(timeout);
	if (show!=false && show!=obj) hideMenu(show);

	if (!obj) return false;

	if (obj.style.visibility!='visible') {
		base=document.getElementById(el);
		var addX=14;
		var x=addX;
		var addY=4;
		var y=addY+base.offsetHeight;
		o=base;
		do {
			x+=o.offsetLeft;
			y+=o.offsetTop;
		} while (o=o.offsetParent);

		if (self.innerHeight && self.pageXOffset) w_width=self.innerWidth+self.pageXOffset;
		else if (document.documentElement.clientWidth) w_width=document.documentElement.clientWidth+document.documentElement.scrollLeft;
		else if (document.body.clientWidth) w_width=document.body.clientWidth+document.body.scrollLeft;
		else w_width=800;

		oldClass=base.className;
		base.className=oldClass+' parentHere';
		
		x=((w_width/2)<x)?(x-(obj.offsetWidth-base.offsetWidth)):(x)
	        obj.style.left=x-0+'px';
		obj.style.top=y+0+'px';
		obj.style.visibility='visible';
		
		show=obj;
	}
	timeout=setTimeout('hideMenu(obj)', 700);
}
function hideMenu (obj) {
	if (!obj) return false;
	obj.style.visibility='hidden';
	obj.style.top='-1000px';
	obj.style.left='-1000px';
	if (showSub!=false) hideSubMenu(showSub);
	if (showSubSub!=false) hideSubMenu(showSubSub);
	base.className=oldClass;
}
function hideSubMenu (obj) {
	if (!obj) return false;
	obj.style.visibility='hidden';
	obj.style.top='-1000px';
	obj.style.left='-1000px';
}
function showSubMenu (third, second, parent) {
	th=document.getElementById(third);
	se=document.getElementById(second);
	pa=document.getElementById(parent);
	clearTimeout(timeout2);
	if (showSub!=false && showSub!=th) hideSubMenu(showSub);
	if (showSubSub!=false) hideSubMenu(showSubSub);
	if (!th || !se || !pa) return false;
	if (th.style.visibility!='visible') {
		if (self.innerHeight && self.pageXOffset) w_width=self.innerWidth+self.pageXOffset;
		else if (document.documentElement.clientWidth) w_width=document.documentElement.clientWidth+document.documentElement.scrollLeft;
		else if (document.body.clientWidth) w_width=document.body.clientWidth+document.body.scrollLeft;
		else w_width=800;

		sx=se.offsetLeft+se.offsetWidth;
		sx=((w_width/2)<pa.offsetLeft)?(sx-(pa.offsetWidth+se.offsetWidth)):(sx);
		sy=se.offsetTop;
		o=se;
		var x=0,y=0;
		do {
			x+=o.offsetLeft;
			y+=o.offsetTop;
		} while (o=o.offsetParent);
		sx=x+se.offsetWidth;
		th.style.left=sx +'px';
		th.style.top=y-1 +'px';
		th.style.visibility='visible';
		showSub=th;
	}
	timeout2=setTimeout('hideSubMenu(th)', 700);
}
function showSubSubMenu (third, second, parent) {
	th=document.getElementById(third);
	se=document.getElementById(second);
	pa=document.getElementById(parent);
	clearTimeout(timeout3);
	if (showSubSub!=false) hideSubMenu(showSubSub);
	if (!th || !se || !pa) return false;
	if (th.style.visibility!='visible') {
		if (self.innerHeight && self.pageXOffset) w_width=self.innerWidth+self.pageXOffset;
		else if (document.documentElement.clientWidth) w_width=document.documentElement.clientWidth+document.documentElement.scrollLeft;
		else if (document.body.clientWidth) w_width=document.body.clientWidth+document.body.scrollLeft;
		else w_width=800;

		sx=se.offsetLeft+se.offsetWidth;
		sx=((w_width/2)<pa.offsetLeft)?(sx-(pa.offsetWidth+se.offsetWidth)):(sx);
		sx=sx;
		sy=se.offsetTop;
		
		o=se;
		var x=0,y=0;
		do {
			x+=o.offsetLeft;
			y+=o.offsetTop;
		} while (o=o.offsetParent);
		sx=x+se.offsetWidth;
		sy=y+se.offsetTop-5;
		th.style.left=sx+8+'px';
		th.style.top=sy-10+'px';
		th.style.visibility='visible';
		showSubSub=th;
	}
	timeout3=setTimeout('hideSubMenu(th)', 700);
}

function wnd(s)
{	
	var h = "popWindow";
	var o=500;
	var p=450;
	var l=document.body.offsetWidth-o-28;
	var t=20;
	popWindow = window.open(s,h,"resizable, scrollbars,toolbar=0,location=0,menubar=0,width="+o+",height="+p+",left="+l+",top="+t+"");
	popWindow.focus();
}
function NewWindowOpen(s,w,h,l,t)
{	
	var n = "popWindow";		
	popWindow = window.open(s,n,"fullscreen=no, toolbar=no, resizable=no, scrollbars=no, location=0,menubar=0,width="+w+",height="+h+",left="+l+",top="+t+"");
	popWindow.focus();
}