jQuery.fn.navigation = function(options) {
  settings = jQuery.extend({
    colourize: true
  }, options)
  this.hover(
    function(){
      $(this).addClass("active");
      if (settings.colourize == true) {
        colourize($(this).attr('id'));
      }
    },
    function(){
      if (settings.colourize == true) {
        decolourize($(this).attr('id'));
      }
      $(this).removeClass("active");
    });
  if (settings.colourize == true) {
  $("#articles li.article").find("div").each(function(i){
      $(this).hover(
        function(){
          $(this).find("a img.colour").animate({ opacity: 1.0 }, 100);
        },
        function(){
          $(this).find("a img.colour").animate({ opacity: 0.0 }, 100);
       });
    });
  }
}


function colourize(klass){
  $("div." + klass).each(function(){
    $(this).find("a img.colour").animate({ opacity: 1.0 }, 100);
  })
}
function decolourize(klass){
  $("div." + klass).each(function(){
    $(this).find("a img.colour").animate({ opacity: 0.0 }, 100);
  })
}