//////////////////////////////////////////////////////////////////////////////
//
// HASHED LOGIN SUPPORT FUNCTIONS
//
function EncryptElement(idNoise, idElement)
{
	var noise = document.getElementById(idNoise).value;
	var pwd = document.getElementById(idElement).value;
	pwd = pwd.replace(/^\s+|\s+$/g, ''); //remove whitespace
	var password = hex_md5('choicesocialclub'+pwd);
	var enc_pass = hex_md5(noise+password);
	document.getElementById(idElement).value = enc_pass;
	return("true");
}

function HashElement(idElement)
{
	var pwd = document.getElementById(idElement).value;
	var hash = hex_md5('choicesocialclub'+pwd);
	document.getElementById(idElement).value = hash;
	return("true");
}

function EncryptChangePwd(idNoise, idPassword, idNew1, idNew2)
{
    EncryptElement(idNoise, idPassword);
    HashElement(idNew1);
    HashElement(idNew2);
    return("true");
}


