ShowGoodWords=
{
 slideTimer:null, inc:Math.random(), img:new Image(), direction:'dn', top:-16, y:-16, x:0, step:5, period:200, idleTime:15000, count:0,
   
 init:function( level )
 {
  this.level = level & 0xff;  
  ///////////////////////////////setTimeout( function(){ ShowGoodWords.start(); }, 5000 );
 },
 
 start:function()
 {
  if( this.count++ < 10 )
  {
   this.theBody = document.getElementsByTagName('body')[0];     
  
   this.img.onload  = function(){ ShowGoodWords.disp(); };
  
   this.img.src = 'goodwords.php?level='+this.level+'&r=' + (this.inc++);
  }
 },

 disp:function()
 {
  this.x = (screen.width - this.img.width) / 2; 
    
  with( this.theBody.style )
  {
   backgroundRepeat = 'no-repeat';
   backgroundAttachment = 'fixed';
   backgroundImage = "url('" + this.img.src + "')";
   backgroundPosition = this.x + "px " + this.y + "px";    
  }
    
  this.slide();
 },
 
 slide:function()
 {
  var dirChange = false;
  
  if( this.direction == 'dn' )
  {
   if( this.y < 4 )
   {
    this.y += this.step;
   }
   else
   {
    this.direction = 'up';  
    dirChange = true;
   }
   
   setTimeout( function(){ShowGoodWords.slide()}, dirChange ? this.idleTime : this.period );
  }
  else
  {
   if( this.y > this.top )
   {
    this.y -= this.step;
   }
   else
   {
    this.direction = 'dn';  
    dirChange = true;
   }
   
   setTimeout( dirChange ? function(){ ShowGoodWords.start() } : function(){ShowGoodWords.slide()}, dirChange ? this.idleTime : this.period );
  }   
  
  this.theBody.style.backgroundPosition = this.x + "px " + this.y + "px";  
  this.theBody.style.backgroundAttachment = 'fixed';
 }
}