function passwordStrength(password,type)
{
        var desc = new Array();
		switch(type){
			case "en":
					desc[0] = "Very Weak";
					desc[1] = "Weak";
					desc[2] = "Medium";
					desc[3] = "Strong";
				break;
			case "th":
				desc[0] = "ไม่ปลอดภัย";
				desc[1] = "ไม่ค่อยปลอดภัย";
				desc[2] = "ปานกลาง";
				desc[3] = "ปลอดภัย";
			break;
			default :
					desc[0] = "Very Weak";
					desc[1] = "Weak";
					desc[2] = "Medium";
					desc[3] = "Strong";
				break;
		}

		var score   = 0;
        //if password bigger than 6 give 1 point
        if (password.length > 6) score++;
        //if password has both lower and uppercase characters give 1 point  and at least one number give 1 point
        if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) && (password.match(/\d+/)) )score++;
        //if password has at least one special caracther give 1 point
        if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;
        document.getElementById("passwordDescription").innerHTML = desc[score];
        document.getElementById("passwordStrength").className = "strength" + score;
}

function showProvinceJS(str){
	alert(str);
}

