(function(a){a.fn.jpassword=function(h){var g=this;var h=a.extend({},a.fn.jpassword.defaults,h);var f='<div class="jpassword"><div><p class="jpassword-meter">&nbsp;</p><p class="jpassword-info">&nbsp;</p></div></div>';return g.each(function(){if(a(g).is("input")){i(a(g))}});function i(t){var s="jpassword_"+parseInt(Math.random()*1000);var r=a(f).attr("id",s);if(h.flat==false){var q=t.offset();var p=d();var o="right";var n=q.top;var l=(q.left+t.width());r.appendTo(document.body);if((l+r.width())>(p.left+p.width)){l-=(r.width()+t.width());o="left"}if((n+r.height())>(p.top+p.height)){n-=(r.height()-(t.height()*1.5));o+="bottom"}else{o+="top"}r.css({left:l+"px",top:n+"px",display:"none"});r.addClass("jpassword-"+o)}else{r.insertAfter(t);r.css({position:"relative",display:"block"});r.addClass("jpassword-flat")}t.bind("keyup",function(u){e(t,r)});t.bind("focus",function(u){e(t,r);if(h.flat==false){m(r,"show")}if(a.isFunction(h.onShow)){h.onShow(t,r)}});t.bind("blur",function(u){if(h.flat==false){m(r,"hide")}if(a.isFunction(h.onHide)){h.onHide(t,r)}});var k=a("#"+h.generate);if(k){k.bind("click",function(u){t.val(b());e(t,r);return false})}if(a.isFunction(h.onComplete)){h.onComplete(t,r)}}function e(l,k){var r=l.val();var q=k.find(".jpassword-meter");var p=k.find(".jpassword-info");var o=j(r);var n="";if(o.lowercase<2){n=h.lang.lowercase}else{if(o.uppercase<2){n=h.lang.uppercase}else{if(o.number<2){n=h.lang.number}else{if(o.punctuation<2){n=h.lang.punctuation}else{if(o.special<2){n=h.lang.special}}}}}if(r.length<h.length&&o.level<10&&n==""){n=h.lang.length.replace(/-X-/g,h.length)}if(o.val==""){q.css("background-position","0 0");p.html(h.lang.please)}else{if(o.level<5){q.css("background-position","0 -10px");p.html(h.lang.low+" "+n)}else{if(o.level<10){q.css("background-position","0 -20px");p.html(h.lang.correct+" "+n)}else{q.css("background-position","0 -30px");p.html(h.lang.high)}}}l.val(o.val);if(a.isFunction(h.onKeyup)){h.onKeyup(l)}}function j(l){l=l.replace(/(^\s+)|(\s+$)/g,"");var k=cCap=cMin=cPct=cSpe=1;var p=l.length;for(var q=0;q<p;q++){var o=l.charCodeAt(q);if(o<128){if(o>47&&o<58){k+=1}else{if(o>64&&o<91){cCap+=1}else{if(o>96&&o<123){cMin+=1}else{cPct+=2}}}}else{cSpe+=3}}var n=(k*cCap*cMin*cPct*cSpe);n=Math.round(Math.log((n*n)));return{val:l,level:n,number:k,uppercase:cCap,lowercase:cMin,punctuation:cPct,special:cSpe}}function b(){var l="";for(c=0;c<h.length;c++){var k=Math.round(32+Math.random()*222);var n=0;if((k>47&&k<58)||(k>64&&k<91)||(k>96&&k<123)){n=1}if(h.type==1&&k<127){n=1}if(h.type==2){n=1}if(h.special&&(k==48||k==49||k==50||k==53||k==54||k==56||k==57||k==66||k==67||k==68||k==71||k==73||k==75||k==79||k==80||k==81||k==83||k==85||k==86||k==87||k==88||k==90||k==99||k==104||k==105||k==107||k==108||k==111||k==112||k==113||k==115||k==117||k==118||k==119||k==120||k==122)){n=0}if(n==1){l+=String.fromCharCode(k)}else{c--}}return l}function m(l,k){if(k=="show"){l.fadeIn()}else{l.fadeOut()}}function d(){var k=document.compatMode=="CSS1Compat";return{left:(window.pageXOffset||(k?document.documentElement.scrollLeft:document.body.scrollLeft)),top:(window.pageYOffset||(k?document.documentElement.scrollTop:document.body.scrollTop)),width:(window.innerWidth||(k?document.documentElement.clientWidth:document.body.clientWidth)),height:(window.innerHeight||(k?document.documentElement.clientHeight:document.body.clientHeight))}}};a.fn.jpassword.defaults={lang:{please:"A strong password...",low:"Low security.",correct:"Correct security.",high:"High security.",length:"-X- characters would be a plus.",number:"Why not numbers?",uppercase:"And caps?",lowercase:"Some tiny?",punctuation:"Punctuations?",special:"Best, special characters?"},length:8,flat:false,type:1,special:0,generate:null,onShow:function(){},onHide:function(){},onKeyup:function(){},onComplete:function(){}}})(jQuery);PrimeFaces.widget.Password=function(a){this.cfg=a;this.id=this.cfg.id;this.jqId=PrimeFaces.escapeClientId(this.id);this.jq=$(this.jqId+"_input");if(this.cfg.feedback){this.cfg.lang={length:"",number:"",uppercase:"",lowercase:"",punctuation:"",special:""};if(this.cfg.promptLabel){this.cfg.lang.please=this.cfg.promptLabel}if(this.cfg.weakLabel){this.cfg.lang.low=this.cfg.weakLabel}if(this.cfg.goodLabel){this.cfg.lang.correct=this.cfg.goodLabel}if(this.cfg.strongLabel){this.cfg.lang.high=this.cfg.strongLabel}if(this.cfg.flat){if(!this.cfg.onShow){this.cfg.onShow=function(d,b){b.slideDown()}}if(!this.cfg.onHide){this.cfg.onHide=function(d,b){b.slideUp()}}this.cfg.onComplete=function(d,b){b.hide()}}this.jq.jpassword(this.cfg)}if(this.cfg.behaviors){PrimeFaces.attachBehaviors(this.jq,this.cfg.behaviors)}if(this.cfg.theme!=false){PrimeFaces.skinInput(this.jq)}this.postConstruct()};PrimeFaces.extend(PrimeFaces.widget.Password,PrimeFaces.widget.BaseWidget);