(function(a){a.fn.pstrength=function(b){var b=a.extend({verdects:["very weak","weak","medium","strong","stronger"],scores:[16,25,35,45]},b);return this.each(function(){var c=a(this).attr("id");a(this).after('<div id="'+c+'_text"></div>');a(this).after('<div id="'+c+'_bar" style="border: 1px solid white; font-size: 1px; height:2px; width: 0px;"></div>');a("#p1_bar").hide();a("#new_p1_bar").hide();a(this).keyup(function(){a("#p1_bar").show();a("#new_p1_bar").show();a.fn.runPassword(a(this).val(),c,b)})})};a.fn.runPassword=function(e,d,g){nPerc=a.fn.checkPassword(e,g);var b="#"+d+"_bar";var c="#"+d+"_text";var h=Math.round(nPerc*2.2);if(h<(e.length*5)){h+=e.length*5}if(h>100){h=100}a(b).css({width:h+"px"});if(nPerc<=g.scores[0]){strColor="red";strText=g.verdects[0]}else{if(nPerc>g.scores[0]&&nPerc<=g.scores[1]){strColor="#ffd801";strText=g.verdects[1]}else{if(nPerc>g.scores[1]&&nPerc<=g.scores[2]){strColor="#ffd801";strText=g.verdects[2]}else{if(nPerc>g.scores[2]&&nPerc<=g.scores[3]){strColor="orange";strText=g.verdects[3]}else{strColor="#3bce08";strText=g.verdects[4]}}}}a(b).css({backgroundColor:strColor});a(c).html("<span style='color: "+strColor+";'>"+strText+"</span>")};a.fn.checkPassword=function(d,e){var c=0;var b=e.verdects[0];if(d.length<5){c=(c+3)}else{if(d.length>4&&d.length<8){c=(c+6)}else{if(d.length>7&&d.length<16){c=(c+12)}else{if(d.length>15){c=(c+18)}}}}if(d.match(/[a-z]/)){c=(c+1)}if(d.match(/[A-Z]/)){c=(c+5)}if(d.match(/\d+/)){c=(c+5)}if(d.match(/(.*[0-9].*[0-9].*[0-9])/)){c=(c+5)}if(d.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)){c=(c+5)}if(d.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){c=(c+5)}if(d.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){c=(c+2)}if(d.match(/([a-zA-Z])/)&&d.match(/([0-9])/)){c=(c+2)}if(d.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)){c=(c+2)}return c}})(jQuery);