function HomePage(a,url){

	
	if (navigator.appVersion.indexOf("MSIE") != -1){
	
		a.style.behavior='url(#default#homepage)';a.setHomePage(url);
 	}
 	 	
}

function addBookmark(titulo, url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(titulo, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite(url, titulo);
	} else if( window.opera && window.print ) {
		return true;
	}
}

function popupEnc(url){
	
	var width=575;
	var height=450;
	
	var anchoPantalla=screen.width;
	var altoPantalla=screen.height;
	var x=(anchoPantalla - parseFloat(width))/2;
	var y=(altoPantalla - parseFloat(height))/2;
	
	
	window.open(url,'','width='+width+',height='+height+',top='+y+',left='+x+',toolbar=no,directories=no,resizable=no,location=no,status=no,menubar=no,border=no,scrollbars=yes,dependent=yes');
	
}

function popupDiv(id,logo,imprimir,top,left,width,height,url){
	//id= es el id galeria
		
	var anchoPantalla=screen.width;
	var altoPantalla=screen.height;
	var x=(anchoPantalla - parseFloat(width))/2;
	var y=(altoPantalla - parseFloat(height))/2;
	
	if (url=='seccion'){
		window.open('popup_recomendar.php?id_seccion='+id,'','width='+width+',height='+height+',top='+y+',left='+x+',toolbar=no,directories=no,resizable=no,location=no,status=no,menubar=no,border=no');
	}
	else{
		window.open(url+id,'','width='+width+',height='+height+',top='+y+',left='+x+',toolbar=no,directories=no,resizable=no,location=no,status=no,menubar=no,border=no');
	}
	
	
}



function CargarImagen(newImage,newTitulo,orden){
	var width_img="107";
	var height_img="62";
	
	var img_0="";
	var img_1="";
	var img_2="";
	var img_3="";
	
	var Ximg_0=document.getElementById('img_0').getAttribute("src");
	var Ximg_0_titulo=document.getElementById('tituloDest').value;
	
	img_0=document.getElementById('img_0');
	img_1=document.getElementById('img_1');
	img_2=document.getElementById('img_2');
	img_3=document.getElementById('img_3');
		
	eval('img_'+orden+'.setAttribute("src","'+Ximg_0+'")');
	eval('img_'+orden+'.setAttribute("width","'+width_img+'")');
	
	rotado ='img_'+orden+'.onclick=function() {CargarImagen(\''+Ximg_0+'\',\''+Ximg_0_titulo+'\',\''+orden+'\');}';
		
	eval (rotado);
	
	var imagen = document.GaleriaFoto;
	document.getElementById('TituloImagen').innerHTML = newTitulo;
	document.getElementById('tituloDest').value=newTitulo;
	imagen.src = newImage;	
}

//objetos
function noticia(id,titulo,copete,imagen,enlace,id_imagen){
	this.id=id;
	this.titulo=titulo;
	this.copete=copete;
	this.imagen=imagen
	this.enlace=enlace
	this.id_imagen=id_imagen
}

function videos(url,titulo,copete,preview,id_preview,video){
	this.url=url;
	this.titulo=titulo;
	this.copete=copete;
	this.preview=preview;
	this.id_preview=id_preview;
	this.video=video;
	
}

function mapaGoogleHome(id_seccion,lat_a,lat_b,zoom,tipo){
	this.id_seccion=id_seccion;
	this.lat_a=lat_a;
	this.lat_b=lat_b;
	this.zoom=zoom;
	this.tipo=tipo;
}

function contTurismo(id,titulo,copete,imagen,enlace){
	this.id=id;
	this.titulo=titulo;
	this.copete=copete;
	this.imagen=imagen;
	this.enlace=enlace;
}

function agenda(id,imagen,titulo,lugar,fecha,copete){
	this.id=id;
	this.titulo=titulo;
	this.copete=copete;
	this.imagen=imagen;
	this.lugar=lugar;
	this.fecha=fecha;
}

function prensa(id,titulo,copete,imagen,enlace,id_imagen){
	this.id=id;
	this.titulo=titulo;
	this.copete=copete;
	this.imagen=imagen
	this.enlace=enlace
	this.id_imagen=id_imagen
}


//fin objetos
function mostrar_modulo1(a){
	document.getElementById("bajada_pr").innerHTML='<span class="titulo"><a href="'+rotativos[a].enlace+'"><b>'+rotativos[a].titulo+'</b></a></span><span><a href="'+rotativos[a].enlace+'">'+rotativos[a].copete+'</a></span>';
	
	if (rotativos[a].id_imagen==0 || rotativos[a].id_imagen==""){
		document.getElementById("img_pr").innerHTML ='';	
	}else {
		document.getElementById("img_pr").innerHTML ='<a href="'+rotativos[a].enlace+'"><img src="'+rotativos[a].imagen+'" alt="'+rotativos[a].titulo+'" title="'+rotativos[a].titulo+'" /></a>'
	
	}
	
	for(i=0; i<rotativos.length; i++){
		document.getElementById("_rot_mod1_"+i).className="";
	}
	
	document.getElementById("_rot_mod1_"+a).className="activo";
}


function cambiar_modulo3(modo){
	
	if (modo=='+'){
		//clearInterval(proc_modulo3);
		b=(prensas.length-1>b)?b+1:0;
	}
	
	if (modo=='-'){
		//clearInterval(proc_modulo3);
		b=(b>0)?b-1:prensas.length - 1;
	}
	
	if (modo==0){
		clearInterval(proc_modulo3);
	}
	
	mostrar_modulo3(b);
	
}

function mostrar_modulo3(a){
	
		document.getElementById("modulo3_titulo").innerHTML='<h2><a href="'+prensas[a].enlace+'">'+prensas[a].titulo+'</a></h2>';
		document.getElementById("modulo3_copete").innerHTML='<a href="'+prensas[a].enlace+'" class="trebuchet_11_gris">'+prensas[a].copete+'</a>';
		
		if (prensas[a].id_imagen==0 || prensas[a].id_imagen==""){
			document.getElementById('modulo3_img').style.backgroundImage="url('')";
		}else {
			document.getElementById('modulo3_img').style.backgroundImage="url('"+prensas[a].imagen+"')";
		}
}

function habilitar_solapa_not(modo){

	if (modo==1){
	
	document.getElementById('caja_noticias_mas_vistas').style.display='inline'; 
	document.getElementById('caja_noticias_ultimas').style.display='none';
	
	
	document.getElementById("solapa_1_not").className="act";
	document.getElementById("solapa_2_not").className="desact";
	
	
	}
	
	if(modo==2){
			
	document.getElementById('caja_noticias_mas_vistas').style.display='none'; 
	document.getElementById('caja_noticias_ultimas').style.display='inline';
	
	
	document.getElementById("solapa_1_not").className="desact";
	document.getElementById("solapa_2_not").className="act";
	
	
	}
	
}

function verVideoHomeWide(objeto,url,video,preview,titulo,copete){
	var VS = {
		movie:		"includes/flvplayer/flvplayer.swf",
		wmode:		"transparent",
		width:		"360",
		height:		"217",
		majorversion:"7",
		build:		"0",
		bgcolor:	"#FFFFFF",
		flashvars:	"file=/"+video+"&showdigits=true&image="+preview+"&showicons=true&volume=100"
	}
	UFO.create(VS, "video_princ_"+objeto);
	document.getElementById('titulo_princ_'+objeto).innerHTML = '<h2><a href="'+url+'">'+titulo+'</a></h2>';
	document.getElementById('copete_princ_'+objeto).innerHTML = '<a href="'+url+'">'+copete+'</a>';
	
	
}

function verVideoHome(objeto,video,preview){
	
	var VS1 = {
		movie:		"includes/flvplayer/flvplayer.swf",
		wmode:		"transparent",
		width:		"316",
		height:		"266",
		majorversion:"7",
		build:		"0",
		bgcolor:	"#FFFFFF",
		flashvars:	"file=/"+video+"&showdigits=true&image="+preview+"&showicons=true&volume=100"
	}
	UFO.create(VS1, objeto);
	
}

function habilitar_thumbs_vivo(objeto,totales,titulo){
	
	
	document.getElementById('prevTit_princ_1').innerHTML = titulo;
	
	for (i=0; i<totales; i++){
		document.getElementById('solapa_videos_vivo_'+i).className="";
	}
	
	document.getElementById('solapa_videos_vivo_'+objeto).className="destacado";
}

function modulo10_anterior(){
	
	if (indexModulo10 > 0){
		indexModulo10 = indexModulo10 - 1;
	}else {
		indexModulo10=(vModulo10.length - 1);
	}
	
	document.getElementById('modulo10_titulo').innerHTML='<a href="'+vModulo10[indexModulo10].enlace+'">'+vModulo10[indexModulo10].titulo+'</a>';
	document.getElementById('modulo10_imagen').style.backgroundImage="url('"+vModulo10[indexModulo10].imagen+"')";
	

}

function modulo10_siguiente(){
	
	if (indexModulo10 < vModulo10.length -1){
		indexModulo10 = indexModulo10 + 1;
	}else {
		indexModulo10=0;
	}
	//alert (vModulo10[indexModulo10].imagen);
	document.getElementById('modulo10_titulo').innerHTML='<a href="'+vModulo10[indexModulo10].enlace+'">'+vModulo10[indexModulo10].titulo+'</a>';
	document.getElementById('modulo10_imagen').style.backgroundImage="url('"+vModulo10[indexModulo10].imagen+"')";
	
}

function modulo9_cambiar(imagen,caja,totales){

	for (i=0; i<totales; i++){
		document.getElementById('caja_especiales_'+i).className = "";
	}
	
	document.getElementById('caja_especiales_'+caja).className = "activo";
	document.getElementById('id_imagen').src = imagen;
}


function modulo4_cambiar(modo){
	
	if (modo=="+"){
		
		if (indexModulo4 < vModulo4.length -1){
			indexModulo4 = indexModulo4 + 1;
		}else {
			indexModulo4=0;
		}
		
	}else {
		
		if (indexModulo4 > 0){
		indexModulo4 = indexModulo4 - 1;
		}else {
			indexModulo4=(vModulo4.length - 1);
		}
	
	}
	if (indexModulo4==0){
	document.getElementById('modulo4_titulo').innerHTML='<h2><a href="agenda.php">'+vModulo4[indexModulo4].titulo+'</a></h2>';
	document.getElementById('modulo4_lugar').innerHTML='<a href="agenda.php">'+vModulo4[indexModulo4].lugar+'</a>';
	document.getElementById('modulo4_fecha').innerHTML='<a href="agenda.php">'+vModulo4[indexModulo4].fecha+'</a>';
	document.getElementById('modulo4_copete').innerHTML='<a href="agenda.php" class="trebuchet_11_gris">'+vModulo4[indexModulo4].copete+'</a>';
	document.getElementById('modulo4_image').style.backgroundImage="url('"+vModulo4[indexModulo4].imagen+"')";
	}else{
	document.getElementById('modulo4_titulo').innerHTML='<h2><a href="buscador_resultado_agenda.php?id='+vModulo4[indexModulo4].id+'">'+vModulo4[indexModulo4].titulo+'</a></h2>';
	document.getElementById('modulo4_lugar').innerHTML='<a href="buscador_resultado_agenda.php?id='+vModulo4[indexModulo4].id+'">'+vModulo4[indexModulo4].lugar+'</a>';
	document.getElementById('modulo4_fecha').innerHTML='<a href="buscador_resultado_agenda.php?id='+vModulo4[indexModulo4].id+'">'+vModulo4[indexModulo4].fecha+'</a>';
	document.getElementById('modulo4_copete').innerHTML='<a href="buscador_resultado_agenda.php?id='+vModulo4[indexModulo4].id+'" class="trebuchet_11_gris">'+vModulo4[indexModulo4].copete+'</a>';
	document.getElementById('modulo4_image').style.backgroundImage="url('"+vModulo4[indexModulo4].imagen+"')";
	}
	
	
	
}

function verVideoHomeMod_cine(objeto,video,preview){
	var VS = {
		movie:		"includes/flvplayer/flvplayer.swf",
		wmode:		"transparent",
		width:		"330",
		height:		"204",
		majorversion:"7",
		build:		"0",
		bgcolor:	"#FFFFFF",
		flashvars:	"file="+video+"&showdigits=true&image="+preview+"&showicons=true&volume=100"
	}
	UFO.create(VS, objeto);
	
	
}