function initMenu()
{
	var nodes = document.getElementById("navigation").getElementsByTagName("a");
	for (var i=0; i<nodes.length; i++)
	{

			nodes[i].onclick = function ()
			{

				if (this.parentNode.className == "search-block" || this.parentNode.className == "search-block active")
					{
					
						if(document.getElementById("searchBox").style.display == "block") 
							document.getElementById("searchBox").style.display = "none";
						else
							document.getElementById("searchBox").style.display = "block";
						//if(this.parentNode.className.indexOf("active") !=-1)
						//{
						//	this.parentNode.className = this.parentNode.className.replace("active", "");
						//	
						//}
						//else
						//{
						//	this.parentNode.className += " active";
						//}
						//return false;
						//}
					}
			}
	}
}

function initAccordion() {
	var _box = document.getElementById("menu");
	if (_box)
	{
		var hAccordion = new accordion('menu', {
    	classNames : {
        	toggle : 'accordion_toggle',
        	toggleActive : 'accordion_toggle_active',
        	content : 'accordion_content'
    	},
    	defaultSize : {
        	width : null,
        	height: null
    	},
    	direction : 'vertical',
    	onEvent : 'mouseover'
		});
	}
}

if (window.addEventListener){
	window.addEventListener("load", initMenu, false);
	window.addEventListener("load", initAccordion, false);
}
else if (window.attachEvent){
	window.attachEvent("onload", initMenu);
	window.attachEvent("onload", initAccordion);
}
