
var subMenuHideTo = new Array();

$(document).ready(function()
{
  var subMenuId = 0;
  $('#header-menu > a').each(function()
  {
    if ( $(this).next().hasClass('header-menu-sub') )
    {
      subMenuId++;
      var this2 = this;
      $(this).add($(this).next()).mouseover(function()
      {
        clearTimeout(subMenuHideTo[this2]);
        //$('.header-menu-sub').hide();
        $(this2).css('background', '#BEA200');
        $(this2).next().css('left', $(this2).position().left);
        $(this2).next().attr('id','subMenuId'+subMenuId).show();
      }).mouseout(function()
      {
        var el = $(this2).next();
        subMenuHideTo[this2] = setTimeout(function()
        {
          $(this2).css('background', 'transparent');
          el.hide();
        }, 20);
      });
    }
  });
  $('#sidebar-menu > a').each(function()
  {
    if ( $(this).next().hasClass('sidebar-menu-sub') )
    {
      subMenuId++;
      var this2 = this;
      $(this).add($(this).next()).mouseover(function()
      {
        clearTimeout(subMenuHideTo[this2]);
        //$('.header-menu-sub').hide();
        $(this2).css('background', '#BEA200');
        $(this2).next().css('top', $(this2).position().top);
        $(this2).next().attr('id','subMenuId'+subMenuId).show();
      }).mouseout(function()
      {
        var el = $(this2).next();
        subMenuHideTo[this2] = setTimeout(function()
        {
          $(this2).css('background', 'transparent');
          el.hide();
        }, 20);
      });
    }
  });


  $('a[rel=lightbox]').lightbox();
  
  setTimeout(function()
  {
    $('marquee > div').css('visibility', 'visible');
  }, 100);
  
});

function popupClose()
{
  $('#popup').hide();
  document.cookie = 'hidepopup';
}


