/* init */

window.onload = function() {
	suckerFishIEInit();
	fadeOutInit();
}

/* fadeout */

var targetUrl;

function fadeOutInit() {
	var e = $A(document.getElementsByTagName('a'));
	e.each(
		function(item) {
			item.onclick = function() {
				targetUrl = item.getAttribute('href');
				Effect.Fade('inlinenav',
					{afterFinish: function() {window.location = targetUrl}}
					);
				return false;
			};
		}
	);
}

/* suckerfish */

function suckerFishIEInit() {
	if (!document.all)
	{
		return;
	}

	var navRoot = $('nav');
	var children = $A(navRoot.getElementsByTagName("li"));

	children.each(
		function(node) {
			node.onmouseover=function() {
				this.className+=" over";
			}
			node.onmouseout=function() {
				this.className=this.className.replace(" over", "");
			}
		}
	);
}
