$(document).ready(function() {
current=0;
timer=0;
showTime=4500;
timer = setTimeout ("autoPlay()", showTime);

thumbs = $(".infoPanel li .infoLink");
pics = $(".infoPanel li .infoLink").length;

$(".infoPanel li a img").fadeTo(1,0.8);

$(".infoPanel li a").eq(0).addClass("current");
$("a.current").next().fadeIn();
$(".infoPanel li a.current img").fadeTo(250,1);

thumbs.mouseover(function() {
	if (this.className.indexOf("current") == -1) {
		$("a.current").next().fadeOut();
		$(".infoPanel li a.current img").fadeTo(1,0.8);
		$("a.current").removeClass("current");
		$(this).addClass("current");
		$("a.current").next().fadeIn();
		$(".infoPanel li a.current img").fadeTo(250,1);
newpic=0;
$.each($(".infoPanel li .infoLink"), function() {
if (this.className.indexOf("current") != -1) {current = newpic}
newpic++
});

	}
});

$(".infoPanel").mouseover(function() {clearTimeout(timer);});
$(".infoPanel").mouseout(function() {timer = setTimeout ("autoPlay()", showTime);});



});

function autoPlay () {
		$("a.current").next().fadeOut();
		$(".infoPanel li a.current img").fadeTo(1,0.8);
		$("a.current").removeClass("current");

current++
if (current==pics) {current=0;}

		thumbs.eq(current).addClass("current");
		$(".infoPanel li a.current").next().fadeIn();
		$(".infoPanel li a.current img").fadeTo(250,1);
timer = setTimeout ("autoPlay()", showTime);
}

