function passwordStrength(password)
{
        var desc = new Array();
        desc[0] = "Unacceptable";
        desc[1] = "Unacceptable";
        desc[2] = "Unacceptable";
        desc[3] = "Unacceptable";
        desc[4] = "Acceptable";
        desc[5] = "Acceptable";
        var score   = 0;

        //if password bigger than 8 give 2 points
        if (password.length > 7) score= score+2;

        //if password has both lower and uppercase characters give 1 point      
        if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;

        //if password has at least one number give 1 point
        if (password.match(/\d+/)) score++;

         document.getElementById("passwordDescription").innerHTML = desc[score];
         document.getElementById("passwordStrength").className = "speech-bubble strength" + score;

}
