var isRunning = true;
function animate () {
		if(isRunning){
			$("#show-images").animate(
				{"left": "-220"},  //, "width": newWidth, "height": newHeight
				"slow",
				function() {
					$(this).css("left", "-110px").append($(this).find(":first-child"));
					window.setTimeout("animate()", 3000);
				});
		} else {
			window.setTimeout("animate()", 200);
		}
}
$(document).ready(function() {	
						$("#slide-detail").hide();
						animate();
						
						$("#next ,#prev , #show-images").mouseover(function() {
							//$("#log").append("mouse in<br />");	
							isRunning = false;
							$("#slide-detail").show();
						}).mouseout(function() {
							//$("#log").append("mouse out<br />");
							isRunning = true;
							$("#slide-detail").hide();
						});
						
						$("#prev").click(function() {
									  $("#show-images").animate(
										{"left": "0"},  //, "width": newWidth, "height": newHeight
										"slow",
										function() {
											$(this).css("left", "-110px").prepend($(this).find(":last-child"));
										});
						});
						
						$("#next").click(function() {
									  $("#show-images").animate(
										{"left": "-220"},  //, "width": newWidth, "height": newHeight
										"slow",
										function() {
											$(this).css("left", "-110px").append($(this).find(":first-child"));
										});
						});
						
						$("#show-images img").mouseover(function() {
								$(this).removeClass("imout");
								$(this).addClass("imover");		
								$("#slide-detail").html($(this).attr("title"));
						}).mouseout(function() {
								$(this).removeClass("imover");
								$(this).addClass("imout");
								$("#slide-detail").html("");
						});
						
						$("#show-images img").click(function() {
								window.location='products/show_product.php?id='+$(this).attr("alt");
						});
						
						$("#prev img").mouseover(function() {
							$(this).attr("src", "images/prev_over.png");			 
						}).mouseout(function() {
							$(this).attr("src", "images/prev.png");		
						});
						
						$("#next img").mouseover(function() {
							$(this).attr("src", "images/next_over.png");							 
						}).mouseout(function() {
							$(this).attr("src", "images/next.png");		
						});
						
	});
function func(){}
