function testPassword(passwd){var intScore=0;var strVerdict="слабый";if(passwd.length<5){intScore=(intScore+3);}else if(passwd.length>4&&passwd.length<8){intScore=(intScore+6);}else if(passwd.length>7&&passwd.length<16){intScore=(intScore+12);}else if(passwd.length>15){intScore=(intScore+18);}if(passwd.match(/[a-z]/)){intScore=(intScore+1);}if(passwd.match(/[A-Z]/)){intScore=(intScore+5);}if(passwd.match(/\d+/)){intScore=(intScore+5);}if(passwd.match(/(.*[0-9].*[0-9].*[0-9])/)){intScore=(intScore+5);}if(passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)){intScore=(intScore+5);}if(passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)){intScore=(intScore+5);}if(passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)){intScore=(intScore+2);}if(passwd.match(/([a-zA-Z])/)&&passwd.match(/([0-9])/)){intScore=(intScore+2);}if(passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)){intScore=(intScore+2);}if(intScore<13){strVerdict="очень слабый";}else if(intScore>12&&intScore<22){strVerdict="слабый";}else if(intScore>21&&intScore<32){strVerdict="так себе";}else if(intScore>31&&intScore<42){strVerdict="сильный";}else
{strVerdict="супер!";}return(strVerdict);}