var headerHeight = 80;
var anim,w,morrowWidth,
    startAnim = false ;

$(document).ready(function(){     
   setTimeout(function(){
        
        $('body > * ').fadeIn('slow');
        
        var h = $(window).height() - headerHeight;
     
        resizeImgs(h);
        windowHandler(h);
        resizeContentWidth();
     
        morrowWidth = $('.morrow:eq(0)').width();
        
        var timer;
        $(function($) {
                timer = setTimeout(Cloud, 0);
        });
        
         function Cloud() {
                $(".morrow:first-child").css({marginLeft: 0}).animate({marginLeft: -morrowWidth}, 75000,function(){
                        $('.morrow:first-child').appendTo('#content').css({marginLeft: 0});
                        $('.morrow:first-child').animate({marginLeft: -morrowWidth}, 75000, function(){
                                timer = setTimeout(Cloud, 0);
                        });     
                     });     
         }
        
   },500);   
   
});

function resizeImgs(h){
   $('img').height(h);
}

function windowHandler(h){ 
   $(window).bind('resize',function(){
         h = $(window).height() - headerHeight;
         w = $('.morrow img').outerWidth(true);
         $('#content').width(w*2);
         resizeImgs(h);
   });
}

function resizeContentWidth(){
   w = $('.morrow:eq(0) img').width();
   $('#content').width(w*2);
}
