﻿function MenuItem(id, listID){
  this.init(id, listID);
}
MenuItem.prototype = {
  init: function(id, listID){
    this.id = id;
    this.listID = listID;
    this.setEvents();
  },
  
  setEvents: function(){
    if(!GlobalFunc.IsNull($(this.listID))){
      Event.observe(this.id, 'mouseover', this.mouseover.bindAsEventListener(this));
      Event.observe(this.id, 'mouseout', nd);
    }
  },
  
  mouseover: function(){
  
    var elm = $(this.id);
    var listElm = $(this.listID);
    var coords = elm.cumulativeOffset();
    if(Prototype.Browser.WebKit){
      coords.top = coords.top - 6;
    }
    var popCoords = {
      x: coords.left,
      y: coords.top + 24
    }
    var width = listElm.getWidth();
    return overlib($(this.listID).innerHTML, FIXX, popCoords.x, FIXY, popCoords.y, STICKY, MOUSEOFF, WIDTH, width, FGCLASS, 'fgclass', BGCLASS, 'bgclass', BORDER, 0);
  }

}

var MenuSubItem = {
  MouseOver: function(elm){
    elm.className = elm.className + 'MO';
  },
  
  MouseOut: function(elm){
    elm.className = elm.className.substr(0, elm.className.length-2);
  }
}