fixMenuWidth_ = function() {
	//Fix for dropline and split menu
		var lis = $('ja-flymenu').getChildren();
		if (lis.length)
		{
			var w = Math.floor($('ja-mainnav').offsetWidth / lis.length);
			$$('#ja-flymenu li').setStyle ('width', w);
			$$('#ja-flymenu li ul').setStyle ('width', w);
		}
}

window.addEvent ('domready', fixMenuWidth_);
sfHover = function() {
	//Update width for menu item
	var sfEls = document.getElementById("ja-flymenu").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; ++i) {
		sfEls[i].onmouseover=function() {
			clearTimeout(this.timer);
			if(this.className.indexOf("sfhover") == -1)
				this.className+="sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.timer = setTimeout(sfHoverOut.bind(this), 20);
		}
	}
}

function sfHoverOut() {
	clearTimeout(this.timer);
	this.className=this.className.replace(new RegExp("sfhover\\b"), "");
}

if (window.attachEvent) window.attachEvent("onload", sfHover);
