/* !Obsidian Proteus Navigation */

$(function(){

/* !Fade Effects */

// modelled after Dragon Interactive's aesthetic (dragoninteractive.com), and the script is based off of Remy Sharp's version (jqueryfordesigners.com)

// IE6 doesn't handle the fade effect very well - so we'll stick with
// the default non JavaScript version if that is the user's browser.
if ($.browser.msie && $.browser.version < 7) return;

$('nav.obsidian-navigation li')

// remove the 'highlight' class from the li therefore stripping 
// the :hover rule
.removeClass('highlight')

// create our new span.hover and loop through anchor:
.append('<span class="hover" />').each(function () {
  
  // cache a copy of the span, at the same time changing the opacity
  // to zero in preparation of the page being loaded
  var $span = $('> span.hover', this).css('opacity', 0);
  
  // when the user hovers in and out of the anchor
  $(this).hover(function () {
    // on hover
    
    // stop any animations currently running, and fade to opacity: 1
    $span.stop().fadeTo(500, 1);
  }, function () {
    // off hover
    
    // again, stop any animations currently running, and fade out
    $span.stop().fadeTo(500, 0);
  });
});

});

$(function () {
  // IE6 doesn't handle the fade effect very well - so we'll stick with
  // the default non JavaScript version if that is the user's browser.
  if ($.browser.msie && $.browser.version < 7) return;
    
    $('nav.button a') // used for nav image buttons
    .removeClass('highlight')
    .append('<span class="hover" />').each(function () {
      // cache a copy of the span, at the same time changing the opacity
      // to zero in preparation of the page being loaded
      var $span = $('> span.hover', this).css('opacity', 0);
      $(this).hover(function () {
        $span.stop().fadeTo(500, 1);
      }, function () {
        $span.stop().fadeTo(500, 0);
      });
    });
    
});
