var Sublist={
  aObj:new Array(),
  oTimerSUB:null,
  show: function(elSelf){
    this.delay();
    var pEl=this.findParent(elSelf, 'xmlbutton');
    var chEl=this.findChild(pEl, 'SUBsub');
    if(typeof(chEl)!='undefined' && (chEl.style.visibility=='hidden' || chEl.style.visibility=='')){
      aPosition = this.findPosition(elSelf);
      placeX = parseInt(aPosition.x);
      placeY = parseInt(aPosition.y) + 13;
      chEl.style.left=placeX+'px';
      chEl.style.top=placeY+'px';
      chEl.style.visibility='visible';
    }
  },
  /*set timer for the out function*/
  setout: function(elSelf){
    /*get parent element*/
    var pEl=this.findParent(elSelf, 'xmlbutton');
    /*get child element*/
    var chEl=this.findChild(pEl, 'SUBsub');
    if(typeof(chEl)!='undefined' && chEl.style.visibility=='visible'){
      this.oTimerSUB=setTimeout("Sublist.close()", 150);
      this.aObj[this.aObj.length]=chEl;
    }
  },
  /*close the sublist*/
  close: function(idEl){
    for(var k=0; k<this.aObj.length; k++){
      this.aObj[k].style.visibility='hidden';
    }
    this.aObj=new Array();
    if(typeof(idEl)!='undefined'){
      var pEl=this.findParent(idEl, 'xmlbutton');
      var chEl=this.findChild(pEl, 'SUBsub');
      chEl.style.visibility='hidden';
    }
    if(this.oTimerSUB){
      clearTimeout(this.oTimerSUB);
    }
    return true;
  },
  /*delay close for next out*/
  delay: function(){
    if(this.oTimerSUB){
      clearTimeout(this.oTimerSUB);
    }
  },
  /*Find child HTML element element by className*/
  findChild: function(el, className){
    /*check for an old browsers IE4, NS4 no support for childNodes and other new fuctions*/
    if(!document.getElementById){
      return;
    }
    var i=0;
    chEl=null;
    while((chEl=el.childNodes[i]) && i<100){
      if(chEl.className==className){
        return chEl;
      }
      i++;
    }
  },
  /*Find parent HTML element element by className*/
  findParent: function(el, className){
    var i=0;
    if(el.className==className){
      return el;
    }
    while((el=el.parentNode) && i<100){
      if(el.className==className){
        return el;
      }
      i++;
    }
  },
  findPosition: function(elSelf) {
    if (elSelf.offsetParent){
      for (var iPosX = 0, iPosY = 0; elSelf.offsetParent; elSelf = elSelf.offsetParent) {
        iPosX += elSelf.offsetLeft;
        iPosY += elSelf.offsetTop;
      }
      return {'x':iPosX, 'y':iPosY};
    } else {
      return {'x':elSelf.x, 'y':elSelf.y};
    }
  }
};