// dhtml object werkzeugkasten
// fit fuer xhtml-strict

// example:  obj = new dObj(40, 260, "yourDivId", true); 
//           obj.gehNach(60, 300); 

function dObj(xpos, ypos, id, sicht) {
   if (document.documentElement) {
      this.el = document.getElementById(id);
      this.css = this.el.style;
      this.img = document.images;
   }
   else if (document.all) {
      this.el = document.all[id];
      this.css = this.el.style;
      this.img = document.images;
   }
   else if (document.layers) {
     // this.el = document.layers["anzeige"].document.layers[id];
      this.el = document.layers[id];
      this.css = this.el;
      this.img = this.el.document.images; 
   }
   if (xpos != "") {
      this.x = xpos; 
      this.css.left = xpos;
   }
   else {
      this.x = parseInt(this.css.left);
   }
   if (ypos != "") {
      this.y = ypos; 
      this.css.top = ypos;
   }
   else {
      this.y = parseInt(this.css.top);
   }
   
   this.zIndex   = this.css.zIndex;
   this.sichtbar = sicht;
   
   if (document.layers) {
      this.breite = this.el.document.width;
      this.hoehe = this.el.document.height;
   }
   else {
      this.breite = this.el.offsetWidth;
      this.hoehe  = this.el.offsetHeight;
   }
    
   this.gehNach   = dObj_gehNach;
   this.zeige     = dObj_zeige;
   this.verstecke = dObj_verstecke;
}

function dObj_gehNach(x, y) {
   this.css.left = x+"px";
   this.css.top  = y+"px";
   this.x = x;
   this.y = y;
}

function dObj_zeige(){
    this.css.visibility = "visible";
    this.css.display = "block";
    this.sichtbar = true;
}

function dObj_verstecke(){
    this.css.visibility = "hidden";
    this.css.display = "none";
    this.sichtbar = false;
}
