jQuery(window).load(function() {
    var scrollSpeed = 7;
    var total = 0;    
    var elements = jQuery('#box1 li');    
    jQuery.each(elements, function(){
 
        image = jQuery(this).find('img');
        image_height = image.height();
    
        if(image_height < 70){
            reste = 70 - image_height;
        
            image.css('marginTop', (reste/2)+'px');
        }
        total = total + jQuery(this).width()+30;

    });

    jQuery('#box1').css('width', total+'px');

 
    jQuery('#box1').everyTime(50,function(i) {
        var width = jQuery(this).width();
        if (parseInt(jQuery(this).css('left'))>(width*(-1)+8)){
            offset = parseInt(jQuery(this).css('left'))-scrollSpeed+'px';
            jQuery(this).css({
                'left':offset
            });
        }else{
            offset = parseInt(jQuery(this).parent().width())+8+'px';
            jQuery(this).css({
                'left':offset
            });
        }
    });


    jQuery('#box1').mouseover(function ()
    {
        speed = scrollSpeed;
        scrollSpeed = 0;       
    });
    
    // on mouse out event, start the scroller
    jQuery('#box1').mouseout(function ()
    {
        scrollSpeed = 5;
    });
});
        
