//evaluate password security
function evalPassword(id, imageid, path)
{
	var password = document.getElementById(id).value;
	var uCase = 0;
	var lCase = 0;
	var num = 0;

	//check character use
	for(i=0; i<password.length; i++)
	{
		var c = password.charCodeAt(i);

		if(c >= 65 && c <= 90)
		{
			var uCase = 1;
		}
		else if(c >= 97 && c <= 122)
		{
			var lCase = 1;
		}
		else if(c >= 48 && c <= 57)
		{
			var num = 1;
		}
		else if(c == 33 || c == 64 || c == 35 || c == 36 || c == 37 || c == 94 || c == 38 || c == 42 || c == 40 || c == 41)
		{
			var num = 1;
			// ! @ # $ % ^ & * ( )
		}
	}

	var rating = uCase + lCase + num;


	//check password size
	if(password.length < 8)
	{
		rating = 0;
	}
	else if(password.length >= 10)
	{
		rating += 2;
	}
	else if(password.length >= 8)
	{
		rating += 1;
	}


	//set rating
	for(i=1; i<=5; i++)
	{
		var img = document.getElementById(imageid+i);

		if(i<=rating)
		{
			img.src=path+'pwrating.gif';
		}
		else
		{
			img.src=path+'pwrating_bg.gif';
		}
	}
}
