!function(){var moduleFactory=function($){var module=this,jQuery=$,exports=function(){!function(window,document,$){function args(elem){var newAttrs={},rinlinejQuery=/^jQuery\d+$/;return $.each(elem.attributes,function(i,attr){attr.specified&&!rinlinejQuery.test(attr.name)&&(newAttrs[attr.name]=attr.value)}),newAttrs}function clearPlaceholder(event,value){var input=this,$input=$(input);if(input.value==$input.attr("placeholder")&&$input.hasClass("placeholder"))if($input.data("placeholder-password")){if($input=$input.hide().next().show().attr("id",$input.removeAttr("id").data("placeholder-id")),event===!0)return $input[0].value=value;
$input.focus()}else input.value="",$input.removeClass("placeholder"),input==document.activeElement&&input.select()}function setPlaceholder(){var $replacement,input=this,$input=$(input),id=this.id;if(""==input.value){if("password"==input.type){if(!$input.data("placeholder-textinput")){try{$replacement=$input.clone().attr({type:"text"})}catch(e){$replacement=$("<input>").attr($.extend(args(this),{type:"text"}))}$replacement.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":id}).bind("focus.placeholder",clearPlaceholder),$input.data({"placeholder-textinput":$replacement,"placeholder-id":id}).before($replacement)
}$input=$input.removeAttr("id").hide().prev().attr("id",id).show()}$input.addClass("placeholder"),$input[0].value=$input.attr("placeholder")}else $input.removeClass("placeholder")}var hooks,placeholder,isInputSupported="placeholder"in document.createElement("input"),isTextareaSupported="placeholder"in document.createElement("textarea"),prototype=$.fn,valHooks=$.valHooks;isInputSupported&&isTextareaSupported?(placeholder=prototype.placeholder=function(){return this},placeholder.input=placeholder.textarea=!0):(placeholder=prototype.placeholder=function(){var $this=this;
return $this.filter((isInputSupported?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":clearPlaceholder,"blur.placeholder":setPlaceholder}).data("placeholder-enabled",!0).trigger("blur.placeholder"),$this},placeholder.input=isInputSupported,placeholder.textarea=isTextareaSupported,hooks={get:function(element){var $element=$(element);return $element.data("placeholder-enabled")&&$element.hasClass("placeholder")?"":element.value},set:function(element,value){var $element=$(element);
return $element.data("placeholder-enabled")?(""==value?(element.value=value,element!=document.activeElement&&setPlaceholder.call(element)):$element.hasClass("placeholder")?clearPlaceholder.call(element,!0,value)||(element.value=value):element.value=value,$element):element.value=value}},isInputSupported||(valHooks.input=hooks),isTextareaSupported||(valHooks.textarea=hooks),$(function(){$(document).delegate("form","submit.placeholder",function(){var $inputs=$(".placeholder",this).each(clearPlaceholder);setTimeout(function(){$inputs.each(setPlaceholder)
},10)})}),$(window).bind("beforeunload.placeholder",function(){$(".placeholder").each(function(){this.value=""})}))}(window,document,jQuery)};exports(),module.resolveWith(exports)};dispatch("placeholder").containing(moduleFactory).to("Foundry/2.1 Modules")}();