// JavaScript Document
var scrollWrapW,myScroll;

var rollDirection = 0; //0为左 1为右
var speed = 4000;

function __scrollBox(){

   if (rollDirection == 0){ 
    
    scrollWrapW = -($('#botton_logo ul li').eq(0).outerWidth(true)) + 'px'; 
       $('#botton_logo ul').animate({left:scrollWrapW}, { 
         duration:500,
         complete:function(){
           $('#botton_logo ul').append($('#botton_logo ul li:first'));
           $('#botton_logo ul').css("left","0"); 
          }         
         }); 
         
  }else{ 
        var last = $('#botton_logo ul li').length - 1;     
        
        scrollWrapW = -($('#botton_logo ul li').eq(last).outerWidth(true)) + 'px';        
         $('ul').animate({left:0}, {
            duration:100, 
            complete:function(){
                 $('ul').prepend($('ul li:last')); 
                 $('ul').css("left",scrollWrapW); 
              }   
           });           
          }         
       }
         
                  
      $(document).ready(function(){
      
           myScroll = setInterval(__scrollBox,speed);
           
           $('#scrool_wrap').hover(function(){ 
            clearInterval(myScroll);
           },function(){ 
               myScroll = setInterval(__scrollBox,speed);
           });
              
              
      $('.left').click(function(){
          rollDirection = 0; 
      });
      $('.right').click(function(){ 
          rollDirection = 1;
       });
       
  })
