/*
		rolling page by hong..
*/
var leftCt = 0;
	$(function(){
		//$("#album").attr("top", "0");
		imgStart("R");
		imgStart2("R");
	});
	function imgStart(tp){
		clearInterval($("#imgList").attr("timer"));
		if(tp == "R"){ // ¿À¸¥ÂÊ ÀÌµ¿
			imgRight();
			$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // ¸ØÃçÀÖ´Â ½Ã°£
		}else{ // ¿ÞÂÊÀÌµ¿
			if(leftCt == 0){
				var leng = $("#imgList div").size();
				$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
				$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
				$("#imgList>div").eq(leng).remove();
				leftCt = 1;
			}
			imgLeft();
			$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
		}
	}
	function imgRight(){
		$("#imgList").animate({
			left : parseInt($("#imgList div").eq(0).width() * -1)
		},300,function(){
			$("#imgList").css("left", "0px");
			$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
			$("#imgList>div").eq(0).remove();
		});
	}
	function imgLeft(){
		var leng = $("#imgList div").size();
		$("#imgList").animate({
			left : 0
		},300,function(){
			$("#imgList").css("left", "0px");
			$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
			$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
			$("#imgList>div").eq(leng).remove();
		});
	}

		function imgStart2(tp){
		clearInterval($("#imgList2").attr("timer"));
		if(tp == "R"){ // ¿À¸¥ÂÊ ÀÌµ¿
			imgRight2();
			$("#imgList2").attr("timer", setInterval("imgRight2()", 4000)); // ¸ØÃçÀÖ´Â ½Ã°£
		}else{ // ¿ÞÂÊÀÌµ¿
			if(leftCt == 0){
				var leng = $("#imgList2 div").size();
				$("#imgList2").css("left",parseInt($("#imgList2 div").eq(0).width()*-1));
				$("#imgList2>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList2"));
				$("#imgList2>div").eq(leng).remove();
				leftCt = 1;
			}
			imgLeft2();
			$("#imgList2").attr("timer", setInterval("imgLeft2()", 4000));
		}
	}
	function imgRight2(){
		$("#imgList2").animate({
			left : parseInt($("#imgList2 div").eq(0).width() * -1)
		},300,function(){
			$("#imgList2").css("left", "0px");
			$("#imgList2>div").eq(0).clone().appendTo($("#imgList2"));
			$("#imgList2>div").eq(0).remove();
		});
	}
	function imgLeft2(){
		var leng = $("#imgList2 div").size();
		$("#imgList2").animate({
			left : 0
		},300,function(){
			$("#imgList2").css("left", "0px");
			$("#imgList2").css("left",parseInt($("#imgList2 div").eq(0).width()*-1));
			$("#imgList2>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList2"));
			$("#imgList2>div").eq(leng).remove();
		});
	}
