var Diashow = {
  
  counter : 0,

  wait : 10000,

  cycle : function() {
  
    if (document.getElementById('diashow_' + (this.counter + 1)))
    {
      document.getElementById('diashow_' + this.counter).style.display = 'none';
      document.getElementById('diashow_' + (this.counter + 1)).style.display = 'block';
      this.counter++;
    }
    else if (!this.counter)
    {
      return;
    }
    else
    {
      document.getElementById('diashow_' + this.counter).style.display = 'none';
      document.getElementById('diashow_0').style.display = 'block';
      this.counter = 0;
    }

    setTimeout("Diashow.cycle()", this.wait);
  },

  go : function() {

    setTimeout("Diashow.cycle()", this.wait);
  },

  addOnload : function(f) {

    var _onload = window.onload;
    
    if (typeof window.onload == 'function') 
    {
      window.onload = function()
      {
        _onload();
        f();
      }
    } else {
      window.onload = f;
    }
  },

  start : function() {
    Diashow.addOnload(function() {
      setTimeout("Diashow.cycle()", Diashow.wait);
    });
  }
}

Diashow.start();

