$(document).ready(function() {
  hideFlash('#error');
  hideFlash('#notice');
  
  $("input#email").focus(function () {
       $(this).val('');
  });
  
  $("a.premium_project").hover(
    function () {
      $(this).html("But you can join today for <em>free</em>!");
    }, 
    function () {
      $(this).html("This song is for members only!");
    }
  );
  
  $("a.premium_post").hover(
    function () {
      $(this).html("But you can join today for <em>free</em>!");
    }, 
    function () {
      $(this).html("This article is for members only!");
    }
  );

  
  
});

  // Wait function for hideFlash
  $.fn.wait = function(time, type) {
      time = time || 1500;
      type = type || "fx";
      return this.queue(type, function() {
          var self = this;
          setTimeout(function() {
              $(self).dequeue();
          }, time);
      });
  };

  hideFlash = function(flashID) {
    $(flashID).wait(3000).fadeOut();
  }