/* 
 * EnablePlaceholder jQuery plugin.
 * https://github.com/marioizquierdo/enablePlaceholder
 * version 1.0.2 (May 11 2011)
 * 
 * Copyright (c) 2011 Mario Izquierdo
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 */
(function(b){b.support.placeholder=("placeholder" in document.createElement("input"));b.EnablePlaceholder={defaults:{withPlaceholderClass:"placeholder"}};b.fn.enablePlaceholder=function(d){return c(this,d,function(e,f){if(a(e)){e.showPlaceholder(f);e.bind("focus keydown paste",function(){e.clearPlaceholder(f)});e.bind("blur",function(){e.showPlaceholder(f)});e.parents("form").first().submit(function(){e.clearPlaceholder(f);return true});b(window).unload(function(){e.clearPlaceholder(f);return true})}})};b.fn.showPlaceholder=function(d){return c(this,d,function(e,f){if(e.val()===""){e.val(e.attr("placeholder")).addClass(f.withPlaceholderClass).data("hasPlaceholder",true)}})};b.fn.clearPlaceholder=function(d){return c(this,d,function(e,f){if(e.data("hasPlaceholder")){e.val("").removeClass(f.withPlaceholderClass).data("hasPlaceholder",false)}})};b.fn.updatePlaceholder=function(e,d){return c(this,d,function(f,g){f.clearPlaceholder(g).attr("placeholder",e).showPlaceholder(g)})};var c=function(g,e,d){if(!b.support.placeholder){var f=b.extend({},b.EnablePlaceholder.defaults,e);return g.each(function(){var h=b(this);d(h,f)})}};var a=function(d){return(d.attr("placeholder")&&d.attr("placeholder")!=="")}})(jQuery);
