function password_strength(password)
{
	var desc = new Array();
	desc[0] = "Velmi slabé";
	desc[1] = "Slabé";
	desc[2] = "Lepší";
	desc[3] = "Střední";
	desc[4] = "Silné";
	desc[5] = "Velmi silné";

	var points = 0;

	//---- if password is bigger than 4 , give 1 point.
	if (password.length > 4) points++;

	//---- if password has both lowercase and uppercase characters , give 1 point.	
	if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) points++;

	//---- if password has at least one number , give 1 point.
	if (password.match(/\d+/)) points++;

	//---- if password has at least one special caracther , give 1 point.
	if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) )	points++;

	//---- if password is bigger than 12 ,  give 1 point.
	if (password.length > 12) points++;

	//---- Showing  description for password strength.
	document.getElementById("password_description").innerHTML = desc[points];
	
	//---- Changeing CSS class.
	document.getElementById("password_strength").className = "strength" + points;
}
