$(document).ready(function () {

  // find the elements to be eased and hook the hover event
  $('div.jimgMenu ul li a').hover(function() {
    
    // if the element is currently being animated (to a easeOut)...
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "690px"}, {duration: 2450, easing:"easeOutQuad"});
      if(!$(this).hasClass('banner_active_selector')) unsetActive();
    } else {
      // ease in quickly
      $(this).stop().animate({width: "690px"}, {duration: 2400, easing:"easeOutQuad"});
      if(!$(this).hasClass('banner_active_selector')) unsetActive();
    }
  }, function () {
    // on hovering out, ease the element out
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "44px"}, {duration: 2400, easing:"easeInOutQuad"})
    } else {
      // ease out slowly
      $(this).stop('animated:').animate({width: "44px"}, {duration: 2450, easing:"easeInOutQuad"});
    }
  });
  
  $('#menuOuter').mouseout(function() {
    setActive();
  });
});


//nastavi velikost aktivniho menu
function setActive()
{
  $(".banner_active_selector").stop('animated:').animate({width: "690px"}, {duration: 2450, easing:"easeInOutQuad"});//
}
function unsetActive()
{
  $(".banner_active_selector").removeClass('banner_active_item');
  $(".banner_active_selector").stop('animated:').animate({width: "44px"}, {duration: 2450, easing:"easeInOutQuad"});
}
