initNav = function() {
		var navRoot = document.getElementById("main-nav");
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
			}
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(" hover", "");
			}
		}
}
if (window.attachEvent && !window.opera)
	attachEvent("onload", initNav);

var scrollposition = 0;
var ul = false;
var step = 117;

function initScroll()
{
	ul = document.getElementById('step-scroll');
	anext = document.getElementById('next-button');
	aprev = document.getElementById('prev-button');
	if(ul && aprev && anext)
	{
		if(0 < ul.parentNode.offsetLeft + ul.offsetWidth - ul.parentNode.parentNode.offsetWidth - step)
		{
			if(anext.className.indexOf("hidden") == -1)
				anext.className += " hidden";
		}
		if(ul.parentNode.offsetLeft < 0)
		{
			if(aprev.className.indexOf("hidden") == -1)
				aprev.className += " hidden";
		}
	
		aprev.href = "JavaScript:_prev()";
		anext.href = "JavaScript:_next()";	
	
	}
}

function _next()
{
	if(ul && aprev && anext)
	{
		if(0 < ul.parentNode.offsetLeft + ul.offsetWidth - ul.parentNode.parentNode.offsetWidth - step)
		{
			ul.parentNode.style.left = ul.parentNode.offsetLeft - step + "px";
			aprev.className = aprev.className.replace(" hidden","");
		}

		if(0 >= ul.parentNode.offsetLeft + ul.offsetWidth - ul.parentNode.parentNode.offsetWidth)
		{
			if(anext.className.indexOf("hidden") == -1)
				anext.className += " hidden";
		}
	}
}

function _prev()
{
	if(ul && aprev && anext)
	{
		if(ul.parentNode.offsetLeft < 0)
		{
			ul.parentNode.style.left = ul.parentNode.offsetLeft + step + "px";
			anext.className = anext.className.replace(" hidden","");
		}
		if(ul.parentNode.offsetLeft == 0)
		{
			if(aprev.className.indexOf("hidden") == -1)
				aprev.className += " hidden";
		}
	}
}

if (window.addEventListener)
	window.addEventListener("load", initScroll, false);
else if (window.attachEvent)
	window.attachEvent("onload", initScroll);
