function setEncryptedPasswords(form, passFieldName, challenge, namespace) {
	var input;
	var inputNamePrefix = '';
	if (typeof namespace != 'undefined')
	{
		inputNamePrefix = namespace+'.';
	}
	// plain pw
	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", inputNamePrefix+"personalizer.plain_pw");
	input.setAttribute("value", SHA1(form[passFieldName].value + challenge));
	form.appendChild(input);
	
	// sha1 pw
	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", inputNamePrefix+"personalizer.sha1_pw");
	input.setAttribute("value", SHA1(SHA1(form[passFieldName].value) + challenge));
	form.appendChild(input);
	
	// md5 pw
	input = document.createElement("input");
	input.setAttribute("type", "hidden");
	input.setAttribute("name", inputNamePrefix+"personalizer.md5_pw");
	input.setAttribute("value", SHA1(MD5(form[passFieldName].value) + challenge));
	form.appendChild(input);
	
	// delete not encrypted password from post data
	form[passFieldName].value = '';	
}

