//NOTA: Colocar siempre AL FINAL de la página
//Debe haber un DIV llamado SELF_LoginMsgError en la página, el cual se usará para mostrar los errores

var SELF_LOGINMSGS_OUTDATED = "La cuenta especificada está caducada.";
var SELF_LOGINMSGS_UNKNOWN = "El usuario no existe o la contraseña es incorrecta.";
var SELF_LOGINMSGS_NOCOURSES = "Este usuario no tiene cursos activos actualmente.";

function SELF_LoginMsgShow(divName, msg){
  var div = document.getElementById(divName);
  div.innerHTML = msg;
  div.style.visibility = "visible";
}

var SELF_posError = window.location.search.indexOf("Error=");
var SELF_loginErr = "0";
if (SELF_posError >= 0)
{
  SELF_loginErr = window.location.search.substr(SELF_posError+6,1);
}

switch(SELF_loginErr)
{
  case "1":
    SELF_LoginMsgShow("SELF_LoginMsgError", SELF_LOGINMSGS_OUTDATED);
    break;
  case "2":
    SELF_LoginMsgShow("SELF_LoginMsgError", SELF_LOGINMSGS_UNKNOWN);
    break;
  case "3":
    SELF_LoginMsgShow("SELF_LoginMsgError", SELF_LOGINMSGS_NOCOURSES);
    break;
}

