var bCheckNumbers=true;var bCheckUpperCase=true;var bCheckLowerCase=true;var bCheckPunctuation=true;var nPasswordLifetime=365;function checkPassword(c){nCombinations=0;if(bCheckNumbers){strCheck="0123456789";if(doesContain(c,strCheck)>0){nCombinations+=strCheck.length}}if(bCheckUpperCase){strCheck="ABCDEFGHIJKLMNOPQRSTUVWXYZ";if(doesContain(c,strCheck)>0){nCombinations+=strCheck.length}}if(bCheckLowerCase){strCheck="abcdefghijklmnopqrstuvwxyz";if(doesContain(c,strCheck)>0){nCombinations+=strCheck.length}}if(bCheckPunctuation){strCheck=";:-_=+|//?^&!.@$£#*()%~<>{}[]";if(doesContain(c,strCheck)>0){nCombinations+=strCheck.length}}var b=((Math.pow(nCombinations,c.length)/500)/2)/86400;var a=b/nPasswordLifetime;return a}function runPassword(d,b){nPerc=checkPassword(d);var a=document.getElementById(b+"_bar");var c=document.getElementById(b+"_text");if(!a||!c){return}var e=Math.round(nPerc*100);if(e<(d.length*5)){e+=d.length*5}if(e>100){e=100}a.style.width=e+"%";if(e>95){strText="Sangat Aman";strColor="#3bce08"}else{if(e>75){strText="Aman";strColor="orange"}else{if(e>50){strText="Lumayan Aman";strColor="#ffd801"}else{strColor="red";strText="Tidak Aman"}}}a.style.backgroundColor=strColor;c.innerHTML="<span style='color: "+strColor+";'>"+strText+"</span>"}function doesContain(b,a){nCount=0;for(i=0;i<b.length;i++){if(a.indexOf(b.charAt(i))>-1){nCount++}}return nCount};