
<!-- FOCO EN FORMULARIO
 function Enfoca(formulario, campo) {
   var maxforms = document.forms.length;
   var nform = formulario + 1;
   if (nform > maxforms) { return; }
   var maxcamps = document.forms[formulario].elements.length;
   var ncamp = campo + 1;
   if (maxforms >= nform && maxcamps >= ncamp) {
     document.forms[formulario].elements[campo].focus();}
 }
//  End -->

<!-- FOCO EN PRIMER CAMPO LIBRE DE FORMULARIO
 function EnfocaLibre(formulario) {
   var maxforms = document.forms.length;
   var nform = formulario + 1;
   if (nform > maxforms) { return; }
   var maxcamps = document.forms[formulario].elements.length;
   if (maxcamps < 1) { return; }
   var ncamp = 1;
   var campo = 0;
         do {
       campo = ncamp - 1;
       if (document.forms[formulario].elements[campo].value == "") {
          Enfoca(formulario, campo);
                  return; }
           ncamp++;
         } while (ncamp <= maxcamps);
 }
//  End -->

<!--  VALIDA CAMPO DE FORMULARIO
function ValidaForm(formulario, campo, texto) {
    if (document.forms[formulario].elements[campo].value == "") {
       alert(texto);
       Enfoca(0,0);}
    else {
       document.forms[formulario].submit(); }
}
// End -->

<!--  ENVIA UN FORMULARIO SIN VALIDAR
function EnviaForm(formulario) {
   document.forms[formulario].submit(); 
}
// End -->

<!--  CONFIRMA IR A UN LINK
function Confirma(texto, url) {
  if (confirm(texto)) {
    location.href = url;}
  else {
        Enfoca(0,0);}
}
// End -->

<!--  PERMITE/IMPIDE IR A UN LINK
function Permite(sn, texto, url) {
  if (sn) {
    location.href = url;}
  else {
        alert(texto);
        Enfoca(0,0);}
}
// End -->

<!--  CONFIRMA Y PERMITE/IMPIDE IR A UN LINK
function ConfirmaPermite(sn, textopermite, textoconfirma, url) {
  if (sn) {
    Confirma(textoconfirma, url); }
  else {
        alert(textopermite);
        Enfoca(0,0); }
}
// End -->

<!--  ATRAS
function Atras(url) {
    if (url) {
       location.href = url; }
    else {
       history.back(); }
}
// End -->

<!--  Eventos Raton
function RaOn(elem, clr) {
	elem.style.backgroundColor = clr;
	elem.style.color = 'black';
}
function RaOff(elem, clr) {
	elem.style.backgroundColor = clr;
}
function RaClick(path) {
	location.href = path;
}
// End -->

<!--  Eventos MenuIzquierda
function RaMenuOn(elem) {
	RaOn(elem, 'EEEEEE');
	elem.style.borderColor = 'black';
	elem.style.color = 'black';
}
function RaMenuOff(elem) {
	RaOff(elem, '336699');
	elem.style.borderColor = '336699';
	elem.style.color = 'EEEEEE';
}
// End -->

<!--  Eventos AreaPrivada
function APSelect() {
	document.APHttp.action=document.APForm.aplink.options[document.APForm.aplink.selectedIndex].value;
	APLanza();
}
function APLanza() {
	if (document.APHttp.action != "") document.APHttp.submit();
}
// End -->

<!-- Chequear e-mail 
function validarmail(direccion) {
if (direccion.indexOf("@") != -1)
	return true;
	else { alert('Debe escribir una dirección e-mail válida');
		return false; }
}
// End -->
