function set_equal_height(small, big, consts)
{
  $(small).style.height = '';
  var hsmall = $(small).offsetHeight;
  
  var hconst = 0;
  if (!Object.isUndefined(consts) && Object.isArray(consts))
  {
    for (var i = 0; i < consts.length; i++)
    {
      if (Object.isNumber(consts[i]))
      {
        hconst = hconst + consts[i];
      }
      else if (Object.isElement($(consts[i])))
      {
        hconst = hconst + $(consts[i]).offsetHeight;
      }
	}
  }

  var hbig = $(big).offsetHeight;
  if (hbig > hsmall + hconst) 
  {
    $(small).style.height = (hbig - hconst) + 'px';
  } 
}
function layout_fix_left_height()
{
  set_equal_height('l_m_left_stretch', 'l_middle', ['l_m_left']);
}
function addLoadEvent(func) 
{
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
function openPopup(url, x, y, frame)
{
  var pop = window.open(url, frame, 'left=150,top=100,width=' + x + ',height=' + y + ',innerheight=' + y + ',innerwidth=' + x + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
  pop.focus();
  
  return pop;
}
//var top_menu = new Hash();
function topMenuOver(cat)
{
    $('top_menu2_' + cat).show();

/*	
  if (top_menu.get(cat) == undefined)
  {
	  top_menu.set(cat, 0);
  }
  if (!top_menu.get(cat))
  {
    $('top_menu2_' + cat).show();
  }
  top_menu.set(cat, top_menu.get(cat) + 1);
*/
}
function topMenuOut(cat)
{
    $('top_menu2_' + cat).hide();
/*
  top_menu.set(cat, top_menu.get(cat) - 1);
  if (!top_menu.get(cat))
  {
    $('top_menu2_' + cat).hide();
  }
*/
}

