$(function(){
	$("#thumb_img").show("slow");
	$("#thumb_img li:not(:first)").fadeTo(700,0.3);
	var count = 1,
	end = $("#thumb_img li").length,
	fadeTimer = setInterval(function(){
		if(count == 0){
			$("#main_img" + end).fadeOut("slow");
			$("#thumb_img" + end).fadeTo(700,0.3);
		}else{
			$("#main_img" + count).fadeOut("slow");
			$("#thumb_img" + count).fadeTo(700,0.3);
		}
		$("#main_img" + (++count) + ",#main_img" + count + " *").fadeIn("slow");
		$("#thumb_img" + count).fadeTo(700,1);
		if(count == end){
			count = 0;
		}
	},10000);
	

	$("#thumb_img li").click(function(){
		num = eval($(this).attr("id").replace("thumb_img",""));
		if($("#main_img" + num).css("display")=="none"){
			$("#main_img div").fadeOut("slow");
			$("#main_img" + num + ",#main_img" + num + " *").fadeIn("slow");
			$(this).fadeTo(700,1);
			$("#thumb_img li").not(this).fadeTo(700,0.3);
			if(num == end){
				count = 0;
			}else{
				count = num;
			}
		}
	});

});


//$(function(){
//	setInterval(function(){
//		
//	},1000);
//});
