// JavaScript Document
//滚动插件
//用法：$("#id").ScrollLeft({speen:速度})
//by Berk
(function($){
$.fn.extend({
        ScrollLeft:function(opt,callback){
                if(!opt) var opt={};
				var _this=this;
                speed=opt.speed?parseInt(opt.speed,10):500,	
				scrollshow_Marquee=function(){
					if(_this.find("#scrollshow_demo2").innerWidth()-_this.scrollLeft()<=0){
						_this.scrollLeft(_this.scrollLeft()-_this.find("#scrollshow_demo1").innerWidth())
					}
					else{
						_this.scrollLeft(_this.scrollLeft()+1);
					}
				}		
        		_this.find("#scrollshow_demo2").html(_this.find("#scrollshow_demo1").html())
				var scrollshow_MyMar=setInterval("scrollshow_Marquee()",speed)
				$(this).mouseover(function() {clearInterval(scrollshow_MyMar)})
				$(this).mouseout(function() {scrollshow_MyMar=setInterval(scrollshow_Marquee,speed)})				
        }        
})
})(jQuery);			
