function testPassword(passwd)
{
		var intScore   = 0
		if (passwd.length<6)                         // length 5 or less
		{
			intScore = (intScore+3)
		}
		else if (passwd.length>5 && passwd.length<8) // length 6 and 7
		{
			intScore = (intScore+10)
		}
		else if (passwd.length>7 && passwd.length<16)// length between 8 and 15
		{
			intScore = (intScore+15)
		}
		else if (passwd.length>15)                    // length 16 or more
		{
			intScore = (intScore+18)
		}
		
		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)
		}
		if (passwd.match(/\d+/))                                 // [verified] at least one number
		{
			intScore = (intScore+5)
		}
		if (passwd.match(/(.*[0-9])/))             // [verified] at least three numbers
		{
			intScore = (intScore+5)
		}
		if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/))            // [verified] at least one special character
		{
			intScore = (intScore+10)
		}
		if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/))
		{
			intScore = (intScore+5)
		}
	    if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/))        // [verified] both upper and lower case
		{
			intScore = (intScore+10)
		}
        if (passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/)) // [verified] both letters and numbers
		{
			intScore = (intScore+10)
		}
        if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/))
		{
			intScore = (intScore+2)
		}
	    
        var color = "";
        if(intScore < 4) {
           strVerdict = "None"
           color = "#ff0000";
           width = "0px"
        }else if(intScore < 16)
		{
		   strVerdict = "Very weak"
           color = "#ff0000";
           width = "20%"
		}
		else if (intScore > 15 && intScore < 25)
		{
		   strVerdict = "Weak"
           color = "#ffba00";
           width = "40%"
		}
		else if (intScore > 24 && intScore < 35)
		{
		   strVerdict = "Mediocre"
           color = "#fffc00";
           width = "60%"
		}
		else if (intScore > 34 && intScore < 45)
		{
		   strVerdict = "Strong"
           color = "#baff00";
           width = "80%"
		}
		else
		{
		   strVerdict = "Strong enough"
           color = "#00ff1e";
           width = "100%"
		}
	
    var scoreDisplay = $('stregthScore');
	scoreDisplay.style.backgroundColor = color;
    scoreDisplay.style.width = width; 
	
   $('verdict').innerHTML = (strVerdict)
}