// JavaScript Document

var timer;

function OnLoad(event)
{
clearTimeout(timer);
timer = setTimeout("slideshowClick($('#button2'))","8000");
}

OnLoad();


function slideshowClick(who)
{
	var index = $(who).attr('id').replace(/button/, "");
	
	$(".slide").css("visibility","hidden");
	$("#image" + index).css("visibility","visible");
	$("#image" + index).css("opacity","0");
	$("#image" + index).animate({"opacity":1},800, "linear", null);
	$("ul.buttons li").removeClass("active");
	$("#image" + index).animate({"opacity":1},800, "linear", null);
	$("#button" + index).addClass("active");
	clearTimeout(timer);
	
	var size = $(who).siblings().length;
	
	if (size == index-1)
		index = 1;
	else
		index = parseInt(index)+1;
	
	timer = setTimeout("slideshowClick($('#button" + index + "'))", "8000");
	
	$("#image" + index-1).animate({"opacity":1},800, "linear", null);
}

