
var product = {
   close_delay: 2000,

   initialize: function() {
      this.elm = $('LayerMenu');
   },

   show:  function() {
      this.elm.style.display = 'block';
      clearTimeout(this.timer);
   },

   preclose: function() {
      this.timer = setTimeout(this.close.bind(this), this.close_delay);
   },

   close: function() {
      this.elm.style.display = 'none';
   }
};

register_hook('load', function() {
      product.initialize();
      addEvent(product.elm, 'mouseover', product.show.bind(product));
      addEvent(product.elm, 'mouseout',  product.preclose.bind(product));
      addEvent($('LayerMenuLink'), 'mouseover', product.show.bind(product));
      addEvent($('LayerMenuLink'), 'mouseout',  product.preclose.bind(product));
   });

