﻿
function checkstr(str)
{

if(str>=48&&str<=57)//数字
{
return 1;
}
else if(str>=65&&str<=90)//大写字母
{
return 2;
}
else if(str>=97&&str<=122)//小写字母
{
return 3;
}

}
function checkl(string)
{
n=false;
s=false;
t=false;
l_num=0;
if(string.length<7)
{
l_num=1;
}
else 
{
for(i=0;i<string.length;i++)
{
   asc=checkstr(string.charCodeAt(i));
   if(asc==1&&n==false){l_num+=1;n=true;}
   if(asc==2&&s==false){l_num+=1;s=true;}
   if(asc==3&&t==false){l_num+=1;t=true;}
}
}
return l_num;
}

function checklevel(psw)
{

if(psw==null||psw=='')
{
document.getElementById("passposn").src="/images/M1.gif";
}
else
{
thelev=checkl(psw)
switch(thelev)
{
   case 1:
  document.getElementById("passposn").src="/images/M2.gif";
   break;
   case 2:
  document.getElementById("passposn").src="/images/M3.gif";
   break;
   case 3:
  document.getElementById("passposn").src="/images/M4.gif";
   break;
   default:
       document.getElementById("passposn").src = "/images/M1.gif";
}
}

}

