function Decora2(valor)
{

	if (valor=='M')

	{ valor="Mapa de la web";} else

	if (valor=='I')

	{ valor="Poner página de inicio";} else

	if (valor=='Add')

	{ valor="Añadir a favoritos";} else

	if (valor=='Con')

	{ valor="Contactar";} else

	if (valor=='pp')

	{ valor="Pantalla principal";} else

	if (valor=='Imp')

	{ valor="Imprimir";} else

	if (valor=='faq')

	{ valor="Preguntas frecuentes";} else

	if (valor=='S')

	{ valor="Buscar (seleccionar y ctrl+k)";} 


	else
	if (valor=='AT')
	{ valor="Atras";} 
	else if (valor=='AD')
	{ valor="Adelante";} 
	else if (valor=='AC')
	{ valor="Actualizar";} 
	else if (valor=='VERN')
	{ valor="Ver en ventana nueva.";} 
	else if (valor=='VER_N')
	{ valor="Ver noticia.";} 
	else if (valor=='VERN_N')
	{ valor="Ver en ventana nueva.";} 

if (valor.length<1)
	texto2="<br><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href='http://www.elbiombo.com'><font color=#000000><b>www.elbiombo.com</b></font></a>";
else
	texto2="<center><br><table width=170><tr><td>&nbsp;</td><td><font color=#000000><b>"+valor+"</b></font></td></tr></table>";

	//mylayerINF.setHTML(texto2);

	/*if (valor.length<1)

	{

		mylayerINF.setVisible(false);

	}

	else 

	{

		mylayerINF.setVisible(true);

	}

	*/
}



poder_refrescar=0;

//Activar2(valor_f) para pagians modelo dat+php

function VerImagen(valor)//paginas ajenas

{

	text="./imagen.php?pagina="+valor;

	//alert(text);

	open(text,"index","width=700, height=600, toolbar=1, scrollbars=1");
}

function LanzaX(valor)//paginas ajenas

{

	text="./lanza.php?valor="+valor;

	//alert(text);

	open(text,"index","width=700, height=600, toolbar=1, scrollbars=1");

}

function Lanza(valor)//paginas ajenas

{

	text="./lanzaHTML.php?valor="+valor;

	//alert(text);

	open(text,"index","width=700, height=600, toolbar=1, scrollbars=1");

}
function PonData(valor)
{
	document.data.tex_b.value=valor;

	document.data.order.value=valor;
	//document.data2.buscaa.focus();
	document.data.dato_aux.value="";
	document.data.pagina.value="buscador";
}
function GetBuscar(txt)//enlace con busca

{

	if (txt.length>0)

	{

		document.data.tex_b.value=txt;

		Buscar();

	
	}



}

function VerBusca()

{

	if (document.getSelection) txt = document.getSelection();

	else if (document.selection) txt = document.selection.createRange().text;

	else return;

	//txt tiene el texto a selecionar

	//alert(event.keyCode);

	if (txt.length>0)

	{

		if ((event.keyCode==11)&&(event.ctrlKey))

		{

			//document.data2.text_busca2.value=txt;

			document.data.tex_b.value=txt;

			Buscar();

		}

	}

}

function Buscar()
{

	te_b=document.data.tex_b.value;

	document.data.order.value=te_b;
	//text="./carga.php?idioma=esp&pagina=buscador&te_b="+te_b;

	//mylayerCUE.setURL(text);

	Activar2("buscador");



}

function BuscarA()
{

	if ((event.keyCode==13))
	{
		te_b=document.data.tex_b.value;

		document.data.order.value=te_b;
		//text="./carga.php?idioma=esp&pagina=buscador&te_b="+te_b;

		//mylayerCUE.setURL(text);

		Activar2("buscador");
	}


}

function BuscarOK()

{

	if (parent.document.data.tex_b.value.length>1)

	{

		parent.document.data.order.value=parent.document.data.tex_b.value;

		GoBusca();

	}

	else	

		location.reload();

}

function GoBusca()

{

	if (document.data.order.value.length>1)

	{

		document.data.dato_aux.value="";

		document.data.pagina.value="buscador";

		document.data.submit();
	

	}

	else

	{

		txt="";

		if (document.getSelection) txt = document.getSelection();

		else 

			if (document.selection) txt = document.selection.createRange().text;

		if (txt.length>0)

		{

			document.data.order.value=txt;

			GoBusca();

		}

		else

		{

			alert("data null");

		}	

	}
	

}

function Refresca()

{

/*	//location.reload();

	//var ancho=DynAPI.document.getWidth(); 

	//var alto=DynAPI.document.getHeight();



//	if (ancho>820)

	{



		//width_bot2=ancho - 10 - x_bot;

		//mylayerBOT.setWidth(width_bot2);

		width_cue2= x_ban - x_cue ;

		mylayerCUE.setWidth(width_cue2);

		//mylayerLAR.setWidth(width_lar);

		mylayerBAN.setWidth(width_ban);

		//mylayerLAR.setVisible(true);

		mylayerBAN.setVisible(true);

	}

	

	*/
}

function Atras()

{

	history.back();

}

function PonFavoritos()

{

	window.external.AddFavorite('http://www.elbiombo.com','Cámara de Comercio e Industria (Miranda de Ebro)');

}

function PonInicioX()

{

	document.body.style.behavior='url(#default#homepage)';

	document.body.setHomePage("http://www.elbiombo.com");

}



function PonMax(valor)

{

	/*if (mylayerCUE.getContentHeight()>400)

			mylayerCUE.setHeight(mylayerCUE.getContentHeight());

	else

			mylayerCUE.setHeight(520);

	if (valor==0)	{return;}

	inter=setTimeout("PonMax("+(valor-1)+")",30);

	*/
}

function Nada(){}

function openHelp()
{

	open("http://www.serviciosintegralesweb.com","www","");

}

function Go(valor,valor2)

{

	if (valor=='H')

	{

		location.replace('./index.php');

	}

	else

	if (valor=='C')

	{

		location.replace('mailto:empresa@elbiombo.com');

	}

	else

	if (valor=='M')

	{

		open("./mapa.html","mapa","");

	}

	else

	if (valor=='I')

	{

		open("./imprimir.php?imagenes=Si&pagina="+document.data.paginax.value+"&dato_aux="+document.data.dato_aux.value+"","index","width=600; height=500; toolbar=1; scrollbars=1;");

		//window.print();

	}

	else

	if (valor=='F')

	{

		//mylayerCUE.setURL("./carga.php?pagina=faq&idioma=esp");

		Activar2('faq');
	}

	

	setTimeout("PonMax(1)",300);

}

function AtrasP()

{ history.go(-1);}

function AdelanteP()
{ history.go(+1);}

function ActualizarP()
{ location.reload();}

function ImprimirP()
{ window.print();}

function AddUsuarioLista()
{
	email=parent.document.data5.email_lista.value;
	nombre=parent.document.data5.nombre_lista.value;
	if ((email.length>6)&&(nombre.length>4))
	{
		//alert("SSS");
	open("./miscelanea.php?nombre="+nombre+"&email="+email+"&op=alta_user_lista_all&id=58436299923772610053","index","width=700, height=400, toolbar=1, scrollbars=1");

	}
	else
		alert("Debe rellenar los datos nombre y email correctamente.");
}
function Mayor(valor,valor2)
{
if (valor.length<=valor2)
{
	alert("El valor debe ser mayor que "+valor2+" caracteres.");
}

}



function PonEmp(valor) 
{ 
	parent.document.data.pagina.value='xempresas'; 	
	parent.document.data.dato_aux.value= valor; 	
	parent.document.data.submit(); 
}
function LanzaEmp(valor) 
{ 	
	parent.document.data.pagina.value='catalogo2'; 
	text='lanza.php?pagina=xempresas&dato_aux='+valor; 	
	open (text,'www','width=700, height=600, toolbar=1, scrollbars=1'); 
}
function LanzaEnc(valor) 
{
	text='lanza.php?pagina=xencuesta&op=con&id_enc='+valor; 	
	open (text,'www','width=400, height=400, toolbar=1, scrollbars=1'); 
}
function LanzaEnl(valor) 
{
	text='lanza.php?pagina=xenlaces&id_link='+valor; 	
	open (text,'www','width=400, height=400, toolbar=1, scrollbars=1'); 
}

function PonNot(valor) 
{ 	
	parent.document.data.pagina.value='xnoticias'; 	
	parent.document.data.dato_aux.value= valor; 	
	parent.document.data.submit(); 
}
function LanzaNot(valor) 
{ 	
	parent.document.data.pagina.value='xnoticias'; 
	text='lanza.php?pagina=xnoticias&dato_aux='+valor; 	
	open (text,'www','width=700, height=600, toolbar=1, scrollbars=1'); 
}
function LanzaOfe(valor) 
{
	text='lanza.php?pagina=xoferta&id_oferta='+valor; 	
	open (text,'www','width=500, height=500, toolbar=1, scrollbars=1'); 
}
function LanzaCur(valor) 
{
	text='lanza.php?pagina=xcurso&id_emp='+valor; 	
	open (text,'www','width=600, height=600, toolbar=1, scrollbars=1'); 
} 

function PonNoticia(valor,tipo)
{
	if (tipo==0)
	{
		idioma=document.data.idioma.value;
		texto="./datos/xnoticias2.php?pagina="+valor+"&idioma="+idioma+"&nueva=1";
		open(texto,"xp","width=600; height=500; toolbar=1; scrollbars=1;");
	}
	else
	{
		/*document.data.pagina.value='xnoticias2';
		document.data.pos.value=99;/
		document.data.t_dato.value='Noti';
		document.data.dato_aux.value=valor;
		document.data.submit();
		mylayerCUE.setURL("./lanza.php?pagina=xnoticias2&idioma=esp&otro="+valor);
	*/
		document.data.pagina.value='xnoticias2';
		document.data.dato_aux.value=valor;
		//document.data.categoria.value=categoria;
		document.data.t_dato.value='Noti';
		document.data.submit();
	}
}

function PonProducto(valor,tipo)
{
	if (tipo==0)
	{
		idioma=document.data.idioma.value;
		texto="./datos/xproductos.php?pagina="+valor+"&idioma="+idioma+"&nueva=1";
		open(texto,"xp","width=600; height=400; toolbar=1; scrollbars=1; resizable=1;");
	}
	else
	{
		document.data.pagina.value='xproductos';
		document.data.dato_aux.value=valor;
		document.data.t_dato.value='Prod';
		document.data.submit();
	
	}
}
function Enviar()
{
	ok=0;
	if (document.data_mail.nombre.value.length<=0) ok++;
	if (document.data_mail.Apellidos.value.length<=0) ok++;
	if (document.data_mail.Direccion.value.length<=0) ok++;
	if (document.data_mail.CP.value.length<=0) ok++;
	if (document.data_mail.Ciudad.value.length<=0) ok++;
	if (document.data_mail.Provincia_Pais.value.length<=0) ok++;
	if (document.data_mail.Telefono.value.length<=0) ok++;
//	if (document.data_mail.Fax.value.lenght<=0) ok++;
//	if (document.data_mail.email.value.lenght<=0) ok++;
	if (document.data_mail.contenido.value.length<=0) ok++;
	if (ok==0)
	{
		document.data_mail.submit();
	}
	else
		alert("Debe rellenar correctamente todos los datos marcados con *");

}
function PonProyecto(valor,tipo)
{
	if (tipo==0)
	{
		idioma=document.data.idioma.value;
		texto="./datos/xproyectos.php?pagina="+valor+"&idioma="+idioma+"&nueva=1";
		open(texto,"xp","width=600; height=500; toolbar=1; scrollbars=1; resizable=1;");
	}
	else
	{
		document.data.pagina.value='xproyectos';
		document.data.dato_aux.value=valor;
		document.data.t_dato.value='Proy';
		document.data.submit();
	
	}
}

