$(document).ready(function(){

	$("#menu img").hover(
		function () {
			oldsrc = this.src;
			var newsrc = this.src.replace(/\.jpg/, '-over.jpg');
			$(this).attr({src:newsrc});
			},
		function () {
			//var oldsrc = this.src.replace(/-over/, '');
			$(this).attr({src:oldsrc});
			}
		);
	
	$("#Top5 .thumb").hide();
	$("#Top5 .thumb:first").show();
	
	$("#addGBentry #guestbook").hide();
	$("#addGBentry h4 a").click(
		function () {
			$("#guestbook").toggle();
		});
	
	$(".history-thumb a").lightBox();

});

var timer = window.setInterval("changeTop5()", 3000);
	
function changeTop5() {
	if (document.getElementById("Top5") != null) {
		var thumbs = $("#Top5 .thumb");
		thumbs.each(function (i) {
			if($(this).css("display") == "block") {
				$(this).fadeOut("500", function() {
					if (i<thumbs.length-1) {
						$(this).next().fadeIn("500");
					}
					else {
						$(thumbs[0]).fadeIn("500");
					}
				});
				return false;
			}
		});
	}
}