$(function()
{
  $.easy.navigation();
  
  $(".fancybox").fancybox(
  {
    'zoomSpeedIn' : 300,
    'zoomSpeedOut': 300,
    'overlayShow' : true
  }); 
  
  $('#banner').cycle
  ({
    fx:       'fade',
    speed:    2000,
    timeout:  6000
  });
  
  /*
  
  $('ul.galleria').galleria(
    {
      history   : false,                          // deactivates the history object for bookmarking, back-button etc.
      clickNext : false,                          // helper for making the image clickable. Let's not have that in this example.
      insert    : '#main_img',                    // the containing selector for our main image. 
                                                  // If not found or undefined (like here), galleria will create a container 
                                                  // before the ul with the class .galleria_container (see CSS)
      onImage   : function(image, caption, thumb) // shows the nav when the image is showing
                  {
                    $('#first').css('display', 'none');
                    var li = thumb.parent();
                    
                    $('#info_title').text($(li).find('.title').text());
                    $('#info_description').text($(li).find('.description').text());
                    
                    $('.replaced').wrap('<a href="' + $(li).find('img').attr('rel') + '" class="fancybox"></a>');
                    
                    $('.nav').css('display','block');
                  }
  });
  
  */
  
  zIndexWorkaround();
  
  function isIE()
  {
      if(navigator.userAgent.match(/MSIE \d\.\d+/))
          return true;
      return false;
  }
  
  function zIndexWorkaround()
  {
      // If the browser is IE,
      if(isIE())
      {
          /*
          ** For each div with class menu (i.e.,
          ** the thing we want to be on top),
          */
          $("#nav > *").each(function()
          {
            var p = $(this);
            var pos = p.css("position");
  
            // If it's positioned,
            if(pos == "relative" || pos == "absolute" || pos == "fixed")
            {
              /*
              ** Add the "on-top" class name when the
              ** mouse is hovering over it, and remove
              ** it when the mouse leaves.
              */
              p.hover(
                function()
                {
                  $(this).addClass("on-top");
                },
                function()
                {
                  $(this).removeClass("on-top");
                });
            }
          });
      }
  }

});