$(function() {
	activepromo = $("#promo").hasClass("slideshow");
	if (activepromo)
	{
		$(this).everyTime(3000, 'mytime', function() {
			
			current = $("#promo img").hasClass("active");
			
			if (!current)
			{	
				current = $("#promo img").eq(0);
				current.addClass("active")
			}
			else
			{
				current = $("#promo img.active");
			}
			
			first = $("#promo img").eq(0);
			next = $("#promo img.active").next("img");
			prev = $("#promo img.active").prev("img");
			
			src = next.attr("src");
	
			if (src)
			{
				current.removeClass("active");
				next.addClass("active");
				next.css("z-index", 10);
				current.fadeOut(500, function(){ next.css("z-index", 11); current.css("z-index", 2).fadeIn(0); });
			}
			else
			{
				current.removeClass("active");
				first.addClass("active");
				first.css("z-index", 10);
				current.fadeOut(500, function(){ first.css("z-index", 11); current.css("z-index", 2).fadeIn(0); });
			}
			
			id = $("#promo img.active").attr("title");
			
			$("#promo"+id+" a")
				.animate({ top: "20px" }, { duration: 200, queue: true })
				.animate({ top: "15px" }, { duration: 200, queue: true })
				.animate({ top: "20px" }, { duration: 100, queue: true })
				.animate({ top: 0 }, { duration: 200, queue: true });
	
		});
	}
});
