function ieHover()
{
	var nav = document.getElementById("main-menu");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i=0; i<nodes.length; i++)
		{
			nodes[i].onmouseover = function() 
			{
				this.className += " hover";
			}
			nodes[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
	}
}

if (window.attachEvent && !window.opera){
	window.attachEvent("onload", ieHover);
}
function initAccordion()
{
	var accordion_block = document.getElementById('accordion');
	if(accordion_block)
	{
		var accordion = new Accordion('div.slider-head', 'div.slider-body', {
			show: -1, alwaysHide: true,
			opacity: false,
			onActive: function(toggler, element){
				toggler.parentNode.className += ' active';
			},		 
			onBackground: function(toggler, element){
				if (toggler) {
				toggler.parentNode.className = toggler.parentNode.className.replace('active',''); }
			}
		}, accordion_block);
	}
}

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

function mainLogout()
{
    expireAt = new Date;
    expireAt.setMonth(expireAt.getMonth() - 1);
    if (document.cookie != "")
    {
        crumbs = document.cookie.split(";");
        for(i=0; i < crumbs.length; i++)
        {
            crumbName = crumbs[i].split("=")[0];
            document.cookie = crumbName + "=;expires=" + expireAt.toGMTString();
        }
    }
    location.href="login.php?logout=true";
}
