function EnviarFormulario()
{
   document.frmTablas.submit();
}

function EnviarDatos()
{
   document.frmTablas.accion.value="Ingresar Datos";	
   document.frmTablas.submit();
}

function LimpiarFormulario()
{
   document.frmTablas.desc.value="";
}

function imprimir() {
window.print()
}

function resetear()
{
   document.frmTablas.volver.value="resetear";
   document.frmTablas.submit();
}

function Logueo(usuario,contrasena)
{
	if (document.frmPrincipal.xusuario1.value=="" && document.frmPrincipal.xclave1.value=="")
        {
		alert("No ha Ingresado Nombre o Clave de usuario...");
		return;
	} else 
	{
	frmPrincipal.xusuario1.value = frmPrincipal.xusuario1.value;
	frmPrincipal.xclave1.value = frmPrincipal.xclave1.value;
	document.frmPrincipal.submit();
	}
}

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) 
{
	var keyCode = (isNN) ? e.which : e.keyCode; 
	var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
	if(input.value.length >= len && !containsElement(filter,keyCode)) {
	input.value = input.value.slice(0, len);
	input.form[(getIndex(input)+1) % input.form.length].focus();
	}
	function containsElement(arr, ele) {
	var found = false, index = 0;
	while(!found && index < arr.length)
	if(arr[index] == ele)
	found = true;
	else
	index++;
	return found;
	}
	function getIndex(input) {
	var index = -1, i = 0, found = false;
	while (i < input.form.length && index == -1)
	if (input.form[i] == input)index = i;
	else i++;
	return index;
	}
return true;
}

function putFocus(formInst, elementInst) 
{
  if (document.forms.length > 0) {
   document.forms[formInst].elements[elementInst].focus();
   //document.forms[formInst].elements[elementInst].style.backgroundColor = '#CBE0ED';
   //document.forms[formInst].elements[elementInst].style.backgroundColor = '#CCCCCC';
  }
}

function tabulacion_enter(formInst, elementInst)
{
	siguienteCampo = elementInst;
	//nombre del formlario
	nombreForm = formInst;
	//deteccion del navegador
	netscape = document.layers	
	//funcion que gestiona el evento
	function TelcaPulsada( eventoPulsaTecla ) {
	   tecla = (netscape) ? eventoPulsaTecla.which : window.event.keyCode
	   if (tecla == 13) { 					//se pulso enter
	      if ( siguienteCampo == 'fin' ) {			//fin de la secuencia, hace el submit
	         alert('Envio del formulario.')			//eliminar este alert para uso normal
	         return false					//sustituir por return true para hacer el submit
	      } else { 						//da el foco al siguiente campo
	         eval('document.' + nombreForm + '.' + siguienteCampo + '.focus()')
	         return false
	      }
	   }
	}
	
	document.onkeydown = TelcaPulsada			//asigna el evento pulsacion tecla a la funcion
	
	if (netscape)						//netscape es especial: requiere activar la captura del evento
		document.captureEvents(Event.KEYDOWN)
}
function marcar_check(formInst, elementInst ,elementChk)
{
	elementochk = elementChk;
	siguienteCampo = elementInst;
	//nombre del formlario
	nombreForm = formInst;
	//deteccion del navegador
	netscape = document.layers
	//funcion que gestiona el evento
	function TelcaPulsada( eventoPulsaTecla ) {
	   tecla = (netscape) ? eventoPulsaTecla.which : window.event.keyCode
	   if (tecla == 13) { 					//se pulso enter
	      if ( siguienteCampo == 'fin' ) {			//fin de la secuencia, hace el submit
	         alert('Envio del formulario.')			//eliminar este alert para uso normal
	         return false					//sustituir por return true para hacer el submit
	      } else { 						//da el foco al siguiente campo
		 eval('document.' + nombreForm + '.' + elementochk + '.checked=true;')
	         eval('document.' + nombreForm + '.' + siguienteCampo + '.focus();')
	         return false
	      }
	   }
	}
	
	document.onkeydown = TelcaPulsada			//asigna el evento pulsacion tecla a la funcion
	
	if (netscape)						//netscape es especial: requiere activar la captura del evento
		document.captureEvents(Event.KEYDOWN)
}

function Logueo2()
{
	document.frmLog.submit();
}

function Avanzar()
{
	if (frmPrincipal.menu.value!="" && frmPrincipal.submenu.value!="")
        {
	frmPrincipal.menu.value=$menu;
		frmPrincipal.submit();
	}
}

 browserversion = parseInt(navigator.appVersion);

if  (browserversion >= 3) ver = "n3";

        else ver = "n2";

// Un-highlight a link

        function unhighlight(img) {

                if (ver == "n3") {

                        document[img].src = img + "e-a.gif";

                }

        }

var WinPup=null;

function windowOpener(a,b,c) {

                if (ver == "n3") {

                        if((WinPup==null)||(WinPup.closed))

                         {

                                WinPup=window.open(a,b,c);

                        }

                        else {

                                WinPup.close();WinPup=window.open(a,b,c);

                        }

                }

                else {

window.open(a,b,'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=auto,resizable=yes,width=400,height=400');

                }

        }

function elegir(esto,tabla,filtro,variable)
{
pepe=window.open("ventana_nueva.php3?tabla="+tabla+"&filtro="+filtro+"&name="+variable, "ventana" , 'toolbar=NO,location=NO,directories=NO,status=NO,menubar=NO,scrollbars=auto,resizable=YES,width=400,height=400');
}

    function abreVentana(pagina, nombre_ventana, ancho, alto, mostrar_statusbar, mostrar_menubar, mostrar_scrolls, redimensionar, mostrar_toolbar, mostrar_direccion)
    {
	siguienteCampo = nombre_ventana;
	m_scrolls = mostrar_scrolls;

	w = (ancho == '500'? 510:500);
	h = (alto == '400'? 410:400);

        if ( siguienteCampo.length == 8 && siguienteCampo == "Personal"  )
        {
		siguienteCampo = "Personal";
		w = 860;
		h = 540;
	}
        if ( siguienteCampo.length == 11 && siguienteCampo == "Curriculum."  )
        {
		siguienteCampo = "Curriculum";
		w = 840;
		h = 540;
	}
        if ( siguienteCampo.length == 11 && siguienteCampo == "Contáctenos"  )
        {
		siguienteCampo = "Contactenos";
	}

        if ( siguienteCampo.length == 7 && siguienteCampo == "Ofertas"  )
        {
		siguienteCampo = "Ofertas";
		siguienteCampo = "Personal";
		w = 860;
		h = 540;
		m_scrolls = "YES";
	}

	var opciones = "top = 0, left = 0, width = " + w + ", height = " + h + ", status = " + mostrar_statusbar + ", menubar = " + mostrar_menubar +  ", scrollbars = " + m_scrolls + ", resizable = " + redimensionar + ", toolbar = " + mostrar_toolbar + ", location = " + mostrar_direccion;
        window.open(pagina, siguienteCampo, opciones);

    }