function testPass(Pass, Res)
{
	var p = document.getElementById(Pass);
	var r = document.getElementById(Res);
	var passPerSec = document.getElementById('count').value;
	r.style.visibility = "hidden";
	if (p.value == "")
	{
		r.innerHTML = "";
		return;
	}
	r.style.visibility = "visible";
	var antal = 0;
	var comments = "";
	if (/[a-zåäö]/.test(p.value))
		antal += 29;
	if (/[A-ZÅÄÖ]/.test(p.value))
		antal += 29;
	if (antal <= 29)
		comments += "<li>You should use both capital and lower case letters</li>";
	if (/[0-9]/.test(p.value))
		antal += 10;
	else
		comments += "<li>You should add some numbers</li>";
	if (/[^0-9a-zåäö]/i.test(p.value))
		antal += 50;
	else
		comments += "<li>You should add some special characters</li>";
	if (p.value.length < 6)
		comments += "<li>Your password should be atleast 6 characters long</li>";
	var sekunder = Math.pow(antal, p.value.length) / (2 * passPerSec);
	if (sekunder > 3600*24*365.25)
		r.innerHTML = (sekunder / (3600*24*365.25)) + ' years...';
	else if (sekunder > 3600*24)
		r.innerHTML = (sekunder / (3600*24)) + ' days...';
	else if (sekunder > 3600)
		r.innerHTML = (sekunder / 3600) + ' hours...';
	else if (sekunder > 60)
		r.innerHTML = (sekunder / 60) + ' minutes...';
	else
		r.innerHTML = sekunder + ' seconds...';
	r.innerHTML += '<ul>' + comments + '</ul>';
}