function Traducir(valor)
{
	aux="http://translate.google.com/translate?hl=es&sl="+valor+"&u="+url;
	location.replace(aux);
}
function PonNoticia(valor,tipo)
{
	if (tipo==0)
	{
		idioma=document.data.idioma.value;
		texto="./datos/noticias/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.dato_aux.value=valor;
		//document.data.categoria.value=categoria;
		document.data.t_dato.value='Noti';
		document.data.submit();
	}
}
function PonOpi(valor)
{
	
		
		document.data.pagina.value='opiniones/xopiniones';
		document.data.dato_aux.value=valor;
		//document.data.categoria.value=categoria;
		document.data.t_dato.value='Opi';
		document.data.submit();

}
function LanzaOpi(valor)
{
		idioma=document.data.idioma.value;
		texto="./datos/opiniones/xopiniones.php?pagina="+valor+"&idioma="+idioma+"&nueva=1";
		open(texto,"xp","width=600; height=500; toolbar=1; scrollbars=1;");
}

function PonProyecto(valor,tipo)
{
	if (tipo==0)
	{
		idioma=document.data.idioma.value;
		texto="./datos/proyectos/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();
	
	}
}
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.ctme.org'><font color=#000000><b>www.ctme.org</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>";

	//DDmylayerINF.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=0, scrollbars=1,location=0,status=0,menubar=0");
}
function LanzaX(valor)//paginas ajenas
{
	text="./lanza.php?pag=lanzaX&valor="+valor;
	//alert(text);
	open(text,"index","top=50,left=50, width=700, height=600, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1");
}


function Lanza(valor)//paginas ajenas
{
	text="./lanzaHTML.php?valor="+valor;
	//alert(text);
	open(text,"index","top=50,left=50,width=700, height=600, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1");
}
function Open(valor)//paginas ajenas
{
	open(valor,"valor_index","top=50,left=50,width=700, height=600, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1");
}
function Open2(valor,x,y)//paginas ajenas
{
	open(valor,"valor_index","top=50,left=50,width="+x+", height="+y+", toolbar=0, scrollbars=auto,location=0,status=0,menubar=0,resizable=1");
}
function PonData(valor)
{
	document.data.tex_b.value=valor;
	document.data.order.value=valor;
	//document.data.buscaa.focus();
	document.data.dato_aux.value="";
	document.data.paginax.value="buscador/buscador";
}
function GetBuscar(txt)//enlace con busca
{
	if (txt.length>0)
	{
		document.data.tex_b.value=txt;
		Buscar();
	
	}

}

function Salta(e)
{
		if(window.event)
			keyPressed = window.event.keyCode; // IE
		else
			keyPressed = e.which; // Firefox
		
		if ((keyPressed==13))	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(window.event)
			keyPressed = window.event.keyCode; // IE
		else
			keyPressed = e.which; // Firefox

		
		
		
		if ((keyPressed==11)&&(event.ctrlKey))
		{
			//document.data.text_busca2.value=txt;
			document.data.tex_b2.value=txt;
			Buscar_sin();
		}
	}
}
function Buscar()
{

	te_b=document.data.tex_b.value;
	document.data.order.value=te_b;
	if (te_b.length>0)
	{
			Activar2("buscador/buscador");
	}
	else
	{
		alert("debe introducir un termino de busqueda");
		document.data.pagina.value=document.data.paginax.value;
	}
	//text="./carga.php?idioma=esp&pagina=buscador&te_b="+te_b;
	//mylayerCUE.setURL(text);


}
function Buscar_sin()
{
	te_b=document.data.tex_b2.value;
	document.data.order.value=te_b;
	if (te_b.length>0)
	{
			Activar2("buscador/buscador");
	}
	else
		alert("debe introducir un termino de busqueda");
	//text="./carga.php?idioma=esp&pagina=buscador&te_b="+te_b;
	//mylayerCUE.setURL(text);


}
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.paginax.value="buscador/buscador";
		document.data.submit();
		PonEspera();
	}
	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()
{

}
function Atras()
{
	history.back();
}
function PonFavoritos()
{
	window.external.AddFavorite('http://www.ctme.org','Centro Tecnológico - Miranda de Ebro');
}
function PonInicioX()
{
	document.body.style.behavior='url(#default#homepage)';
	document.body.setHomePage("http://www.ctme.org");
}

function PonMax(valor)
{

}
function Nada(){}
function openHelp()
{
	open("http://www.siw.es","www","");
}
function Go(valor,valor2)
{
	if (valor=='H')
	{
		location.replace('./index.php');
	}
	else
	if (valor=='C')
	{
		location.replace('mailto:info@ctme.org');
	}
	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=0; scrollbars=1,location=0,status=0,menubar=0,resizable=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 Mayor(valor,valor2)
{
if (valor.length<=valor2)
{
	alert("El valor debe ser mayor que "+valor2+" caracteres.");
}

}


function PonNot(valor) 
{ 	
	document.data.pagina.value='noticias/xnoticias'; 	
	document.data.dato_aux.value= valor; 	
	document.data.submit(); 
	PonEspera();
}
function PonArt(valor) 
{ 	
	document.data.pagina.value='articulos/xarticulos'; 	
	document.data.dato_aux.value= valor; 	
	document.data.submit(); 
	PonEspera();
}
function PonFaq(valor) 
{ 	
	document.data.pagina.value='faq/xfaq'; 	
	document.data.dato_aux.value= valor; 	
	document.data.submit(); 
	PonEspera();
}
function PonEve(valor) 
{ 	
	document.data.pagina.value='eventos/xeventos'; 	
	document.data.dato_aux.value= valor; 	
	document.data.submit(); 
	PonEspera();
}
function LanzaNot(valor) 
{ 	
	document.data.pagina.value='noticias/xnoticias'; 
	text='lanza.php?pagina=noticias/xnoticias&dato_aux='+valor; 	
	open (text,'www','top=50,left=50,width=700, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
}
function LanzaEve(valor) 
{ 	
	document.data.pagina.value='eventos/xeventos'; 
	text='lanza.php?pagina=eventos/xeventos&dato_aux='+valor; 	
	open (text,'www','top=50,left=50,width=700, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
}
function LanzaEnl(valor) 
{ 	
	document.data.pagina.value='enlaces/xenlaces'; 
	text='lanza.php?pagina=enlaces/xenlaces&dato_aux='+valor; 	
	open (text,'www','top=50,left=50,width=700, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
}
function LanzaArt(valor) 
{ 	
	document.data.pagina.value='articulos/xarticulos'; 
	text='lanza.php?pagina=articulos/xarticulos&dato_aux='+valor; 	
	open (text,'www','top=50,left=50,width=700, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
}
function LanzaFaq(valor) 
{
	text='lanza.php?pagina=faq/xfaq&op=con&id_faq='+valor; 	
	open (text,'www','top=50,left=100,width=600, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
} 
function AbrirFoto(valor)
{
	texto='./lanza.php?autom=0&pagina=cat_fotos/xfotos&dato_aux='+valor;
	open(texto,'index','width=600, height=600, toolbar=0, scrollbars=0');
}
function AbrirCate(valor)
{
	document.data.inicial.value=0;
	document.data.pagina.value='cat_fotos/ind_fotos'; 
	document.data.id_categoria.value=valor;
	document.data.submit();
	PonEspera();
}
////


function oculta() {
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
 if (ns4) document.ventana.visibility = "hide"
 else if (ie4) ventana.style.visibility = "hidden"
}


function muestra() {
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
 if (ns4) document.ventana.visibility = "show"
 else if (ie4) ventana.style.visibility = "visible"
}
function VerVideo()//paginas ajenas
{
		open("./datos2/video_presentacion.htm","index","width=200; height=250; toolbar=0; scrollbars=0,location=0,status=0,menubar=0,resizable=1");
		//window.print();
}
function AbrirVentana(URL)
{
	open (URL,'www2','top=50,left=100,width=600, height=450, toolbar=0, scrollbars=1,location=0,status=0,menubar=0,resizable=1'); 
}
function Traducir(valor)
{
	location.replace(valor);
}

