var openMenu = function() {
  if (lang == false) {
    lang = 'de';
  }
  var item = '#'+$(this).children().attr('id');
  var id   = $(this).children().attr('id');
  $('body').append("<div id=\"jAjax\" style=\"display:none;\"></div>");
  var getParams = { id: '28', l: lang }
  $('#jAjax').load('/' + lang + '/menu.xml', getParams, function() {
    if (content = $('#load'+id).next().html()) {
      $(item).parent().append('<ul id="jAjaxMenu" style="display:none;">' + content + '</ul>');
      $('#jAjaxMenu').slideDown(200);
    }
  });
}

var closeMenu = function() {
  $('#jAjaxMenu').slideUp(200, function() {
    $(this).remove();
  });
  $(this).children().removeClass('act');
    
} 

$(function() {
  var config = {    
    sensitivity: 3,    
    interval: 250,    
    over: openMenu,
    out: closeMenu,
    timeout: 50
  };
  $('#mainMenu li.sub').hoverIntent(config);
  /* 
  $('a[rel*="lightbox"]').lightBox();
  $('div.lbg a[rel*="lightbox"]').hover(
    function() {
      var c = $(this).children();
      var o = c.offset();
      c.css('z-index', 100);
      c.animate({
        'top': '-=7px',
        'left': '-=10px',
        'width': '+=20px'
      }, 200);
      c.addClass("selected");
    },
    function() {
      var c = $(this).children();
      c.removeClass("selected");
      c.css('z-index', 1);
      c.animate({
        'top': '+=7px',
        'left': '+=10px',
        'width': '-=20px'
      }, 200);
    }
  );
  */

});
