function init() {
  var str = location.search;
  var pos = str.indexOf("USUARIO=");
  if (pos != -1) {
    var usuario = str.substring(pos + 8, str.length);
    document.forms[0].elements["loginusuario"].value=usuario;
  }
  document.forms[0].elements["loginscreenres"].value = screen.width;
  document.forms[0].elements["loginusuario"].focus();
  return true;
}

function valido() {
  if(! document.forms[0].elements["loginusuario"].value.match(/\S+/)) {
    alert("Ingresar usuario");
    document.forms[0].elements["loginusuario"].focus();
    return false;
  }
  if(! document.forms[0].elements["logincontrasena"].value.match(/\S+/)) {
    alert("Ingresar contrasena");
    document.forms[0].elements["logincontrasena"].focus();
    return false;
  }
 return true;
}