﻿var timerID,timerID1,timerID2,timerID3,timerID4
(function($){
$.fn.extend({
        Scroll:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("div:first");
                var  lineH=_this.find("div:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("div:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID);
                },function(){
                        timerID=setInterval("scrollUp()",timer);
                }).mouseout();
        }        
})
})(jQuery);

(function($){
$.fn.extend({
        Scroll2:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("div:first");
                var  lineH=_this.find("div:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp2=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("div:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID2);
                },function(){
                        timerID2=setInterval("scrollUp2()",timer);
                }).mouseout();
        }        
})
})(jQuery);



(function($){
$.fn.extend({
        Scroll3:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("div:first");
                var  lineH=_this.find("ul:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp3=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("ul:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID3);
                },function(){
                        timerID3=setInterval("scrollUp3()",timer);
                }).mouseout();
        }        
})
})(jQuery);


(function($){
$.fn.extend({
        Scroll4:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("div:first");
                var  lineH=_this.find("ul:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp4=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("ul:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID4);
                },function(){
                        timerID4=setInterval("scrollUp4()",timer);
                }).mouseout();
        }        
})
})(jQuery);

(function($){
$.fn.extend({
        Scroll5:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("ul:first");
                var  lineH=_this.find("li:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp5=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID5);
                },function(){
                        timerID4=setInterval("scrollUp5()",timer);
                }).mouseout();
        }        
})
})(jQuery);



var timerID5;

(function($){
$.fn.extend({
        Scroll5:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("ul:first");
                var  lineH=_this.find("li:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height
()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp5=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID5);
                },function(){
                        timerID5=setInterval("scrollUp5()",timer);
                }).mouseout();timerID5=setInterval("scrollUp5()",timer);

        }        
})
})(jQuery);


var timerID6;

(function($){
$.fn.extend({
        Scroll6:function(opt,callback){
                //参数初始化
                if(!opt) var opt={};
                var _this=this.eq(0).find("ul:first");
                var  lineH=_this.find("li:first").height(),
                        line=opt.line?parseInt(opt.line,10):parseInt(this.height
()/lineH,10),
                        speed=opt.speed?parseInt(opt.speed,10):1000,
                        timer=opt.timer?parseInt(opt.timer,10):3000;
                if(line==0) line=1;
                var upHeight=0-line*lineH;
                scrollUp6=function(){
                        _this.animate({
                                marginTop:upHeight
                        },speed,function(){
                                for(i=1;i<=line;i++){
                                        _this.find("li:first").appendTo(_this);
                                }
                                _this.css({marginTop:0});
                        });
                }
                _this.hover(function(){
                        clearInterval(timerID6);
                },function(){
                        timerID6=setInterval("scrollUp6()",timer);
                }).mouseout();timerID6=setInterval("scrollUp6()",timer);

        }        
})
})(jQuery);