if (self != top) { top.location.href = self.location.href }

function Ir(canal) {
parent.top.location = 'http://www.redaragon.com/' + canal;
	} 
	
function Ir2(canal) {
parent.top.location = canal;
	} 

 function IrNumero(numero,tipo)
{
	parent.top.location = 'default.asp?numero=' + numero ;
} 
	
function openw(foto,ancho,alto)
	{ window.open(foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width="+ancho+",height="+alto)
}

function openw2(foto,ancho,alto,scrol)
	{ window.open(foto,"IWIN","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrol+",resizable=no,copyhistory=no,width="+ancho+",height="+alto)
}
// AUMENTAR Y REDUCIR TAMAŅO DE FUENTES
var objPage = null; 

// tamaņo en .em de la fuente gral. del cuerpo (se define tambien en la hoja de estilos).
var actual=0.7;

		function AumentarFuente(pageName) { 
			if (detect('msie')) {
					objPage=document.getElementById(pageName); 
					actual=actual+0.05;
					objPage.style.font=actual+"em;"
			}else{
					actual=actual+0.05;
					document.getElementById(pageName).style.fontSize=actual+"em;"
			}
		} 
		function ReducirFuente(pageName) { 
			if (detect('msie')) {		
					objPage=document.getElementById(pageName); 
					actual=actual-0.05;
					objPage.style.font=actual+"em;"
			}else{
					actual=actual-0.05;
					document.getElementById(pageName).style.fontSize=actual+"em;"			
			}			
		} 

	
function validate_busqueda() {
  	validity = true; // asume valido
        var result1=document.busqueda.searchstring.value
        if (result1==0){
        alert("Tienes que buscar algo!!");validity = false;}
  	return validity
}

function cambiarfondo(Elemento) {
	document.getElementById('Boton'+Elemento).style.backgroundColor='#4a70ae';
	document.getElementById('Boton'+Elemento).style.color='#FFFFFF';
	document.getElementById('Boton'+Elemento).style.border='#C65200';
	document.getElementById('Boton'+Elemento).style.cursor='default';
	document.getElementById('Boton'+Elemento).style.paddingLeft='18px';
	document.getElementById('Boton'+Elemento).style.paddingRight='18px';
	document.getElementById('Boton'+Elemento).style.textDecoration='none';			
	document.getElementById('Boton'+Elemento).style.fontSize='1.15em';				
	document.getElementById('Boton'+Elemento).style.fontWeight='bold';
	document.getElementById('Enlace'+Elemento).style.color='#FFFFFF';	
}

function OcultarCapa(IdCapa,idBoton) {
	document.getElementById(IdCapa).style.display='none';
	document.getElementById("Ocultar"+idBoton).style.display='none';
	document.getElementById('Mostrar'+idBoton).style.display='block';	
}
function MostrarCapa(IdCapa,idBoton) {
	document.getElementById(IdCapa).style.display='block';
	document.getElementById('Ocultar'+idBoton).style.display='block';
	document.getElementById('Mostrar'+idBoton).style.display='none';		
}	

function MostrarTextoCompletoComarcas() {
	document.getElementById('Texto').style.display='none';
	document.getElementById('Texto2').style.display='block';
	document.getElementById('MostrarTexto').style.display='none';
	document.getElementById('OcultarTexto').style.display='block';		
}

function OcultarTextoCompletoComarcas() {
	document.getElementById('Texto2').style.display='none';
	document.getElementById('Texto').style.display='block';
	document.getElementById('MostrarTexto').style.display='block';
	document.getElementById('OcultarTexto').style.display='none';		
}

function setPage( t_intPage )
{
	document.getElementById('InputHiddenCurrentPage').value = t_intPage;
	document.getElementById('FormMain').submit();
}

/* funcion que oculta o muestra el mapa en los listados de turismo */
function MostrarOcultarMapa () {
		document.getElementById('mapG').style.display='block';
		document.getElementById('ListadoDeRecursosTuristicos').style.display='none';		
}

function MostrarOcultarListado () {
		document.getElementById('mapG').style.display='none';		
		document.getElementById('ListadoDeRecursosTuristicos').style.display='block';
}

/*
	FUNCION PARA PESTA&Ntilde;AS DE GUIA DE EMPRESAS
	ABEL 19/10/2007

*/


	function MostrarOcultarPestannaGuiaEmpresas (IDPESTANNA,IDOPCION) {
				document.getElementById('ContenidoPestannaFicha1').style.display='none';
				document.getElementById('ContenidoPestannaFicha2').style.display='none';
				if (document.getElementById('ContenidoPestannaFicha3')) {
					document.getElementById('ContenidoPestannaFicha3').style.display='none';
				}		
				if (document.getElementById('ContenidoPestannaFicha4')) {
					document.getElementById('ContenidoPestannaFicha4').style.display='none';
				}								
				document.getElementById(IDPESTANNA).style.display='block';
				document.getElementById('OpcionPest1').className ='Inactiva';
				document.getElementById('OpcionPest2').className ='Inactiva';		
				if (document.getElementById('OpcionPest3')) {
					document.getElementById('OpcionPest3').className ='Inactiva';
				}
				if (document.getElementById('OpcionPest4')) {
					document.getElementById('OpcionPest4').className ='Inactiva';
				}				
				document.getElementById(IDOPCION).className='Activa';		
	}
	
	
/*
	FUNCION QUE MUESTRA Y OCULTA LAS PESTA&Ntilde;AS DE DATOS DE USUARIOS
*/	


		function ActivarPestannaDatosUsuarioComentarios(IdActivo,CajaActiva) {
				document.getElementById('Pestanna2').className="Inactivo";
				document.getElementById('CajaUltimosMensajes').style.display="none";					
				document.getElementById(CajaActiva).style.display="block";								
				document.getElementById(IdActivo).className="Activo";
		}
		
		function ActivarPestannaDatosUsuarioMensajes(IdActivo,CajaActiva) {
				document.getElementById('Pestanna1').className="Inactivo";
				document.getElementById('CajaUltimosComentarios').style.display="none";
				document.getElementById(CajaActiva).style.display="block";								
				document.getElementById(IdActivo).className="Activo";
		}		
	
		function ActivarPestannaDatos2Usuario() {
				document.getElementById('CajaUltimosMensajes').style.display="block";								
				document.getElementById('Pestanna2').className="Activo";
		}
		
		
/*
	FUNCION QUE ACTIVA UNA PESTAŅA: COLOCA EN EL CLASS=ACTIVO
*/	


		function ActivarOpcion(IdActivo) {
				document.getElementById(IdActivo).className="Activo";
		}
		
		
		function MostrarTextos(IdAMostrar) {
			document.getElementById(IdAMostrar).style.display="block";
		}
		
		function OcultarTextos(IdAMostrar) {
			document.getElementById(IdAMostrar).style.display="none";
		}
		
		
/*-------------------------------------------------------------------------------------*/
/*UTILES GENERALES													   				   */
/*-------------------------------------------------------------------------------------*/
function validarFloat(valor){
	if(valor!=0){
		valor = parseFloat(valor);
		if (isNaN(valor)) {
			return "";
		}
	}
	return valor;
}
function Redondear(x, places){
	return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function trim(cadena){
	for(i=0; i<cadena.length; ){
		if(cadena.charAt(i)==" "){
			cadena=cadena.substring(i+1, cadena.length);
		}else{
			break;
		}
	}
	for(i=cadena.length-1; i>=0; i=cadena.length-1){
		if(cadena.charAt(i)==" "){
			cadena=cadena.substring(0,i);
		}else{
			break;
		}
	}
	return cadena;
}		
