
/****							  ****
 *									 *	
 *		LIBRERIA DE FUNCIONES 		 *
 *									 *
 ****                             ****/
 
/** 	IDENTIFICACIÓN DE NAVEGADORES    **/

	var nn4 = (document.layers);
	var nn6 = (document.getElementById && !document.all);
	var ie4 = (document.all && !document.getElementById);
	var ie5 = (document.all && document.getElementById);
	
	//var servidor="www.actiu.com" 
	var servidor="www.actiu.biz" 
	//var servidor="servidorbdc/intranet" 


/***********************************/

//** CARGA DE MARCOS FLOTANTES  **//  
function loadPage(id,frm,nestref,url) {
    	if (nn4) {
     		var lyr = (nestref)? eval('document.'+nestref+'.document.'+id) : document.layers[id]
		    lyr.load(url,lyr.clip.width)
	    }
    	else if(ie4) eval("parent." +frm+ ".location = url")
	    else if(ie5 || nn6) eval("document.getElementById('" +frm+ "').src=url")
	}
	
//** MUESTRA DE MARCOS FLOTANTES  **//  
 function showPage(id,frm,name) {
    	if (ie4) {
	    	eval("document.all[id].innerHTML = parent."+frm+".document.body.innerHTML;")
	    }
	    else if(nn6 || ie5) { 
    		eval("document.getElementById(id).innerHTML=window.frames['"+frm+"'].document.getElementById('"+name+"').innerHTML")
	    }
	}
	
/***********************************/


	

/**    CAMBIA EL COLOR DE FONDO DE LA TABLA         **/ 
function tdr(obj,clr) {
	obj.style.cursor = 'pointer';
	obj.style.backgroundColor = clr;
}


/**   ABRIR VENTANAS  **/
function abreP(url,w,h)
{
   window.open(url,'','scrollbars=yes,top=10,left=20,width='+w+',height='+h) 
}

function abreServ(url,w,h)
{
   window.open(url,'','scrollbars=yes,top=10,left=20,width='+w+',height='+h) 
   location.href="index.php";
}


/** ENTRAR EN LA ZONA RESTINGIDA PARA CLIENTES **/
function entrar(){   
	//site="http://servidorbdc/intranet/sp/acceso/checkEntrada.asp"
	//site="http://"+servidor+"/sp/acceso/checkEntrada.asp"
	//site="http://www.actiu.biz/sp/acceso/checkEntrada.asp"
	site="http://"+servidor+"/new05/acceso/acceso.php?estado=ACCESO"
    eval("usuario=document.Acceso.usuario.value")
    eval("clave=document.Acceso.clave.value")
    url=site+"&usuario="+usuario+"&clave="+clave
    location.href=url
    //window.open(url,'Acceso','left=200,top=200,width=5000,height=500,location=yes');
    self.focus();
  }
  
//** ENTRADA PARA DARSE DE ALTA O VER SUS CLAVES **//
function alta(tipo){
	
	if (tipo=="olvido") site="http://"+servidor+"/new05/acceso/gest_alta.php?estado=OLVIDO";
	else site="http://"+servidor+"/new05/acceso/gest_alta.php?estado=IDENT"
	
    window.open(site,'Acceso','left=200,top=15,width=400,height=600')
  }
  
  
  
 
  
/** SALTO ENTRE CAMPOS PULSANDO ENTER **/
//deteccion del navegador
netscape = document.layers
var siguienteCampo=""
//funcion que gestiona el evento
function TelcaPulsada( eventoPulsaTecla ) {
    
	tecla = (netscape) ? eventoPulsaTecla.which : window.event.keyCode

    if (siguienteCampo.length>1)
    { 	
   		if (tecla == 13)				//se pulso enter
   		{
      		if ( siguienteCampo == 'fin' ) {			//fin de la secuencia, hace el submit
	      		entrar()	// Vamos la función de envío de datos
      		} 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)	document.captureEvents(Event.KEYDOWN) 				//netscape es especial: requiere activar la captura del evento


/** **/
