function DDC_SetContentHandler(ContentHandler)
{
  this.ContentHandler=ContentHandler;
}

function DDC_TimerFunc()
{
  var text="Droeppez Layer Content Manager";
  if (!this.running)
    return;
  if (this.ContentHandler)
    text=this.ContentHandler();
  if (this.isDOM)
    this.element.innerHTML=text;
  else
  {
    this.element.document.open();
    this.element.document.write(text);
    this.element.document.close();
  }
  if (this.usetimer)
    this.timestep=this.tmstep;
  else
    this.timeout=window.setTimeout(this.name+".TimerFunc()",this.elapse);
}

function DDC_Step()
{
  var text="Droeppez Layer Content Manager";
  if (this.running)
    return;
  if (this.ContentHandler)
    text=this.ContentHandler();
  if (this.isDOM)
    this.element.innerHTML=text;
  else
  {
    this.element.document.open();
    this.element.document.write(text);
    this.element.document.close();
  }
}

function DDC_Run(elapse)
{
  this.elapse=elapse;
  this.running=1;
  if (this.usetimer)
  {
    this.tmstep=Math.round(this.elapse/u_timer_elapse);
    if (this.tmstep<1)
      this.tmstep=1;
    this.timestep=1;
    if (u_timer_elapse>0)
      u_timer_continue();
  }
  else
  {
    if (this.timeout!=0)
      window.clearTimeout(this.timeout);
    this.timeout=0;
    this.TimerFunc();
  }
}

function DDC_Stop()
{
  this.running=0;
  if (this.usetimer)
    this.timestep=0;
  else
    if (this.timeout!=0)
    {
      window.clearTimeout(this.timeout);
      this.timeout=0;
    }
}

function DivContent(name,elementname)
{
  this.name=name;
  this.running=0;
  this.SetContentHandler=DDC_SetContentHandler;
  this.TimerFunc=DDC_TimerFunc;
  this.Run=DDC_Run;
  this.Step=DDC_Step;
  this.Stop=DDC_Stop;
  this.ContentHandler=0;
  this.isDOM=0;
  this.elapse=0;
  if (window.document.all)
    this.element=eval("window.document.all."+elementname);
  else
    if (typeof(window.document.getElementById)=="function")
      this.element=window.document.getElementById(elementname);
    else
      this.element=eval("window.document."+elementname);
  if (this.element.innerHTML)
    this.isDOM=1;
  if (typeof(u_timer_add_object)=="function")
  {
    this.usetimer=1;
    this.timestep=0;
    this.tmstep=1;
    this.timeval=0;
    u_timer_add_object(this);
  }
  else
  {
    this.usetimer=0;
    this.timeout=0;
  }
}
