function passwordStrength(password)
{
	var desc = new Array();
	desc[0] = "&#1582;&#1610;&#1604;&#1610; &#1590;&#1593;&#1610;&#1601;";
	desc[1] = "&#1590;&#1593;&#1610;&#1601;";
	desc[2] = "&#1582;&#1608;&#1576;";
	desc[3] = "&#1605;&#1578;&#1608;&#1587;&#1591;";
	desc[4] = "&#1582;&#1610;&#1604;&#1610; &#1582;&#1608;&#1576;";
	desc[5] = "&#1593;&#1575;&#1604;&#1610;";


	var score   = 0;

	//if password bigger than 3 give 1 point
	if (password.length > 3) score++;

	//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++;

	//if password has at least one special caracther give 1 point
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;

	//if password bigger than 10 give another 1 point
	if (password.length > 12) score++;

	 document.getElementById("passwordDescription").innerHTML = desc[score];
	 document.getElementById("passwordStrength").className = "strength" + score;
}


