function getRandomNum(lbound, ubound) {
	return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(number, lower, upper, other) {
	var numberChars = "0123456789";
	var lowerChars = "abcdefghijklmnopqrstuvwxyz";
	var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
	var charSet = '';
	if (number == true)
		charSet += numberChars;
	if (lower == true)
		charSet += lowerChars;
	if (upper == true)
		charSet += upperChars;
	if (other == true)
		charSet += otherChars;
	return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length, firstNumber, firstLower, firstUpper, firstOther,
		firstNumber, firstLower, firstUpper, firstOther) {
	var rc = "";
	if (length > 0)
		rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther);
	for (var idx = 1; idx < length; ++idx) {
		rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther);
	}
	return rc;
}
function updatePassword(campo){
	if ($(campo) && $("randomPassword") && $("randomPassword").value){
		$(campo).value = $("randomPassword").value;
		if ($('psStrength_' + campo)) updateStrength($(campo).value, 'psStrength_' + campo);
	}
}