//$.rool_iamge = function(opt){};
$(document).ready(function(e) {
	$("#jquery_jplayer_1").jPlayer({
		ready: function () {
			$(this).jPlayer("setMedia", {
				flv: "../"+$("#video_src").val(),
				poster: $("#video_img").val()
			});
		},
		swfPath: "js",
		supplied: "flv",
		size: {
			width: "300px",
			height: "145px"
		}
	});
	// rool image
	var rool_image = $(".roll_image");
	var rool_image_container = $(".rool_image_container");
	var roolling = setInterval(rolling_function_for_ie,100);
	function rolling_function_for_ie(){
		roolling_image(rool_image);
	}
	rool_image.mouseover(function(e){
//		alert("over");
		clearInterval(roolling);
	//	e.stopImmediatePropagation();
	});
	rool_image.mouseout(function(e) {
//		alert("out");
        roolling = setInterval(rolling_function_for_ie,100);
	//	e.stopImmediatePropagation();
    });
	function roolling_image(ele){
		var margin_left = parseInt(ele.css("margin-left"))-1;
		ele.css("margin-left",margin_left);
		if(
			margin_left<0 && 
			margin_left>-140 &&
			ele.find("li:last-child").attr("name") != "first"
		){
			var first = ele.find("li:first-child").clone();
			first.attr("name","first");
			ele.append(first);
		}else if(
			margin_left<-140
		){
			ele.children().eq(0).remove();
			ele.find("li[name='first']").removeAttr("name");
			ele.css("margin-left",10);
		}
	}	
});
