(function ($) {

$(function() {
  
  $(':text[title]')
    .on('focusin', function () {
      var $this = $(this).removeClass('placeholder');
      if ($this.val() == $this.attr('title'))
      {
        $this.val('');
      }
    })
    .on('focusout', function () {
      var $this = $(this);
      if (!$this.val().length)
      {
        $this
          .addClass('placeholder')
          .val($this.attr('title'));
      }
    });
  
  $('form')
    .on('submit', function () {
      $(this).find(':text[title]').each(function () {
        var $this = $(this);
        if ($this.val() == $this.attr('title')) {
          $this.val('');
        }
      });
    });
  
  $(':text[title]').trigger('focusout');
  
});

})(jQuery);

