/*
 * Custom jQuery functions for the site.
 */

// Reverses the order of the elements defined by selector.
// Handy to list posts in chronological rather than reverse-
// chronological order.
$.fn.reverseArray = function(selector) {
  $(this).html($.makeArray($(selector)).reverse());
};

// Nice fade-in effect for hover on images.
$.fn.emphasise = function() {
  var oldOpacity;
  $(this).mouseover(function() {
    oldOpacity = $(this).css('opacity');
    $(this).stop().animate({'opacity': 1}, 250);
  }).mouseout(function() {
    $(this).stop().animate({'opacity': oldOpacity}, 250);
  });
};


