(function(n){"use strict";function t(n,t,i){return n.addEventListener?n.addEventListener(t,i,!1):n.attachEvent?n.attachEvent("on"+t,i):void 0}function i(n,t){for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return!0;return!1}function r(n,t){var i;n.createTextRange?(i=n.createTextRange(),i.move("character",t),i.select()):n.selectionStart&&(n.focus(),n.setSelectionRange(t,t))}function u(n,t){try{return n.type=t,!0}catch(i){return!1}}n.Placeholders={Utils:{addEventListener:t,inArray:i,moveCaret:r,changeType:u}}})(this),function(n){"use strict";function ot(){}function st(){try{return document.activeElement}catch(n){}}function w(n,t){var i,r,f=!!t&&n.value!==t,e=n.value===n.getAttribute(u);return(f||e)&&n.getAttribute(h)==="true"?(n.removeAttribute(h),n.value=n.value.replace(n.getAttribute(u),""),n.className=n.className.replace(vt,""),r=n.getAttribute(v),parseInt(r,10)>=0&&(n.setAttribute("maxLength",r),n.removeAttribute(v)),i=n.getAttribute(l),i&&(n.type=i),!0):!1}function g(n){var t,r,f=n.getAttribute(u);return n.value===""&&f?(n.setAttribute(h,"true"),n.value=f,n.className+=" "+b,r=n.getAttribute(v),r||(n.setAttribute(v,n.maxLength),n.removeAttribute("maxLength")),t=n.getAttribute(l),t?n.type="text":n.type==="password"&&i.changeType(n,"text")&&n.setAttribute(l,"password"),!0):!1}function ht(n,t){var r,s,f,o,h,l,i;if(n&&n.getAttribute(u))t(n);else for(f=n?n.getElementsByTagName("input"):e,o=n?n.getElementsByTagName("textarea"):c,r=f?f.length:0,s=o?o.length:0,i=0,l=r+s;i<l;i++)h=i<r?f[i]:o[i-r],t(h)}function ct(n){ht(n,w)}function pt(n){ht(n,g)}function wt(n){return function(){y&&n.value===n.getAttribute(u)&&n.getAttribute(h)==="true"?i.moveCaret(n,0):w(n)}}function bt(n){return function(){g(n)}}function kt(n){return function(t){return k=n.value,n.getAttribute(h)==="true"&&k===n.getAttribute(u)&&i.inArray(at,t.keyCode)?(t.preventDefault&&t.preventDefault(),!1):void 0}}function dt(n){return function(){w(n,k);n.value===""&&(n.blur(),i.moveCaret(n,0))}}function gt(n){return function(){n===st()&&n.value===n.getAttribute(u)&&n.getAttribute(h)==="true"&&i.moveCaret(n,0)}}function ni(n){return function(){ct(n)}}function lt(n){n.form&&(s=n.form,typeof s=="string"&&(s=document.getElementById(s)),s.getAttribute(tt)||(i.addEventListener(s,"submit",ni(s)),s.setAttribute(tt,"true")));i.addEventListener(n,"focus",wt(n));i.addEventListener(n,"blur",bt(n));y&&(i.addEventListener(n,"keydown",kt(n)),i.addEventListener(n,"keyup",dt(n)),i.addEventListener(n,"click",gt(n)));n.setAttribute(it,"true");n.setAttribute(u,r);(y||n!==st())&&g(n)}var nt=["text","search","url","tel","email","password","number","textarea"],at=[27,33,34,35,36,37,38,39,40,8,46],b="placeholdersjs",vt=new RegExp("(?:^|\\s)"+b+"(?!\\S)"),e,c,u="data-placeholder-value",h="data-placeholder-active",l="data-placeholder-type",tt="data-placeholder-submit",it="data-placeholder-bound",v="data-placeholder-maxlength",yt=document.createElement("input"),rt=document.getElementsByTagName("head")[0],ut=document.documentElement,o=n.Placeholders,i=o.Utils,y,ft,k,a,d,r,et,s,t,p,f;if(o.nativeSupport=yt.placeholder!==void 0,!o.nativeSupport){for(e=document.getElementsByTagName("input"),c=document.getElementsByTagName("textarea"),y=ut.getAttribute("data-placeholder-focus")==="false",ft=ut.getAttribute("data-placeholder-live")!=="false",a=document.createElement("style"),a.type="text/css",d=document.createTextNode("."+b+" { color:#ccc; }"),a.styleSheet?a.styleSheet.cssText=d.nodeValue:a.appendChild(d),rt.insertBefore(a,rt.firstChild),f=0,p=e.length+c.length;f<p;f++)t=f<e.length?e[f]:c[f-e.length],r=t.attributes.placeholder,r&&(r=r.nodeValue,r&&i.inArray(nt,t.type)&&lt(t));et=setInterval(function(){for(f=0,p=e.length+c.length;f<p;f++)t=f<e.length?e[f]:c[f-e.length],r=t.attributes.placeholder,r?(r=r.nodeValue,r&&i.inArray(nt,t.type)&&(t.getAttribute(it)||lt(t),r===t.getAttribute(u)&&(t.type!=="password"||t.getAttribute(l))||(t.type==="password"&&!t.getAttribute(l)&&i.changeType(t,"text")&&t.setAttribute(l,"password"),t.value===t.getAttribute(u)&&(t.value=r),t.setAttribute(u,r)))):t.getAttribute(h)&&(w(t),t.removeAttribute(u));ft||clearInterval(et)},100)}i.addEventListener(n,"beforeunload",function(){o.disable()});o.disable=o.nativeSupport?ot:ct;o.enable=o.nativeSupport?ot:pt}(this),function(n){"use strict";var t=n.fn.val,i=n.fn.prop;Placeholders.nativeSupport||(n.fn.val=function(n){var i=t.apply(this,arguments),r=this.eq(0).data("placeholder-value");return n===undefined&&this.eq(0).data("placeholder-active")&&i===r?"":i},n.fn.prop=function(n,t){return t===undefined&&this.eq(0).data("placeholder-active")&&n==="value"?"":i.apply(this,arguments)})}(jQuery)