function testPassword(passwd,scoreDiv)
{var intScore=0
var strVerdict="weak"
var strLog=""
if(passwd.length<8)
{intScore=(intScore+3)
strLog=strLog+"3 points for length ("+passwd.length+")\n"}
else if(passwd.length>4&&passwd.length<8)
{intScore=(intScore+6)
strLog=strLog+"6 points for length ("+passwd.length+")\n"}
else if(passwd.length>7&&passwd.length<16)
{intScore=(intScore+12)
strLog=strLog+"12 points for length ("+passwd.length+")\n"}
else if(passwd.length>15)
{intScore=(intScore+18)
strLog=strLog+"18 point for length ("+passwd.length+")\n"}
if(passwd.match(/[a-z]/))
{intScore=(intScore+1)
strLog=strLog+"1 point for at least one lower case char\n"}
if(passwd.match(/[A-Z]/))
{intScore=(intScore+5)
strLog=strLog+"5 points for at least one upper case char\n"}
if(passwd.match(/\d+/))
{intScore=(intScore+5)
strLog=strLog+"5 points for at least one number\n"}
if(passwd.match(/(.*[0-9].*[0-9].*[0-9])/))
{intScore=(intScore+5)
strLog=strLog+"5 points for at least three numbers\n"}
if(passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/))
{intScore=(intScore+5)
strLog=strLog+"5 points for at least one special char\n"}
if(passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))
{intScore=(intScore+5)
strLog=strLog+"5 points for at least two special chars\n"}
if(passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))
{intScore=(intScore+2)
strLog=strLog+"2 combo points for upper and lower letters\n"}
if(passwd.match(/([a-zA-Z])/)&&passwd.match(/([0-9])/))
{intScore=(intScore+2)
strLog=strLog+"2 combo points for letters and numbers\n"}
if(passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
{intScore=(intScore+2)
strLog=strLog+"2 combo points for letters, numbers and special chars\n"}
if(intScore<9)
{strVerdict="faible";}
if(intScore>10&&intScore<25)
{strVerdict="normal";}
else if(intScore>24&&intScore<35)
{strVerdict="fort";}
else if(intScore>34&&intScore<45)
{strVerdict="le plus fort";}
else
{strVerdict="faible";}}