function addMenuBehavior(context)
{

	for(var i=0; i < context.childNodes.length; i++)
	{
		var n = context.childNodes[i];

		if(n.nodeName == "LI")
		{
			var mainNav = new mainMenu(n);
		}
	}

}


function subMainMenu(context)
{
	this.context = context;
	var me = this;
	var List = new AddListener(this.context, "mouseover", function()
	{
		me.context.className = "hover";	
	});

	var List2 = new AddListener(this.context, "mouseout", function()
	{
		me.context.className = "none";	
	});

}

function mainMenu(context)
{
	this.context= context;
	
	for(var i=0; i < this.context.childNodes.length; i++)
	{
		var n = this.context.childNodes[i];

		if(n.nodeName == "UL")
		{

			for(var j=0; j < n.childNodes.length; j++)
			{
				var n3 = n.childNodes[j];
				if(n3.nodeName == "LI")
				{
					if(n3.className != "last")
					{
						for(var x=0; x < n3.childNodes.length; x++)
						{
							var n4 = n3.childNodes[x];
							if(n4.nodeName == "DIV")
							{
								var subMenu = new subMainMenu(n4);
							}
						}
					}
					
				}

			}

		}
	}

	var me=this;
	var List3 = new AddListener(this.context, "mouseover", function()
	{
		for(var i=0; i < me.context.childNodes.length; i++)
		{
			var n = me.context.childNodes[i];
			if(n.nodeName == "UL")
			{
				n.className = "hover";
			}
			if(n.nodeName == "A")
			{
				n.className = "hover";
			}
		}

	});

	var List4 = new AddListener(this.context, "mouseout", function()
	{
		for(var i=0; i < me.context.childNodes.length; i++)
		{
			var n = me.context.childNodes[i];
			if(n.nodeName == "UL")
			{
				n.className = "none";
			}
			if(n.nodeName == "A")
			{
				n.className = "default";
			}

		}

	});


}



var AL = new AddListener(window, "load", function()
{
	addMenuBehavior(document.getElementById("menu"));
});