$.fn.pause = function(duration) {
    $(this).animate({ dummy: 1 }, duration);
    return this;
};

$(function() {
  var feature_heading = $("#feature_heading").html();
  var feature_subtext = $("#feature_subtext").html();

  $(".feature").find("img").hide();
  counter = 0;
  $(".feature").find("img").each(function(){
    $(this).pause(counter).fadeIn("slow");
    counter = counter + 100;
  });
  
  $(".feature").children().each(function(){
    $(this).children("a").mouseover(function(){
      
      $("#feature_heading").html($(this).children(".result").html());
      $("#feature_subtext").html($(this).children(".caption").html());
    });
    $(this).children("a").mouseout(function(){
      $("#feature_heading").html(feature_heading);
      $("#feature_subtext").html(feature_subtext);
    });
    
  });
});
