(function(a){a.extend(a.fn,{pstrength:function(b){var b=a.extend({verdects:["Very weak","Weak","Medium","Strong","Very strong"],colors:["#f00","#c06","#f60","#3c0","#3f0"],scores:[10,15,30,40],common:["password","sex","god","123456","123","liverpool","letmein","qwerty","monkey"],minchar:6},b);return this.each(function(){var c=a(this).attr("id");a(this).after('<div class="pstrength-minchar" id="'+c+'_minchar">Minimum number of characters is '+b.minchar+"</div>");a(this).after('<div class="pstrength-info" id="'+c+'_text"></div>');a(this).after('<div class="pstrength-bar" id="'+c+'_bar" style="border: 1px solid white; font-size: 1px; height: 5px; width: 0px;"></div>');a(this).keyup(function(){a.fn.runPassword(a(this).val(),c,b)})})},runPassword:function(d,b,e){nPerc=a.fn.checkPassword(d,e);var f="#"+b+"_bar";var c="#"+b+"_text";if(nPerc==-200){strColor="#f00";strText="Unsafe password word!";a(f).css({width:"0%"})}else{if(nPerc<0&&nPerc>-199){strColor="#ccc";strText="Too short";a(f).css({width:"5%"})}else{if(nPerc<=e.scores[0]){strColor=e.colors[0];strText=e.verdects[0];a(f).css({width:"10%"})}else{if(nPerc>e.scores[0]&&nPerc<=e.scores[1]){strColor=e.colors[1];strText=e.verdects[1];a(f).css({width:"25%"})}else{if(nPerc>e.scores[1]&&nPerc<=e.scores[2]){strColor=e.colors[2];strText=e.verdects[2];a(f).css({width:"50%"})}else{if(nPerc>e.scores[2]&&nPerc<=e.scores[3]){strColor=e.colors[3];strText=e.verdects[3];a(f).css({width:"75%"})}else{strColor=e.colors[4];strText=e.verdects[4];a(f).css({width:"92%"})}}}}}}a(f).css({backgroundColor:strColor});a(c).html("<span style='color: "+strColor+";'>"+strText+"</span>")},checkPassword:function(e,f){var b=0;var c=f.verdects[0];if(e.length<f.minchar){b=(b-100)}else{if(e.length>=f.minchar&&e.length<=(f.minchar+2)){b=(b+6)}else{if(e.length>=(f.minchar+3)&&e.length<=(f.minchar+4)){b=(b+12)}else{if(e.length>=(f.minchar+5)){b=(b+18)}}}}if(e.match(/[a-z]/)){b=(b+1)}if(e.match(/[A-Z]/)){b=(b+5)}if(e.match(/\d+/)){b=(b+5)}if(e.match(/(.*[0-9].*[0-9].*[0-9])/)){b=(b+7)}if(e.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)){b=(b+5)}if(e.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){b=(b+7)}if(e.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){b=(b+2)}if(e.match(/([a-zA-Z])/)&&e.match(/([0-9])/)){b=(b+3)}if(e.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)){b=(b+3)}for(var d=0;d<f.common.length;d++){if(e.toLowerCase()==f.common[d]){b=-200}}return b}})})(jQuery);