	var CurrentScopeAll;

	function fadingObject(id)
	{
		this.id = id;
		this.getOpacity = function()
		{
			if (document.all)
			{
				return document.all[this.id].filters['alpha'].opacity;
			}
			else if (document.getElementById)
			{
				return document.getElementById(this.id).style.MozOpacity*100;
			}
		}

		this.setOpacity = function(percent)
		{
			if (document.all)
			{
				document.all[this.id].filters['alpha'].opacity = percent;
			}
			else if (document.getElementById)
			{
				document.getElementById(this.id).style.MozOpacity = percent/100;
			}
		}

		this.fadeTo = function(newOpacity, deltaPercent)
		{
			window.clearTimeout(this.timeout);
			currentOpacity = this.getOpacity();

			if (newOpacity > currentOpacity)
			{
				if (currentOpacity < newOpacity - deltaPercent)
				{
					this.setOpacity(currentOpacity + deltaPercent);
					this.timeout = window.setTimeout('obj_'+this.id+'.fadeTo('+newOpacity+', '+deltaPercent+')', 50);
				}
				else
				{
					this.setOpacity(newOpacity);
				}
			}
			else if (newOpacity < currentOpacity)
			{
				if (("MenuSubDiv" + CurrentScopeAll) != this.id)
				{
					if (currentOpacity > newOpacity + deltaPercent)
					{
						this.setOpacity(currentOpacity - deltaPercent);
						this.timeout = window.setTimeout('obj_'+this.id+'.fadeTo('+newOpacity+', '+deltaPercent+')', 50);
					}
					else
					{
						this.setOpacity(newOpacity);
					}
				}
				else
				{
					this.setOpacity(100);
				}
			}
		}
	}

	function hideSubMenuDelay(CurrentScope)
	{
		if (CurrentScope == CurrentScopeAll)
		{
			CurrentScopeAll = "";
		}

		var delay;
		delay = window.setTimeout("obj_MenuSubDiv"+CurrentScope+".fadeTo(0, 10)", 1250);
		delay = window.setTimeout("hideSubMenu(\'" + CurrentScope + "\')", 2250);
	}
	
	function hideSubMenu(CurrentScope)
	{
		var oDiv;
	
		oDiv = document.getElementById("MenuSubDiv" + CurrentScope).style;
		if (oDiv.display ==  'block' && CurrentScope != CurrentScopeAll)
		{
			oDiv.display = 'none';
		}	
	}
	
	function showSubMenu(CurrentScope)
	{
		CurrentScopeAll = CurrentScope;
		var oDiv;
		var TempScope;
		var z;
		
		var arrayOfDivs = document.getElementsByTagName('div');
		var howMany = arrayOfDivs.length;
		for (var i = 0; i < howMany; i++)
		{
			var oDiv = arrayOfDivs[i];
			if (oDiv.id.indexOf("MenuSubDiv") != -1 )
			{
				//z = oDiv.id.indexOf("MenuSubDiv");
				z = 10;
				TempScope = oDiv.id.substring(z, oDiv.id.length);
				if (TempScope == CurrentScope)
				{
					oDiv.style.display = "block";
				}
				else
				{
					oDiv.style.display = "none";
				}
			}
		}
		
		
		var objSubMenu;
		objSubMenu = eval('obj_MenuSubDiv'+CurrentScope);
		objSubMenu.fadeTo(100, 10);
	}
	
	obj_MenuSubDiv1 = new fadingObject('MenuSubDiv1');
	obj_MenuSubDiv2 = new fadingObject('MenuSubDiv2');
	obj_MenuSubDiv3 = new fadingObject('MenuSubDiv3');
	obj_MenuSubDiv4 = new fadingObject('MenuSubDiv4');
	obj_MenuSubDiv5 = new fadingObject('MenuSubDiv5');
	obj_MenuSubDiv6 = new fadingObject('MenuSubDiv6');
	
	function SetSubMenuLocation()
	{
		//alert(MenuSubDiv4.offsetWidth);
	}