
 function PlaceCloud()
 {
    var uid = Math.round(20+Math.random()*100);
    if(document.getElementById("cloud"+uid) == null)
    {
        document.body.innerHTML+= " <div id='cloud"+uid+"'style='position:absolute;background-repeat:no-repeat; background-image:url(images/cloud"+Math.round(1+Math.random()*3)+".png);  width:168px; height:168px; top:"+(150+Math.round(Math.random()*(window.screen.availHeight-500)))+"px; left:"+Math.round(Math.random()*window.screen.availHeight)+"px;z-index:-"+Math.round(Math.random()*30)+"'>&nbsp;</div>";
         setInterval("MoveCloud('cloud"+uid+"')",uid);
    }
    else
    { PlaceCloud(); }
 }
 
 
 function MoveCloud(path)
 {

    try
    {
        var cloudObj = document.getElementById(path);
        var leftStr = cloudObj.style.left;
        if(leftStr ==""){leftStr = Reset(cloudObj);}
        var leftInt = parseInt(leftStr.substring(0, leftStr.length-2));
        cloudObj.style.left = (parseInt(leftInt) +1).toString() + "px";
        if(leftInt > window.screen.availWidth)
        {
          Reset(cloudObj);
        }
    }
    catch(e)
    {
      alert(e);
    }
 }
 
 function Reset(obj)
 {
    obj.style.left = (-200- (Math.random()*30)).toString()+"px";
    return obj.style.left;
 }

