/***archivos generales en javascript**/

function lanzarurl(url,ancho,alto) {

window.open(url,"laventana","directories=no,location=no,toolbar=no,resizable=no,scrollbars=yes,width=" + ancho + ",height=" + alto + ",menubar=no");
}
 
function lanzarurl2(url,ancho,alto) {
window.open(url,"laventana","directories=no,location=no,toolbar=no,resizable=no,scrollbars=no,width=" + ancho + ",height=" + alto + ",menubar=no");
}

function lanzarurl3(url,ancho,alto,numero) {
window.open(url,"laventana" + numero,"directories=no,location=no,toolbar=no,resizable=no,scrollbars=yes,width=" + ancho + ",height=" + alto + ",menubar=no");
}

function lanzarurl4(url,ancho,alto,numero) {
window.open(url,"laventana" + numero,"directories=no,location=no,toolbar=no,resizable=no,scrollbars=yes,width=" + ancho + ",height=" + alto + ",menubar=no");
}

/***funciones de la navegacion por pestaña**/
function init () {
	var tabs = document.getElementsByClassName('tabs');
	for (var i = 0; i < tabs.length; i++) {
		$(tabs[i].id).onclick = function () {
			getTabData(this.id);
		}
	}
}

function getTabData(id) {
	var url = '/paisonline/js/process.php';
	var rand   = Math.random(9999);
	var pars   = 'id=' + id + '&rand=' + rand;
	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
}

function showLoad () {
	$('load').style.display = 'block';
}

function showResponse (originalRequest) {
	var newData = originalRequest.responseText;
	$('load').style.display = 'none';
	$('content').innerHTML = newData;
}
/**fin funciones de navegacion por pestaña**/

/**DESAPARECIDOS*/
function muestra_imagen(){
document.write('<img src="/paisonline/desaparecidos/fotos/'+mis_imagenes[mi_imagen]+'" border="0">');
}


function init () {
	var tabs = document.getElementsByClassName('tabs');
	for (var i = 0; i < tabs.length; i++) {
		$(tabs[i].id).onclick = function () {
			getTabData(this.id);
	}
}
}
function getTabData(id) {
	var url = 'process.php';
	var rand = Math.random(9999);
	var pars = 'id=' + id + '&rand=' + rand;
	var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
}
function showLoad () {
	$('load').style.display = 'block';
}
function showResponse (originalRequest) {
	var newData = originalRequest.responseText;
	$('load').style.display = 'none';
	$('content').innerHTML = newData;
}


/***FUNCION PARA PAUTA 890X26**/


function nuevoAjax(){
	var xmlhttp=false;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (E) {
 			xmlhttp = false;
 		}
  	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
 		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}


function new_video(vid,pie) {
document.write('<table border=0 align=left cellpadding=0 cellspacing=0 width=275><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="275" height="226" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/videoflv/sinlogostop.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/sinlogostop.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#000000" width="275" height="226" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}

function new_video_home(vid,foto,pie) {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="321" height="263" id="id_satelite3" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/videoflv/conlogoyfoto.swf?video='+vid+'&foto='+foto+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/conlogoyfoto.swf?video='+vid+'&foto='+foto+'" loop="false" wmode="transparent" menu="false" quality="high" wmode="transparent" bgcolor="#000000" width="321" height="263" name="id_satelite3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
if (pie != "") {
document.write('<br/><font face="verdana" size="1"><span>'+pie+'</span></font>');
}
}


function new_video_especial(vid,foto,pie) {

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="538" height="296" id="id_satelite3" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value=/videoflv/conlogoyfoto_grandehome-v8.swf?video='+vid+'&foto='+foto+'"/>');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/conlogoyfoto_grandehome-v8.swf?video='+vid+'&foto='+foto+'" wmode="transparent" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#000000" width="538" height="296" name="id_satelite3" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
if (pie != "") {
document.write('<br/><font face="verdana" size="1"><span>'+pie+'</span></font>');
}

}

function new_video_homemultimedia(vid,pie) {
document.write('<table border=0 align=left cellpadding=0 cellspacing=0 width=235><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="200" height="140" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/videoflv/sinlogoplay.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/sinlogoplay.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#000000" width="200" height="140" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}


function video_90minutos(vid,pie) {
document.write('<table border=0 align=left cellpadding=0 cellspacing=0 width=176><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="176" height="155" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/paisonline/90minutos/90minhome.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/paisonline/90minutos/90minhome.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="176" height="155" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}


function video_90minutos_nuevo(vid,pie) {
document.write('<table border=0 align=left cellpadding=0 cellspacing=0 width=176><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="176" height="155" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/paisonline/90minutos/90minhome.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/paisonline/90minutos/90minhome.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="176" height="155" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}

function new_video1(vid,pie) {
document.write('<table border=0 align=left cellpadding=3 cellspacing=0 width=400><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="487" height="430" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/videoflv/conlogostop.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/conlogostop.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="487" height="430" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}

function new_audio(vid,pie) {
document.write('<table border=0 align=left cellpadding=3 cellspacing=0 width=280><tr><td>');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="213" height="23" id="id_satelite2" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="/videoflv/audioplay.swf?video='+vid+'" />');
document.write('<param name="loop" value="false" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="/videoflv/audioplay.swf?video='+vid+'" loop="false" menu="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="213" height="23" name="id_satelite2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object></td></tr>');
if (pie != "") {
document.write('<tr><td><font face="verdana" size="1">'+pie+'</font></td></tr>');
}
document.write('</table>');
}

/**VALIDAR FORMUALARIO OPINION**/

function validar_opinion(forma,capa){

if ((forma.nombre.value == "")||(forma.pais.value == "")||(forma.texto.value == "")) {
alert("Por favor Coloca los datos completos correctamente");
return;
}
if ((forma.email.value.indexOf("@") == -1)||(forma.email.value.indexOf(".") == -1)) {
alert("Por favor coloca tu email correctamente");
forma.email.focus();
return;
}
document.getElementById(capa).style.display="none";
subir_opinion("subir",forma.nombre.value,forma.email.value,forma.texto.value,forma.pais.value,forma.id_galeria.value);
//forma.submit();


}

/**ocultar_capa**/


function ocultar_capa(capa){
   
   document.getElementById(capa).style.display="none";

}



/***mostrar el formulario de opinion**/

function ver_opinion(capa){

    document.getElementById(capa).style.display="block";
 
}



//-->



/**FIN AUDIO**/

/** popups **/

function mandarGalleta2(nombre, valor, minutos) {
var exp = new Date();
exp.setTime(exp.getTime() + (1000 * 60 * minutos));
// 1000 * 60 * minutos = numero de minutos en los que expirara, 1440 minutos = 1 dia
document.cookie = nombre + "=" + escape(valor) + ";expires=" + exp;
}

function consultarGalleta(nombre) {
  var buscamos = nombre + "=";
  if (document.cookie.length > 0) {
    i = document.cookie.indexOf(buscamos);
    if (i != -1) {
      i += buscamos.length;
      j = document.cookie.indexOf(";", i);
      if (j == -1)
        j = document.cookie.length;
      return unescape(document.cookie.substring(i,j));
    }
  }
}

function ver_mas_ind()
{
	divResultado = document.getElementById('indicadores');

	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usamos el medoto POST
	//archivo que realizará la operacion
	ajax.open("GET", "/paisonline/plantillas2007/indicadores_com.html",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divResultado.innerHTML = ajax.responseText;
            }
	}
	ajax.send(null);



}

function ver_menos_ind()
{
	divResultado = document.getElementById('indicadores');

	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usamos el medoto POST
	//archivo que realizará la operacion
	ajax.open("GET", "/paisonline/plantillas2007/indicadores.html",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divResultado.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}

//Esta es la funcion que abre el popup-sondeo del lightometro o detector de mentiras en barra derecha home pais
function ventana_simple2() {
lanzarurl3('/paisonline/popups/sondeos/sondeo.php',450,500,77);

}


function ventana_simple() {
var num = consultarGalleta("vecesque");
if (!num) {
num = 1;
mandarGalleta2("vecesque",num,500);

//lanzarurl3('/paisonline/encuesta_elpais/encuesta2010.php',900,700,77);

lanzarurl3('/paisonline/popups/sondeos/sondeo.php',450,470,77);
}
}

ventana_simple();


/** fin popups **/

function ocultar_capa(){

   document.getElementById('grafica_1').style.display="none";
   document.getElementById('grafica_2').style.display="none";
   document.getElementById('grafica_3').style.display="none";
   document.getElementById('grafica_4').style.display="none";

}

function ocultar_capas(){


   document.getElementById('grafica_1').style.display="none";
   document.getElementById('grafica_2').style.display="none";
   document.getElementById('grafica_3').style.display="none";
   document.getElementById('grafica_4').style.display="none";
   document.getElementById('grafica_5').style.display="none";
   document.getElementById('grafica_6').style.display="none";
   document.getElementById('grafica_7').style.display="none";
   document.getElementById('grafica_8').style.display="none";
   document.getElementById('grafica_9').style.display="none";
   document.getElementById('grafica_10').style.display="none";
   document.getElementById('grafica_11').style.display="none";
   document.getElementById('grafica_12').style.display="none";
   document.getElementById('grafica_13').style.display="none";
   
}


function mostrar_capa(capa){
  document.getElementById('grafica_1').style.display="none";
   document.getElementById('grafica_2').style.display="none";
   document.getElementById('grafica_3').style.display="none";
   document.getElementById('grafica_4').style.display="none";
   document.getElementById('grafica_5').style.display="none";
   document.getElementById('grafica_6').style.display="none";
   document.getElementById('grafica_7').style.display="none";
   document.getElementById('grafica_8').style.display="none";
   document.getElementById('grafica_9').style.display="none";
   document.getElementById('grafica_10').style.display="none";
   document.getElementById('grafica_11').style.display="none";
   document.getElementById('grafica_12').style.display="none";
   document.getElementById('grafica_13').style.display="none";

   document.getElementById(capa).style.display="block";

}

function mostrar_capas(capa){
   document.getElementById('grafica_1').style.display="none";
   document.getElementById('grafica_2').style.display="none";
   document.getElementById('grafica_3').style.display="none";
   document.getElementById('grafica_4').style.display="none";
  
   document.getElementById(capa).style.display="block";

}

function ocultar_capas_multimedia(){
   document.getElementById("menu_videos").style.display="none";
   document.getElementById("menu_fotos").style.display="none";
   document.getElementById("menu_audios").style.display="none";
   document.getElementById("menu_especiales").style.display="none";
}

function mostrar_capa_multimedia(capa){

   document.getElementById(capa).style.display="block";
 
}

function ver_menos_ind_copia()
{
	divResultado = document.getElementById('indicadores');

	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usamos el medoto POST
	//archivo que realizará la operacion
	ajax.open("GET", "/paisonline/plantillas2007/indicadores_copia.html",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divResultado.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}
function ver_mas_ind_copia()
{
	divResultado = document.getElementById('indicadores');

	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usamos el medoto POST
	//archivo que realizará la operacion
	ajax.open("GET", "/paisonline/plantillas2007/indicadores_com_copia.html",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divResultado.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}

function cargar_infografia()
{
	divResultado = document.getElementById('imagen_dia');

	//instanciamos el objetoAjax
	ajax=objetoAjax();
	//usamos el medoto POST
	//archivo que realizará la operacion
	ajax.open("GET", "/paisonline/plantillas2007/cargar_infografia.html",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			//mostrar resultados en esta capa
			divResultado.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}


//mostrar ventana ajax
function mostrar_ventana(url,x,y){

   GB_show('',url,x,y);
   return;
}

