Ysf.Dom.quiet = true;

PanelMenu = {
   timers: new Array (),
   elements: new Array (),
   offsetX: {'vertical': 6,  'horizontal': 150, 'default': 122},
   offsetY: {'vertical': 19, 'horizontal': 0,   'default': -1},
   
   enter: function (el) {
      var c = $child(el, 'ul');
      
      if (el.parentNode.parentNode.tagName.toLowerCase () == 'li') {
         this.hold(el.parentNode.parentNode);
      }
      if (c) {
         var r = el.parentNode.parentNode.parentNode;
         var orientation = 'default';
         if ( r.tagName.toLowerCase () == 'map' && r.id == 'root-nav' ) {
            c.style.top = px(el.offsetTop + this.offsetY['vertical']);
            c.style.left = px(el.offsetLeft + this.offsetX['vertical']);
         } else if ( r.tagName.toLowerCase () == 'map' && r.id == 'main-nav' ) {
            c.style.top = px(20);
            c.style.left = px(-1);
         } else if ( $ancestor(el, 'map').id == 'main-nav' ) {
            c.style.top = px(-1);
            c.style.left = px(el.offsetLeft + 134);
         } else {
            c.style.top = px(el.offsetTop + this.offsetY[orientation]);
            c.style.left = px(el.offsetLeft + this.offsetX[orientation]);
         }
         c.style.zIndex = 300;
	     c.style.display = 'block';
	  }
   },
   
   hold: function (el) {
      if (this.timers[el.id]) {
         clearTimeout(this.timers[el.id]);
      }
      if (el.parentNode.parentNode.tagName.toLowerCase () == 'li') {
         this.hold(el.parentNode.parentNode);
      }
   },
   
   exit: function (el) {
      this.elements[el.id] = el;
      this.timers[el.id] = setTimeout('PanelMenu.close(\'' + el.id + '\')', 200);
   },
   
   close: function (id) {
      el = this.elements[id];
      var c = $child(el, 'ul');
      if (c) {
         c.style.display = 'none';
      }
   }
};

