(function(b){b.fn.example=function(f,h){var g=b.isFunction(f);var a=b.extend({},h,{example:f});return this.each(function(){var d=b(this);if(b.metadata){var c=b.extend({},b.fn.example.defaults,d.metadata(),a)}else{var c=b.extend({},b.fn.example.defaults,a)}if(!b.fn.example.boundClassNames[c.className]){b(window).unload(function(){b("."+c.className).val("")});b("form").submit(function(){b(this).find("."+c.className).val("")});b.fn.example.boundClassNames[c.className]=true}if(b.browser.msie&&!d.attr("defaultValue")&&(g||d.val()==c.example)){d.val("")}if(d.val()==""&&this!=document.activeElement){d.addClass(c.className);d.val(g?c.example.call(this):c.example)}d.focus(function(){if(b(this).is("."+c.className)){b(this).val("");b(this).removeClass(c.className)}});d.change(function(){if(b(this).is("."+c.className)){b(this).removeClass(c.className)}});d.blur(function(){if(b(this).val()==""){b(this).addClass(c.className);b(this).val(g?c.example.call(this):c.example)}})})};b.fn.example.defaults={className:"example"};b.fn.example.boundClassNames=[]})(jQuery);
