﻿var menubox = function(html, obj, diff){
  if($('menubox') == null){
    new Insertion.Top(document.body,
      "<div id='menubox' style='position:absolute;'>"
    + "<button id='menubox_close' onclick='menubox.hide();'>×</button>"
    + "<div id='menubox_menu'></div>"
    + "</div>");
  }
  Element.show('menubox');
  Element.update('menubox_menu', html);
  var value = Position.cumulativeOffset(obj);
  var left = value[0];
  var top  = value[1] + obj.offsetHeight;
  if(diff){
    left += (parseInt(diff.left) || 0);
    top  += (parseInt(diff.top)  || 0);
  }
  Element.setStyle('menubox', {'left':left, 'top':top});
}
menubox.hide = function(){
  Element.update('menubox_menu', '');
  Element.hide('menubox');
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
