// JavaScript Document


 function abreventana(Forma){
   portal = window.open("https://clientes.protegocb.com/scripts/cgiip.exe/WService=protego/protego2.html?wprotego1=1                                                                                               1                                                                                  1                              &wcuenta="+Forma.wcuenta.value+"&wpassword="+Forma.wpassword.value+"&wtoken="+Forma.wtoken.value+"&westado="+Forma.westado.value,"PortalesP","width=1024,height=600,resizable=yes,scrollbars=yes,menubar=no,titlebar=no,toolbar=no,directories=no,location=no,status=yes,top=0");
   Forma.wcuenta.value="";
   Forma.wpassword.value="";
   Forma.wtoken.value="";
}


function tabOnEnter (field, evt) 
{
 var keyCode = document.layers ? evt.which : document.all ? 
 evt.keyCode : evt.keyCode;
 if (keyCode != 13)
  return true;
 else {
  getNextElement(field).focus();
  return false;
 }
}
function getNextElement (field) 
{
 var frm = field.form;
 var bIs = false;
 for (var e=0;e<frm.length;e++){
  if(frm[e].type!="hidden" && bIs) return frm.elements[e];
  if (field==frm[e]) bIs=true;
 }
} 
function fnAyuda(){
 ayuda = window.open("http://localhost/scripts/cgiip.exe/WService=protego1/ayuda2.html","Ayuda","width=700,height=550,resizable=yes,scrollbars=yes,menubar=no,titlebar=no,toolbar=no,directories=no,location=no,status=yes")
}
function fnTecladoBTodo(){
        srcElem.value = "";}
function fnTecladoBackSpace(){
        if(srcElem.value.length > 0){
        var temporal = "";
        temporal = srcElem.value.substring(0, srcElem.value.length - 1);
        srcElem.value = temporal;}
}
function fnTeclado(letra){
        if(srcElem.value.length < srcElem.maxLength){
        var temporal = "";
        temporal = srcElem.value;
        srcElem.value = temporal + letra;}
        else{window.alert("Solo se permiten " + srcElem.value.length + " caracteres.");
        }
}
function fnTecladoMay(imagen1, imagen2){
        imagen1.style.visibility = "visible";
        imagen1.height = 135;
        imagen1.width = 288;
        imagen2.style.visibility = "hidden";
        imagen2.height = 0;
        imagen2.width = 0;
}
function fnTecladoMin(imagen1, imagen2){
        imagen.src = "teclado_minuscula.jpg";
}
function fnEnter(){ // aqui se define lo que debe hacer el boton de Enter 
        document.login.submit();
}
var srcElem;

