(function($)
{
   if($.fn.defVal){ return; } // for use with extensible plugin architecture
   $.fn.defVal = function(val)
   {
      function replaceSpace(val)
      {
         return val.replace(/\s/gi, '')
      }
      return this.each(function()
      {
         this.defVal = val;
         $(this).blur(function()
         {
            var currVal = this.value;
            if(replaceSpace(currVal) == '' || currVal == this.defVal)
            {
               $(this).addClass('defVal').val(this.defVal);
            }
         }).focus(function()
         {
            var currVal = this.value;
            if(currVal == this.defVal)
            {
               $(this).removeClass('defVal').val('');
            }
         });
         var currVal = this.value;
         if(replaceSpace(currVal) == '' || currVal == this.defVal) { $(this).addClass('defVal').val( this.defVal ); }
      });
   }
})(jQuery)
