function addMainNavBehavior(context)
{

	for(var i=0; i < context.childNodes.length; i++)
	{
		var n = context.childNodes[i];

		if(n.nodeName == "LI")
		{
			n.onmouseover = function()
			{
				this.className = "hover";
				document.getElementById(this.id + "Img").src = "images/" + this.id + "_but_hover.png";

				for(var i=0; i < this.childNodes.length; i++)
				{

					var n= this.childNodes[i];
		
					if(n.nodeName == "UL")
					{
						
						n.className = "show";

					}
				}

			}


			n.onmouseout = function()
			{

				this.className = "default";
				document.getElementById(this.id + "Img").src = "images/" + this.id + "_but.png";

				for(var i=0; i < this.childNodes.length; i++)
				{

					var n= this.childNodes[i];
		
					if(n.nodeName == "UL")
					{

						n.className = "hide";


					}
				}

			}
			for(var i2=0; i2<n.childNodes.length; i2++)
			{
				var n2 = n.childNodes[i2];
				if(n2.nodeName == "UL")
				{
					for(var i3=0; i3<n2.childNodes.length; i3++)
					{
						var n3 = n2.childNodes[i3];
						if(n3.nodeName == "LI")
						{
							n3.onmouseover = function()
							{
								this.className = "hover";
							}

							n3.onmouseout = function()
							{
								this.className = "default";
							}

						}
				
					}
		


				}


			}
	

		}
	}





}





 if (window.addEventListener) window.addEventListener("load", init, false);
    else if (window.attachEvent) window.attachEvent("onload", init);

    function init() {

	addMainNavBehavior(document.getElementById('nav'));

    }