<body>
<script language="javascript">
function checkPower(obj){
var color;
var pwd=obj.value;
if(pwd=="") return;
var strongvalue=0;
var tmpchar="",hasUpperCase=false,hasLowerCase=false,hasOther=false,hasNumber=false;
var regU=/[A-Z]/;
var regL=/[a-z]/;
var regN=/[0-9]/;
var regO=/[~!@#$%^&*()_+|<>?:"';,./`/[/]]/
hasUpperCase=regU.test(pwd);
hasLowerCase =regL.test(pwd);
hasNumber =regN.test(pwd);
hasOther =regO.test(pwd);
strongvalue = 0 + ( hasNumber ? 1:0 ) + ( hasUpperCase ? 1:0 ) + ( hasLowerCase ? 1:0 ) + ( hasOther ? 1:0) + ( pwd.length>6 ? 1:0) + ( pwd.length>15 ? 1:0);
if(strongvalue<2) color="#ff0000";
if(strongvalue>=2) color="#ffff00";
if(strongvalue>=3) color="#0000ff";
if(strongvalue>=4) color="#336600";
if(strongvalue>=5) color="#00CC00";
if(strongvalue>=6) color="#00ff00";
chkstatu.style.width = 5+strongvalue * 30 +"px";
chkstatu.style.backgroundColor = color;
t.innerText=strongvalue;
}
</script>
<form name=f1>
<input type=password οnfοcus="Javascript:chkpwd=setInterval('checkPower(this)',500)" οnblur="JavaScript:clearInterval(chkpwd)" name="Pwd">
<div id="chkstatu" style="border:1px;color:red;width:100px;background-color:#009900"></div>
<div id=t></div>
</form>
<div style="background-color:#ff0000; width:100px;"></div>
<div style="background-color:#ffff00; width:100px;"></div>
<div style="background-color:#0000ff; width:100px;"></div>
<div style="background-color:#336600; width:100px;"></div>
<div style="background-color:#00CC00; width:100px;"></div>
<div style="background-color:#00ff00; width:100px;"></div>
</body>
<script language="javascript">
function checkPower(obj){
var color;
var pwd=obj.value;
if(pwd=="") return;
var strongvalue=0;
var tmpchar="",hasUpperCase=false,hasLowerCase=false,hasOther=false,hasNumber=false;
var regU=/[A-Z]/;
var regL=/[a-z]/;
var regN=/[0-9]/;
var regO=/[~!@#$%^&*()_+|<>?:"';,./`/[/]]/
hasUpperCase=regU.test(pwd);
hasLowerCase =regL.test(pwd);
hasNumber =regN.test(pwd);
hasOther =regO.test(pwd);
strongvalue = 0 + ( hasNumber ? 1:0 ) + ( hasUpperCase ? 1:0 ) + ( hasLowerCase ? 1:0 ) + ( hasOther ? 1:0) + ( pwd.length>6 ? 1:0) + ( pwd.length>15 ? 1:0);
if(strongvalue<2) color="#ff0000";
if(strongvalue>=2) color="#ffff00";
if(strongvalue>=3) color="#0000ff";
if(strongvalue>=4) color="#336600";
if(strongvalue>=5) color="#00CC00";
if(strongvalue>=6) color="#00ff00";
chkstatu.style.width = 5+strongvalue * 30 +"px";
chkstatu.style.backgroundColor = color;
t.innerText=strongvalue;
}
</script>
<form name=f1>
<input type=password οnfοcus="Javascript:chkpwd=setInterval('checkPower(this)',500)" οnblur="JavaScript:clearInterval(chkpwd)" name="Pwd">
<div id="chkstatu" style="border:1px;color:red;width:100px;background-color:#009900"></div>
<div id=t></div>
</form>
<div style="background-color:#ff0000; width:100px;"></div>
<div style="background-color:#ffff00; width:100px;"></div>
<div style="background-color:#0000ff; width:100px;"></div>
<div style="background-color:#336600; width:100px;"></div>
<div style="background-color:#00CC00; width:100px;"></div>
<div style="background-color:#00ff00; width:100px;"></div>
</body>