var kCapitalLetter = 0; 
var kSmallLetter = 1;var kDigit = 2;var kPunctuation = 3;var kAlpha = 4;
function CharacterSetChecks(type, fResult){
 this.type = type; this.fResult = fResult;}
function isctype(character, type){
 var fResult = false; switch(type){
 case kCapitalLetter:
 if((character >= 'A') && (character <= 'Z')){
 fResult = true; }
 break; case kSmallLetter:
 if ((character >= 'a') && (character <= 'z')){
 fResult = true; }
 break; case kDigit:
 if ((character >= '0') && (character <= '9')){
 fResult = true; }
 break; case kPunctuation:
 if ("!@#$%^&*()_+-='\";:[{]}\|.>,</?`~".indexOf(character) >= 0){
 fResult = true; }
 break; case kAlpha:
 if (isctype(character, kCapitalLetter) || isctype(character, kSmallLetter)){
 fResult = true; }
 break; default:
 break; }

 return fResult;}

function isLongEnough(strWord, nAtLeastThisLong){
 if ((strWord == null) || isNaN(nAtLeastThisLong)){
 return false; }
 else if (strWord.length < nAtLeastThisLong){
 return false; }

 return true;}
function spansEnoughCharacterSets(strWord, nAtLeastThisMany){
 var nCharSets = 0; var characterSetChecks = new Array(
 new CharacterSetChecks(kCapitalLetter, false),
 new CharacterSetChecks(kSmallLetter, false),
 new CharacterSetChecks(kDigit, false),
 new CharacterSetChecks(kPunctuation, false)
 ); if ((strWord == null) || isNaN(nAtLeastThisMany)){
 return false; }

 for(var index = 0; index < strWord.length; index++){
 for(var nCharSet = 0; nCharSet < characterSetChecks.length;nCharSet++){
 if (!characterSetChecks[nCharSet].fResult && isctype(strWord.charAt(index), characterSetChecks[nCharSet].type)){
 characterSetChecks[nCharSet].fResult = true; break; }
 }
 }
 for(var nCharSet = 0; nCharSet < characterSetChecks.length;nCharSet++){
 if (characterSetChecks[nCharSet].fResult){
 nCharSets++; }
 }

 if (nCharSets < nAtLeastThisMany){
 return false; }

 return true;}

function clientSideStrongPassword( password){
 return isLongEnough(password, "6") && spansEnoughCharacterSets(password, "3");}

function clientSideMediumPassword( password){
 return isLongEnough(password, "6") && spansEnoughCharacterSets(password, "2");}

function clientSideWeakPassword( password){
 return isLongEnough(password, "4") || (!(isLongEnough(password, "0")));}/* [2009-03-17 16:13:55] 0.000303030014038 */