(function() {
	$$("#menu li.homenonactive").each(function(el) {
		el.observe("mouseover", function() {
			el.addClassName("hover");
		});
		el.observe("mouseout", function() {
			el.removeClassName("hover");
		});
	});

	if ($("imagechangerthumbs")) {
		var cont = $("imagechangerthumbs");
		var el = $("thumbs-left");
		el.style.cursor = "pointer";
		el.observe("click", function() {
			new Effect.Scroll(cont, { x: cont.scrollLeft - cont.getWidth() });
		});
		var el = $("thumbs-right");
		el.style.cursor = "pointer";
		el.observe("click", function() {
			new Effect.Scroll(cont, { x: cont.scrollLeft + cont.getWidth() });
		});

		var slideshow_timer;
		var timeout = 5000;

		var next = function() {
			nextImage();
			slideshow_timer = window.setTimeout(next, timeout);
		};

		if ($$(".imagechangerthumb").length > 1)
			slideshow_timer = window.setTimeout(next, timeout);

		$$(".imagechangerthumb").invoke("observe", "click", function() {
			window.clearTimeout(slideshow_timer);
		});
	}
}).onLoad();

