function trim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) 
{
	return stringToTrim.replace(/^\s+/,"");
}

function rtrim(stringToTrim) 
{
	return stringToTrim.replace(/\s+$/,"");
}

function ComprobarLogin()
{
	var UsuarioRE = new RegExp("^[A-Za-z][A-Za-z0-9_]{3}[A-Za-z0-9_]*$","");
	Usuario = document.getElementById("usuario");

	if (Usuario.value == "")
	{
		alert("Falta el Nombre de Usuario");
		return false;
	}
	else if ( !UsuarioRE.test(Usuario.value) )
	{
		alert("Nombre de Usuario Incorrecto");
		return false;
	}
	else
	{
		return true;
	}

}

function NuevoUsuario()
{
	location.href = "Usuario.php?Opcion=Nuevo";
}