﻿<!--
function passwordStrength(password)
{
	var desc = new Array();
	//desc[0] = "sehr unsicher";
	desc[0] = "sehr unsicher";
	desc[1] = "unsicher";
	desc[2] = "besser";
	desc[3] = "mittel";
	desc[4] = "sicher";
	desc[5] = "sehr sicher";
 
	var score   = 0;
 
	//if password bigger than 6 give 1 point
	if (password.length > 5) 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 12 give another 1 point
	if (password.length > 11) score++;
 
	 document.getElementById("passwordDescription").innerHTML = desc[score];
	 document.getElementById("passwordDescription").className = "strength" + score;
}

//-->
