/**********************************************************************/
function selFila (fila)
{
	var aFilas = document.getElementsByTagName("tr");
	for (j=0;j<aFilas.length;j++)
	{
	  aFilas[j].className = "";
	}
	
	fila.className = "tdresultadoSel";
}
/**************************************************************

**************************************************************/
function overFila (fila)
{
    if (fila.className!="tdresultadoSel")
	{
		var aFilas = document.getElementsByTagName("tr");
		for (j=0;j<aFilas.length;j++)
		{
		 	if (aFilas[j].className=="tdresultadoOver")
			{
			   if (j % 2 ==0)
			   {
				  aFilas[j].className = "";
			   }
		  	   else
			   {
				   aFilas[j].className = "";
			   }
			   break;
			}
		}
		
		fila.className = "tdresultadoOver";
	}
}
/**************************************************************

**************************************************************/
function outFila (fila)
{
    if (fila.className!="tdresultadoSel")
	{
		var aFilas = document.getElementsByTagName("tr");
		for (j=0;j<aFilas.length;j++)
		{
		 	if (aFilas[j].className=="out")
			{
				  aFilas[j].className = "";
			   break;
			}
		}
		fila.className = "out";
	}
}
/**************************************************************

**************************************************************/
function VerComentarios(obj)
{
	if (document.getElementById(obj).style.display=='none')
	{document.getElementById(obj).style.display='block';}
	else
	{document.getElementById(obj).style.display='none';}
}
function AddComentarios(obj)
{
	if (document.getElementById(obj).style.display=='none')
	{document.getElementById(obj).style.display='block';}
	else
	{document.getElementById(obj).style.display='none';}

}
function abrirModal(url)
{

  if (window.showModalDialog) {
	// Estas características se deben definir en función de las necesidades
	/*
	var caracteristicas = "center:yes;edge:raised;resizable:no;scroll:yes;status:no;dialogWidth:1000px;dialogHeight:400px";
	window.showModalDialog(url, "modal", caracteristicas);*/
	
	//var caracteristicas = "height=300px, width=800px, toolbar=0, directories=0," +   
	//"status=0, linemenubar=0, modal=yes, left=100, top=100, dialog=yes," +       
	//"resizable=0, scrollbars=1";	
	var caracteristicas = "height=768px, width=1024px, toolbar=0, directories=0," +   
	"status=0, linemenubar=0, modal=yes, left=0, top=0, dialog=yes," +       
	"scrollbars=1";	
  }
  else
  {
	// Estas características se deben definir en función de las necesidades,
	// salvo las que están en negrita, que debemos dejar
	var caracteristicas = "height=300px, width=1000px, toolbar=0, directories=0," +   
	"status=0, linemenubar=0, modal=yes, left=100, top=100, dialog=yes," +       
	"resizable=0, scrollbars=1";
  }

	// Estas características se deben definir en función de las necesidades,
	// salvo las que están en negrita, que debemos dejar
	window.open(url,'',caracteristicas);
}	
function VerLinks(obj)
{
	if (document.getElementById(obj).style.display=='none')
	{document.getElementById(obj).style.display='block';}
	else
	{document.getElementById(obj).style.display='none';}
}
function VerMp3(obj)
{
	if (document.getElementById(obj).style.display=='none')
	{document.getElementById(obj).style.display='block';}
	else
	{document.getElementById(obj).style.display='none';}
}
/*Funciones de los eventos onclick*/
function Evento_Click_Establecer(FunID,Idioma)
{
	var DiaActu=new Date();
	var dia = DiaActu.getDay() 
	var mes = DiaActu.getMonth() 
	var ano = DiaActu.getYear() 
	var hora = DiaActu.getHours() 
	var minuto = DiaActu.getMinutes() 
	var segundo = DiaActu.getSeconds() 
	
	var Fecha = dia+'/'+mes+'/'+ano+'-'+hora+':'+minuto+':'+segundo;
	
	switch (FunID) {
	case 1:	// Traduce la página a castellano
		top.window.location.href = "Index.php?CargaInicial=si&Idioma=1&Dia="+Fecha;
	break;
	case 2:	// Traduce la página a euskera
		top.window.location.href = "Index.php?CargaInicial=si&Idioma=2&Dia="+Fecha;
	break;
	case 3:	// Traduce la página a inglés
		top.window.location.href = "Index.php?CargaInicial=si&Idioma=3&Dia="+Fecha;
	break;
	case 4:	// Abre la Galería de Fotos
		//top.window.location.href = "Validar_Gestor/Default.php";
		
		//top.window.location.href = "Archivos/Publicos/Fotos/EasyGallery.php";
		abrirModal("Archivos/Publicos/Fotos/EasyGallery.php?=Fotos");
		/*
		var galeria = "<a href=\"Archivos/Publicos/Fotos/EasyGallery.php?f=20070323_Nomads\" title=\"Mostrar Imágenes\" target='_blank'><img src=\"Imagenes/save.png\" style=\"cursor:pointer; display:inline;margin-right:5px\" id=\"GalIMG_Mostrar\" style=\"cursor:pointer;\"/></a></td>";

		window.open(url,'',galeria);
		*/
		//top.window.location.href = "Archivos/Publicos/Fotos/Index.php";
		
	break;
	case 5: // Abre el correo electrónico
		//mailto:nombre@dominio.com?subject=ejemplo:	
		abrirModal("mailto:elpintalabios@hotmail.com?subject= &body=");
	break;	
	case 6: // Hoja de estilos Rojo
		top.window.location.href = "Index.php?CargaInicial=si&Idioma="+Idioma+"&Dia="+Fecha+"&Css=1";
	break;
	case 7: // Hoja de estilos Azul turquesa
		//top.window.location.href = "Index.php?CargaInicial=si&Idioma="+Idioma+"&Dia="+Fecha+"&Css=2";
		activarCSS("azul");
	break;
	case 8: // Escuchar el Programa en Directo
		//window.open("http://212.48.126.146:8560/listen.pls");
		window.open("http://www.halabedi.org/modules/mod_ngs_shoutcast/dualplaylist.php?priip=94.23.42.61&priport=8022&secip=94.23.42.61&secport=8022&format=PLS");
		
		//echo "<a href='http://http://212.48.126.146:8560/listen.pls' target='_blank'></a>";
		//<a href="http://212.48.126.146:8560/listen.pls">
	break;
	case 9:	// Abre el Gestor
		abrirModal("_Gestor/elpintal_ElPintalabios/VA_DATOS_ListaDeReproduccion.php");	
	break;
	}		
}
/*Limpia ka capa de busqueda de las plantillas*/
function Plantilla_Bus_Limpia()
{
	// SE controla que exista la caja
	if (document.getElementById('MenBusLibreLit')!=null)
	{
		document.getElementById('MenBusLibreLit').value="";
	}

	// SE controla que exista la caja
	if (document.getElementById('MenBusListaLit')!=null)
	{
		document.getElementById('MenBusListaLit').value="";		
	}


}
function MP3_Reproducir(archivo)
{ 
		content = '<object type="application/x-shockwave-flash" data="Reproductor/dewplayer.swf?autoplay=1&son=Archivos/Publicos/Varios/'+archivo+'"  width="200" height="20"><param name="movie" value="Reproductor/dewplayer.swf?autoplay=1&son=Archivos/Publicos/Varios/'+archivo+'" /><param name="wmode" value="transparent" /></object>';
	
		document.getElementById("tdPlayer").innerHTML = content;
}		
function mostrarOculto (idfila)
{
		document.getElementById("texto"+idfila).style.display="block";
}
function mostrarnue(enla)
{ 
	obj = document.getElementById('oculto'+enla); 
	obj.style.visibility = (obj.style.visibility == 'hidden') ? 'visible' : 'hidden'; 
} 
function mostrarnuenue(enla , etik)
{ 
  obj = document.getElementById(etik); 
  obj.style.display = (obj.style.display == 'block') ? 'none' : 'block'; 
  enla.innerHTML = (enla.innerHTML == '[-]') ? '[+]' : '[-]'; 
}
function mostrarcapa(capa){
  var obj = document.getElementById(capa)
  if(obj.style.display == "block") obj.style.display = "none"
  else obj.style.display = "block"
}

var visto = null;
function vercapa(num) {
  obj = document.getElementById(num);
  obj.style.display = (obj==visto) ? 'none' : 'block';
  if (visto != null)
    visto.style.display = 'none';
  visto = (obj==visto) ? null : obj;
}
var h=0;
var pepe;
function expandir(ide)
{
  obj=document.getElementById(ide);
  obj.style.display='block'
  for (i=0; i<50; i++)
  capa=ide;
  pepe=setInterval('agranda(capa)',10);
}
function agranda(obj) {
  obj=document.getElementById(obj);
  h++;
  if (h>50) clearInterval(pepe);
  obj.style.height = h+'px';
}
function verocultarTexto(href) {
   var c = href.nextSibling;
   if(c.style.display == 'none'){
      c.style.display = 'block';
   }else{
      c.style.display = 'none';
   }
   return false;
}
function verocultar(Obj_Corto, Obj_Largo, Obj_Img) {
	var vObj_Corto;
	var vObj_Largo;
	var vObj_Img;
	vObj_Corto = document.getElementById(Obj_Corto); 	
	vObj_Largo = document.getElementById(Obj_Largo); 	
	vObj_Img = document.getElementById(Obj_Img); 	
   if(vObj_Corto.style.display == 'none'){
      vObj_Corto.style.display = 'block';
	  vObj_Largo.style.display = 'none';
   }else{
      vObj_Corto.style.display = 'none';
	  vObj_Largo.style.display = 'block';
   }


   return false;
}