	/*************************************************************************
		Funcións do menú xeral (menú da esquerda)
	*************************************************************************/

	function muestra(BOT){
		var ESTADO = document.getElementById(BOT).style.display;
		document.getElementById('TVG').style.display = 'none';
		document.getElementById('RAG').style.display = 'none';
		document.getElementById('CIA').style.display = 'none';
		document.getElementById('COM').style.display = 'none';
		document.getElementById('COMU').style.display = 'none';
		
		document.getElementById('menuBotonTVG').style.color = '#a7a9ac';
		document.getElementById('menuBotonRG').style.color = '#a7a9ac';
		document.getElementById('menuBotonCia').style.color = '#a7a9ac';
		document.getElementById('menuBotonCom').style.color = '#a7a9ac';
		document.getElementById('menuBotonComu').style.color = '#a7a9ac';
		
		if (ESTADO == 'none' || ESTADO == ''){
			document.getElementById(BOT).style.display = 'block';
			switch(BOT){
				case 'TVG':
					document.getElementById('menuBotonTVG').style.color = '#00b4bd';
					break;    
				case 'RAG':
					document.getElementById('menuBotonRG').style.color = '#178cff';
					break;
				case 'CIA':
					document.getElementById('menuBotonCia').style.color = '#90b9bd';
					break;
				case 'COM':
					document.getElementById('menuBotonCom').style.color = '#f57800';
					break;
				case 'COMU':
					document.getElementById('menuBotonComu').style.color = '#e5cc00';
					break;
			}
		}
		if (ESTADO == 'block'){
			document.getElementById(BOT).style.display = 'none';
		}
	}
	
	function muestra_sub(BOT){
		document.getElementById(BOT).style.display = 'block';
	}
	
	function borra(Tipos){
		var Tipos_array=Tipos.split("_");
		 for (i=0;i<Tipos_array.length-1;i++){
		  document.getElementById(Tipos_array[i]).style.display= 'none';
		 }
	}

	function iluminaBotonMenu(id){
		document.getElementById('menuBotonTVG').style.color = '#a7a9ac';
		document.getElementById('menuBotonRG').style.color = '#a7a9ac';
		document.getElementById('menuBotonCia').style.color = '#a7a9ac';
		document.getElementById('menuBotonCom').style.color = '#a7a9ac';
		document.getElementById('menuBotonComu').style.color = '#a7a9ac';
		elemento = document.getElementById(id);
		switch(id){
			case 'menuBotonTVG':
				elemento.style.color = '#00b4bd';
				break;    
			case 'menuBotonRG':
				elemento.style.color = '#178cff';
				break;
			case 'menuBotonCia':
				elemento.style.color = '#90b9bd';
				break;
			case 'menuBotonCom':
				elemento.style.color = '#f57800';
				break;
			case 'menuBotonComu':
				elemento.style.color = '#e5cc00';
				break;
		}
	}
	
	function apagaBotonMenu(id){
		elemento = document.getElementById(id);
		switch(id){
			case 'menuBotonTVG':
				if (document.getElementById('TVG').style.display != 'block')
					elemento.style.color = '#a7a9ac';
				break;    
			case 'menuBotonRG':
				if (document.getElementById('RAG').style.display != 'block')
					elemento.style.color = '#a7a9ac';
				break;
			case 'menuBotonCia':
				if (document.getElementById('CIA').style.display != 'block')
					elemento.style.color = '#a7a9ac';
				break;
			case 'menuBotonCom':
				if (document.getElementById('COM').style.display != 'block')
					elemento.style.color = '#a7a9ac';
				break;
			case 'menuBotonComu':
				if (document.getElementById('COMU').style.display != 'block')
					elemento.style.color = '#a7a9ac';
				break;
			}

	}
	/*************************************************************************
		This code is from Dynamic Web Coding at www.dyn-web.com
		Copyright 2001-5 by Sharon Paine 
		See Terms of Use at www.dyn-web.com/bus/terms.html
		regarding conditions under which you may use this code.
		This notice must be retained in the code as is!
	*************************************************************************/
	
	function initScroller() {
	  var scr1 = new dw_scroller('cnt', 374, 55, 16, "v", false);
	  scr1.setTiming(100, 3000);
	}
	
	
	/*************************************************************************
		Funcións para abrir ventás con diversos contidos
	*************************************************************************/
	var segundaVentana = null;
	
	function AbreReproductor(varia1,varia2){
		if (segundaVentana == null || segundaVentana.closed)
			segundaVentana = open(varia1,varia2,'top=171,left=171,toolbar=no,menubar=no,directories=no,height=466,WIDTH=842, resizable=no, scrollbars=yes');
		else
			segundaVentana.focus();
	}
	
	function AbreReproductorCRTVG(emi,corte,hora,canle){
		if (segundaVentana == null || segundaVentana.closed)
			segundaVentana = window.open('http://agalega.info/videos/?emi='+emi+'&corte='+corte+'&hora='+hora+'&canle='+canle+'','ReproductorCRTVG','toolbar=no,menubar=no,directories=no,resizable=no,scrollbars=no,height=694,width=968,top=10,left=10');
		else
			segundaVentana.focus();
	}
		
	function AbreVentana(varia1,varia2){
		if (segundaVentana == null || segundaVentana.closed)
			segundaVentana = open(varia1,varia2,'top=171,left=171,toolbar=no,menubar=no,directories=no,height=415,WIDTH=575, resizable=no, scrollbars=yes');
		else
			segundaVentana.focus();
	}

	function AbreDic(varia1,varia2){
		if (segundaVentana == null || segundaVentana.closed)
			segundaVentana = open(varia1,varia2,'top=171,left=171,toolbar=no,menubar=no,directories=no,height=515,WIDTH=730, resizable=no, scrollbars=no');
		else
			segundaVentana.focus();
	}
	
	function abre2aVenta(url, name, features){
		if (segundaVentana == null || segundaVentana.closed)
			segundaVentana = open(url, name, features);
		else
			segundaVentana.focus();
	}
	
	/*************************************************************************
		Funcións para darlle funcionalidade ao reproductor de wmv na portada
	*************************************************************************/
			
	function pausa(){
		document.video.Pause();
	}
	function stop(){
		document.video.Stop();
		document.video.AutoStart= false
		document.video.CurrentPosition = 0 
	}
	function play(){
		document.video.AutoStart= true
		document.video.mute= false
		document.video.Play();
	}
	function mute(){
		document.video.mute= true
		document.video.Play();
	}	
	
	
	/*************************************************************************
		Funcións usadas polos layer pop-ups das promocións da crtvg
	*************************************************************************/

	function pop (URL){ 
		window.open(URL,"ventana1","width=700, height=200, scrollbars=no, menubar=no, location=no, resizable=no") 
	} 
	
	function cerrarPubliLayer(){
		if (document.getElementById("publi").style.display != "none")
			document.getElementById("publi").style.display='none';
	}
	
	function cerrarPubliLayert(){
		setTimeout("cerrarPubliLayer()",31500);
	}