function acuerdos(idAcu){
	
var opciones = "toolbar=si,directories=si,menubar=si,status=yes,scrollbars=yes,location=si,hotkeys=no,resizable=yes,height=678,width=1016,top=0,left=0,screenX=0,screenY=0";
	
	
			window.open('http://eo.iberinform.es:82/PublicoWebII/Controlador?agente='+idAcu+'&colectivo=002&PROCESO=PrAltaNuevoCliente&ACCION=inicio','IberInformEo',opciones);

}

function pantalla(valor){

 var hz=window.screen.height
 var wz=window.screen.width
 var url="https://eo.iberinform.es/cli/ClienteWebII/LogonEo"; 
 var url1="http://www.iberinform.es/clientes/teleproceso.html"; 
if( wz>800 && hz>600)
{
 wz=1000;
 hz=675;
}else{
 wz=800;
 hz=600;
}
if(valor==1){
window.open(url,'IberInformEo','toolbar=no,directories=no,menubar=no,status=yes,scrollbars=yes,location=no,hotkeys=no,resizable=yes,height='+hz+',width='+wz+',top=0,left=0,screenX=0,screenY=0')
}else{
window.open(url1,'IberInformEo','toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,location=no,hotkeys=no,resizable=yes,height='+hz+',width='+wz+',top=0,left=0,screenX=0,screenY=0')
}
}


function AltaCliente(){
var hz=window.screen.height
var wz=window.screen.width	
 if( wz>800 && hz>600){
 wz=1000;
 hz=675;
	}else{
 wz=800;
 hz=600;
	}
window.open("/Altaonline.htm",'IberInformEo','toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,location=no,hotkeys=no,resizable=yes,height='+hz+',width='+wz+',top=0,left=0,screenX=0,screenY=0')
}

function AltaAportadoresCuentas(URL){
var hz=window.screen.height
var wz=window.screen.width	
 if( wz>800 && hz>600){
 wz=1000;
 hz=675;
	}else{
 wz=800;
 hz=600;
	}
window.open(URL,'IberInformEo','toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,location=no,hotkeys=no,resizable=yes,height='+hz+',width='+wz+',top=0,left=0,screenX=0,screenY=0')
//document.location.href=URL;
}

function AltaCliente3informesGratis(){
var hz=window.screen.height
var wz=window.screen.width	
 if( wz>800 && hz>600){
 wz=1000;
 hz=675;
	}else{
 wz=800;
 hz=600;
	}
window.open("/Altaonline3informesGratis.htm",'IberInformEo','toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes,location=no,hotkeys=no,resizable=yes,height='+hz+',width='+wz+',top=0,left=0,screenX=0,screenY=0')
}

function abrir(pag,alto,ancho)
{
window.open(pag + ".htm","","height=" + alto +","+ "width=" + ancho); 
};

function EntrarUsuario() {
var home = "../Registrado/firmas/index.html";
document.location.href=home;
}

function EntrarUsuario2() {
var home = "Registrado/firmas/index.html";
document.location.href=home;
}

function agregar(){
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.iberinform.es/"; 
      var titulo="Iberinform";
      window.external.AddFavorite(url,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }
} 

function agregarWPI(url,titulo){
     
     
      window.external.AddFavorite(url,titulo);
  
}

function busqueda(criterio) {
(criterio==1) ? document.form1.buscarNIFCIF.value="" : document.form1.buscarDenominacion.value="";
document.form1.submit();
}

function entsub(campo,boton) {
//document.form1.action="Busqueda_Empresas.htm";
	//solo se hace este if para un problema ocasionado con el directorio de empresas fijo.Es un caso eventual.Lo que hacemos es crear un campo hidden mediante javascript para poder enviarle como parámetro el idioma de la webPublica.
//	if(document.form1.idiomaWebPublica){
//		var idioma = document.form1.idiomaWebPublica.value;
		
//	}else{
		//creamos un campo de formulario y le añadimos atributos	
//		var prueba = document.createElement("input");
//		prueba.setAttribute('type','hidden');
//		prueba.setAttribute('name','idiomaWebPublica');
//		prueba.setAttribute('value','ES');
//		prueba.setAttribute('id','idiomaWebPublica');
		//añadimos el campo al formulario
//		document.form1.appendChild(prueba);
//}
    //control de eventos para firefox
	//function entsub(campo,boton,e) {
	//&nbsp;&nbsp;<input name="buscarDenominacion" id="empresas" type="text" class="inputestilo1" size="17" onKeyPress="entsub(this,'',event)" style="font-size:12px; font-weight:bold"><input name="Submit22" type="button" class="botonBuscar1" value="" onClick="javascript:entsub(document.form1.buscarDenominacion,true,event);">
	//tecla = (document.all) ? e.keyCode : e.which;
	//if ((tecla == 13) || boton) {

	if ((window.event && window.event.keyCode == 13) || boton) {
	switch (campo.name) {

		case 'buscarDenominacion' : 
				var deno = document.form1.buscarDenominacion.value;
				//deno.toUpperCase();
				/*deno=deno.replace(/ñ/g,"n");
				deno=deno.replace(/Ñ/g,"N");
				deno=deno.replace(/'/g," ");*/
				if(deno==''){
					alert('Introduzca un t\u00E9rmino de b\u00FAsqueda');
				//}else if(deno.length < 2){
				//	alert('Introduzca al menos 2 caracteres en la b\u00FAsqueda')
				}else{
				document.form1.buscarDenominacion.value=deno;
				document.form1.buscarNIFCIF.value="";
				document.form1.submit();
				}
			break;
			
		case 'buscarNIFCIF' : 
				var nif = document.form1.buscarNIFCIF.value;
				nif = nif.toUpperCase();
				
				if(nif==''){
					alert('Introduzca un CIF/NIF');
				}else{				
					document.form1.buscarDenominacion.value="";
					document.form1.buscarNIFCIF.value=nif;
					document.form1.submit();
				}				
			break;

		default : 
			break;	
		}		
	}
}

function entsub1(campo,boton) {
	//solo se hace este if para un problema ocasionado con el directorio de empresas fijo.Es un caso eventual.Lo que hacemos es crear un campo hidden mediante javascript para poder enviarle como parámetro el idioma de la webPublica.
//	if(document.form1.idiomaWebPublica){
//		var idioma = document.form1.idiomaWebPublica.value;
		
//	}else{
		//creamos un campo de formulario y le añadimos atributos	
//		var prueba = document.createElement("input");
//		prueba.setAttribute('type','hidden');
//		prueba.setAttribute('name','idiomaWebPublica');
//		prueba.setAttribute('value','ES');
//		prueba.setAttribute('id','idiomaWebPublica');
		//añadimos el campo al formulario
//		document.form1.appendChild(prueba);
//}

	if ((window.event && window.event.keyCode == 13) || boton) {
	switch (campo.name) {

		case 'buscarDenominacion' : 
				var deno = document.form2.buscarDenominacion.value;
				//deno.toUpperCase();
				/*deno=deno.replace(/ñ/g,"n");
				deno=deno.replace(/Ñ/g,"N");
				deno=deno.replace(/'/g," ");*/
				if(deno==''){
					alert('Introduzca un t\u00E9rmino de b\u00FAsqueda');
				//}else if(deno.length < 2){
				//	alert('Introduzca al menos 2 caracteres en la b\u00FAsqueda')
				}else{
				document.form2.buscarDenominacion.value=deno;
				document.form2.buscarNIFCIF.value="";
				document.form2.submit();
				}
			break;
			
		case 'buscarNIFCIF' : 
				var nif = document.form2.buscarNIFCIF.value;
				nif = nif.toUpperCase();
				
				if(nif==''){
					alert('Introduzca un CIF/NIF');
				}else{				
					document.form2.buscarDenominacion.value="";
					document.form2.buscarNIFCIF.value=nif;
					document.form2.submit();
				}				
			break;

		default : 
			break;	
		}		
	}
}

function entsubAjax(evento,campo,boton) {

document.form2.action="/Busqueda_Empresas.htm";

	if ((evento.keyCode == 13 || evento.which == 13) || boton) {
	switch (campo.name) {

		case 'buscarDenominacion' : 
				var deno = document.form2.buscarDenominacion.value;
				
				if(deno=='' || deno=='Por Nombre'){
					alert('Introduzca un t\u00E9rmino de b\u00FAsqueda');
				}else{
					document.form2.buscarDenominacion.value=deno;
					document.form2.buscarNIFCIF.value="";
					document.form2.submit();
				}
			break;
			
		case 'buscarNIFCIF' : 
				var nif = document.form2.buscarNIFCIF.value;
				nif = nif.toUpperCase();
				
				if(nif=='' || nif=='POR CIF/NIF'){
					alert('Introduzca un CIF/NIF');
				}else{				
					document.form2.buscarDenominacion.value="";
					document.form2.buscarNIFCIF.value=nif;
					document.form2.submit();
				}				
			break;

		default : 
			break;	
		}		
	}
}

function on(objeto) {
objeto.style.background='#e6e6e6';
}
 
function off(objeto) {
objeto.style.background='#ffffff';
}

function over(objeto) {
objeto.className='filaover';
}

function no_over(objeto,celda) {
objeto.className=celda;
}

function Siguiente(pagina){
document.location=pagina;
}

/* Funciones Fermin */
//ocultar
function ocultar(){
	clearInterval(timer);
	clearTimeout(tim_chkC);
	clearTimeout(tim_chkF);
	mouse_inC = false;
	mouse_inF = false;
	alto = 0;
	ref.style.clip='rect(0, 195px, 0, 0)';
}
//cortinilla
var timer=null;
var alto = 0;
var ref = null;

function startShow(){
	if (ref) {
		clearInterval(timer);
		timer = setInterval("show()",40);
	}
}
function startHide(){
	if (ref) {
		clearInterval(timer);
		timer = setInterval("hide()",40);
	}
}
function show(){
	if (ref) {
		var delta = (390-alto)/10;
		if (delta>=1) {
			alto += delta;
			ref.style.clip='rect(0, 195px, ' + alto + 'px, 0)';
		}else{
			clearInterval(timer);
			ref.style.clip='rect(0, 195px, 390px, 0)';
		}
	}
}
function hide(){
	if (ref) {
		var delta = alto/10;
		if (delta>=1) {
			alto -= delta;
			ref.style.clip='rect(0, 195px, ' + alto + 'px, 0)';
		}else{
			clearInterval(timer);
			ref.style.clip='rect(0, 195px, 0, 0)';
		}
	}
}

//control in/out
var mouse_inC = false;
var mouse_inF = false;
var tim_chkC = null;
var tim_chkF = null;
function alEntrarC(){
	mouse_inC = true;
}
function alEntrarF(){
	mouse_inF = true;
}
function alSalirC(){
	if (mouse_inC){
		mouse_inC = false;
		clearTimeout(tim_chkC);
		tim_chkC = setTimeout("checkHide()",100);
	}
}
function alSalirF(){
	if (mouse_inF){
		mouse_inF = false;
		clearTimeout(tim_chkF);
		tim_chkF = setTimeout("checkHide()",100);
	}
}
function checkHide(){
	clearTimeout(tim_chkC);
	clearTimeout(tim_chkF);	
	if (!(mouse_inF||mouse_inC)) {
		startHide();
	}
}
//inicializar (lo llamamos justo antes que lo del clicktracks)
function inicializar(){
  ref = document.getElementById('fondo_oculto');
  if (ref){
	  ref.onmouseover = alEntrarF;
	  ref.onmouseout = alSalirF;
  }
  ref = document.getElementById('cont_oculto');
  if (ref){
	  ref.onmouseover = alEntrarC;
	  ref.onmouseout = alSalirC;
  }
  ref = document.getElementById('acceso_oculto');
}

//funcion para banners aleatorios de iber+ e investigado
//en las jsp y html solo hay que hacer la siguiente llamada
//<script>document.write(pintoBanner());< /script>
function ver_imagen(){
	n=0;
	this[n++]="/bannerCortoIber.gif";
	this[n++]="/bannerCortoInvestigado.gif";
	this[n++]="/bannerCortoRai.gif";
	this.N=n;
}

function pintoBanner(){
	var imagen=new ver_imagen();
	src= imagen[ Math.floor(Math.random() * imagen.N) ] ;
	if(src=="/bannerCortoIber.gif"){
		href="/Servicios/InfEstandarIber+.htm";
	}else if(src=="/bannerCortoInvestigado.gif"){
		href="/Servicios/InformeInvestigado.htm"
	}else{
		href="/RAI.htm"
	}
	
	final = '<a href='+href+'><img src='+src+' border=0></a>';
	return final;
}


function limp(objeto) {
var campo = objeto.name;
	switch (campo) {
		case 'buscarDenominacion' : 
			if (objeto.value=='Por Nombre') { objeto.value=""; objeto.select(); return; } 
			if (objeto.value=='') 				  { objeto.value="Por Nombre"; return; } 
			break;

		case 'buscarNIFCIF' : 
			if (objeto.value=='Por CIF/NIF') { objeto.value=""; objeto.select(); return; }		
			if (objeto.value=='') 		   { objeto.value="Por CIF/NIF"; return; }		
			break;
	}
 }
 
function recargarBuscador(numero){
	eval("document.form"+numero+".buscarDenominacion.value='Por Nombre'");
	eval("document.form"+numero+".buscarNIFCIF.value='Por CIF/NIF'");

	return true;
} 
 
 function autoCompletarJquery(){
		$(document).ready(function() {
			$("#empresas").autocomplete("/wpi/web/jsps_ajax/autoCompleteAjax.jsp",{
					delay:10,
					minChars:1,
					matchSubset:1,
					matchContains:1,
					cacheLength:10,
					autoFill:false
					});});
}
 
 
/*marcadores sociales en noticias y directorio*/
function cargaBookmark(id,urlbookmark){
	 var element = document.getElementById(id);
	 element.href=urlbookmark+document.URL;

}
 
 
function numerico(){
  if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;
} 


/*google maps*/
function ver(){
/*en el caso de que google maps encuentre la direccion solicitada, se mostrara un texto con un enlace
el cual al pulsarle desplegará el mapa de google con la hubicación,si se decide pulsar el enlace se ocultará el mapa*/
	var objeto = document.getElementById('map');
    
	
	if(botonVisible==true && (objeto.className=="mapNone")){
		//document.getElementById('map').style.visibility='visible';
		//document.getElementById('map').style.display='block';
		objeto.className="mapBlock";
		document.getElementById('texto_google').innerHTML = "Ocultar Google Maps ";
		document.getElementById('boton_google').title="Ocultar mapa";
		
	}else{
		//document.getElementById('map').style.visibility='hidden';
		//document.getElementById('map').style.display='none';
		objeto.className="mapNone";
		document.getElementById('texto_google').innerHTML = "Ver en Google Maps ";
		document.getElementById('boton_google').title="Mostrar mapa";
	}

}


 function ocultaMapaCarga(){
 //una vez cargado el mapa en la funcion load, ocultamos el div que lo incluye 
 //para evitar que se muestre el mapa sino recupera datos
 //y además habilitar un boton para mostrar/ocultar el mapa.
 var objeto = document.getElementById('map');
 objeto.className="mapNone";
 //document.getElementById('map').style.visibility='hidden';
 //document.getElementById('map').style.display='none';
 }
function estiloOn(objeto) {
objeto.className="enlCnaEmphover";
}

 function estiloOff(objeto) {
objeto.className="enlCnaEmp";
}