function activeButton(btnObj)
{
	btnObj = document.getElementById(btnObj);
	x.fx.Manager.removeEffectsByTarget(btnObj.childNodes[0]);
	btnObj.childNodes[1].className = "buttonMenuActive";			
	
	x.fx.Manager.addEffect(new x.fx.ChangeAlpha(btnObj.childNodes[0],90,10));	
}

function normalizeButton(btnObj)
{
	btnObj = document.getElementById(btnObj);
	x.fx.Manager.removeEffectsByTarget(btnObj.childNodes[0]);
	btnObj.childNodes[1].className = "buttonMenu";
	x.fx.Manager.addEffect(new x.fx.ChangeAlpha(btnObj.childNodes[0],0,10));	
}

if (typeof currentButton == "undefined")
{
	currentButton = null;
}

window.onload = function()
{
	if (currentButton)
	{
		activeButton(currentButton);
	}
	
	try
	{
		for(this.i = 0; this.i < 3; this.i++)
		{									
			document.getElementById("mainMenu").getElementsByTagName("a")[this.i].onmouseover = function()
			{
				//MOUSE.setCursor(MOUSE.cursors.pointer);
				if (this.id != currentButton)
				{
					activeButton(this.id);
				}
			}
			
			document.getElementById("mainMenu").getElementsByTagName("a")[this.i].onmouseout = function()
			{
				//MOUSE.setCursor(MOUSE.cursors.Default);
				if (this.id != currentButton)
				{
					normalizeButton(this.id);
				}
			}
						
			document.getElementById("mainMenu").getElementsByTagName("a")[this.i].onclick = function()
			{				
				if (this.id != currentButton)
				{
					if (currentButton)
					{
						normalizeButton(currentButton);
					}
					else
					{
						activeButton(this.id);
						currentButton = this.id;
					}
				}
			}
			
			try
			{
				x.Object.setAlpha(document.getElementById("mainMenu").getElementsByTagName("a")[this.i].childNodes[0],0);				
			}
			catch(ex)
			{
			}
		}
		
//		bodyIsLoaded = true;
	}
	catch(ex)
	{alert(ex)}
}

