function spreadClouds(visible)
{
    if (visible == false)
    {
        $('.cloud').css('display','none');
        return;
    }
    
    $('.cloud').each(function(){
            //$(this).css('left', Math.floor(Math.random() * ($(window).width() + $(this).width())) - ($(this).width()/2));
            //$(this).css('top', Math.floor(Math.random() * ($(window).height()+$(this).width())) - ($(this).height()/2));
            minx = 0;
            maxx = ($(window).width() - $(this).width());
            miny = 0;
            maxy = ($(window).height()-$(this).height());
            xHateStart = (maxx-minx) / 4;
            xHateEnd = 2 * ((maxx-minx) / 3);
/*            yHateStart = (maxy-miny) * ();
            yHateEnd = 2 * ((maxy-miny) / 3);    */       
            
            x =  Math.floor(Math.random() * (maxx-minx)) + minx;
            y =  Math.floor(Math.random() * (maxy-miny)) + miny;
            
            if (x > xHateStart && x < (xHateEnd))
            {               
                x += (x-xHateStart) > (xHateEnd-x) ? 200 : -200;
            }
/*            if (y > yHateStart && y < (yHateEnd))
            {               
                y += (y-yHateStart) > (yHateEnd-y) ? 200 : -200;
            }     */       
            
            $(this).css('left',x);
            $(this).css('top', y);
            $(this).css('display','block');
        });
}

$(document).ready(function(){
        for(i=0; i<5;i++)
           $('body').append('<div class="cloud"></div>');
        
        spreadClouds(true);
    });

