function passwordStrength(m,d,n,k,a){this.cssPath="/css/tools/password_strength_checker/password_strength_checker.css";this.htmlContainer='<div class="password-strength" style="*width:199px;"><div id="strongtext" style="margin-left: 5px;;*margin-left: -15px; position: absolute"></div><div id="strongness" class="strong-0" style="display:block; height:14px;"></div></div>';this.score=0;var b=8;var l="Nicht bewertet";var h="Zu kurz";var g="Schwache";var e="Medium";var c="Stark";var f=10;this.addhandler=function(){document.getElementsByName(m)[0].onkeyup=this.strengthCheck};this.strengthCheck=function(){this.score=0;o_tId=document.getElementById(k);o_Id=document.getElementById(d);var o=document.getElementsByName(m);s_password=o.length!=0?o[0].value:"";if(s_password.length==0||s_password.length<b){if(typeof(a)!="undefined"){document.getElementById(a).value=0}}if(s_password.length==0){o_tId.innerHTML="";return o_Id.className=n+"-0"}else{if(s_password.length<b){o_tId.innerHTML=h;return o_Id.className=n+"-1"}else{o_tId.innerHTML=""}}this.score+=s_password.length*4;this.score+=(checkRepetition(1,s_password).length-s_password.length)*1;this.score+=(checkRepetition(2,s_password).length-s_password.length)*1;this.score+=(checkRepetition(3,s_password).length-s_password.length)*1;this.score+=(checkRepetition(4,s_password).length-s_password.length)*1;if(s_password.match(/(.*[0-9].*[0-9].*[0-9])/)){this.score+=5}if(s_password.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){this.score+=5}if(s_password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){this.score+=10}if(s_password.match(/([a-zA-Z])/)&&s_password.match(/([0-9])/)){this.score+=15}if(s_password.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&s_password.match(/([0-9])/)){this.score+=15}if(s_password.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&s_password.match(/([a-zA-Z])/)){this.score+=15}if(s_password.match(/^\w+$/)||s_password.match(/^\d+$/)){this.score-=10}if(this.score<0){this.score=0}if(this.score<10){this.score=10}if(this.score>100){this.score=100}if(typeof(a)!="undefined"){document.getElementById(a).value=Math.round(this.score/f)}return o_Id.className=n+"-"+Math.round(this.score/f)};this.display=function(){document.write(this.htmlContainer)};this.setCssPath=function(){document.write('<link href="'+this.cssPath+'" rel="stylesheet" type="text/css">')}}function checkRepetition(a,b){res="";for(i=0;i<b.length;i++){repeated=true;for(j=0;j<a&&(j+i+a)<b.length;j++){repeated=repeated&&(b.charAt(j+i)==b.charAt(j+i+a))}if(j<a){repeated=false}if(repeated){i+=a-1;repeated=false}else{res+=b.charAt(i)}}return res}function passwordStrengthDisplay(b,a,c){var d=10;o_Id=document.getElementById(b);return o_Id.className=a+"-"+Math.round(c/d)};
