function IE6hover(){
	var nav = document.getElementById("main-nav");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i = 0; i < nodes.length; i++)
		{
			nodes[i].onmouseover = function () 
			{
				if (this.className.indexOf("hover") == -1)
				{
					this.className += " hover";
				}
			}
			nodes[i].onmouseout = function ()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
	var nav = document.getElementById("side-list");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i = 0; i < nodes.length; i++)
		{
			nodes[i].onmouseover = function () 
			{
				if (this.className.indexOf("hover") == -1)
				{
					this.className += " hover";
				}
			}
			nodes[i].onmouseout = function ()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
	var nav = document.getElementById("sub-nav");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i = 0; i < nodes.length; i++)
		{
			nodes[i].onmouseover = function () 
			{
				if (this.className.indexOf("hover") == -1)
				{
					this.className += " hover";
				}
			}
			nodes[i].onmouseout = function ()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}
if (window.attachEvent && !window.opera) window.attachEvent("onload", IE6hover);
	
	
function initMenu(){
	if(typeof($) == 'function'){
		$('ul.side-nav li').each(function(){
			var _hold = $(this);
			var _btn = _hold.children('a');
			var _box = _hold.children('ul');
			if(_box.length){
				_btn.click(function(){
					_hold.toggleClass('opened');
					return false;
				});
			}
		});
	}
}
if (window.addEventListener) window.addEventListener("load", initMenu, false);
else if (window.attachEvent && !window.opera) window.attachEvent("onload", initMenu);
