function testPassword(passwd)
{
	    var intScore   = 0
		var strVerdict = 0		
		// PASSWORD LENGTH
		if (passwd.length < 6 || !passwd.length)                        
		{
			intScore = -1;
		}
		else if (passwd.length>0 && passwd.length<5) // length between 1 and 4
		{
			intScore = (intScore+3)
		}
		else if (passwd.length>4 && passwd.length<8) // length between 5 and 7
		{
			intScore = (intScore+6)
		}
		else if (passwd.length>7 && passwd.length<12)// length between 8 and 15
		{
			intScore = (intScore+12)
		}
		else if (passwd.length>11)                    // length 16 or more
		{
			intScore = (intScore+18)
		}
		
		if (intScore != -1) {
			
			if (passwd.match(/[a-z]/))                              // [verified] at least one lower case letter
			{
				intScore = (intScore+1)
			}
			
			if (passwd.match(/[A-Z]/))                              // [verified] at least one upper case letter
			{
				intScore = (intScore+5)
			}
			
			// NUMBERS
			if (passwd.match(/\d+/))                                 // [verified] at least one number
			{
				intScore = (intScore+5)
			}
			
			if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/))             // [verified] at least three numbers
			{
				intScore = (intScore+5)
			}
			
			
			// SPECIAL CHAR
			if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/))            // [verified] at least one special character
			{
				intScore = (intScore+5)
			}
			
																	 // [verified] at least two special characters
			if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))
			{
				intScore = (intScore+5)
			}
		
			
			// COMBOS
			if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))        // [verified] both upper and lower case
			{
				intScore = (intScore+2)
			}
	
			if (passwd.match(/(\d.*\D)|(\D.*\d)/))                    // [FAILED] both letters and numbers, almost works because an additional character is required
			{
				intScore = (intScore+2)
			}
	 																  // [verified] letters, numbers, and special characters
			if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
			{
				intScore = (intScore+2)
			}
		}
		if(intScore == -1) {
		   strVerdict = globals.usrPswTooShort;
		   persent = "5%";
		   inColor = "#ccc"
		} else if(intScore > 0 && intScore < 16) {
		   strVerdict = globals.usrVeryWeak;
		   persent = "10%";
		   inColor = "#f00";
		} else if (intScore > 15 && intScore < 25) {
		   strVerdict = globals.usrWeak;
		   persent = "15%";
		   inColor = "#c06";
		} else if (intScore > 24 && intScore < 35) {
		    strVerdict = globals.usrMedium;
			persent = "20%";
			inColor = "#f60"; 		
		} else if (intScore > 34 && intScore < 45) {
		    strVerdict = globals.usrStrong;
			persent = "30%";
			inColor = "#3c0"; 
		} else {
		   strVerdict = globals.usrVeryStrong;
		   persent = "40%";
		   inColor = "#3f0"; 		   
		}
		$('meterLine').style.width = persent;
		$('meterText').innerHTML = strVerdict;
		$('meterLine').style.backgroundColor = inColor;
		$('meterText').style.color = inColor;	
}
