/*
 * jQuery Example Plugin 1.2.1
 * Populate form inputs with example text that disappears on focus.
 *
 * e.g.
 *  $('input#name').example('Bob Smith');
 *  $('textarea#message').example('Type your message here', {
 *    class_name: 'example_text',
 *    hide_label: true
 *  });
 *
 * Copyright (c) Paul Mucur (http://mucur.name), 2007-2008.
 * Dual-licensed under the BSD and GPL Licenses (LICENSE.txt).
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
(function(A){A.fn.example=function(E,D){var C=A.extend({},A.fn.example.defaults,D);var B=A.fn.example.bound_class_names;if(A.inArray(C.class_name,B)==-1){A(window).unload(function(){A("."+C.class_name).val("");});A(this).parents("form:first").submit(function(){A("."+C.class_name).val("");});B.push(C.class_name);A.fn.example.bound_class_names=B;}return this.each(function(){var G=A(this);if(G.val()==""){G.addClass(C.class_name);G.val(E);}if(C.hide_label){var F=A("label[@for="+G.attr("id")+"]");F.next("br").hide();F.hide();}G.focus(function(){if(A(this).is("."+C.class_name)){A(this).val("");A(this).removeClass(C.class_name);}});G.blur(function(){if(A(this).val()==""){A(this).addClass(C.class_name);A(this).val(E);}});});};A.fn.example.defaults={class_name:"example",hide_label:false};A.fn.example.bound_class_names=[];})(jQuery);
