//########### ERRORES
function detenerError() { 
return true 
}
window.onerror=detenerError;

//####### 
//####### DETECCIÓN DEL NAVEGADOR
//####### 
IE = navigator.appName=="Microsoft Internet Explorer";
NS = navigator.appName=="Netscape";
bVer = parseInt(navigator.appVersion);
var radval = 0;
var newWin=null;

function popup(loc, name, width, height, scroll) {
	if (scroll == 'yes'){
	scroll = 'yes';
	}else{
	scroll = 'no';
	}
        var _params = "width="+width+",height="+height+",resizable=no, scrollbars="+scroll+",status=no";

        // CENTER ON BROWSERS WHICH SUPPORT JSCRIPT 1.2
        if (bVer >= 4) {
                 _left = ( (screen.width-width) >>1 );
                 _top = ( (screen.height-height) >>1 );
        } else {
                 _left = ( (800-width) >>1 );
                 _top = ( (600-height) >>1 );
        }

        if (IE) _params += ",top=" + _top + ",left=" + _left;
        else if (NS) _params += ",screenX=" + _left + ",screenY=" + _top;
        
		newWin = window.open(loc, name, _params);
        if ( newWin!=null && !(IE && bVer<5) )
        newWin.focus(); // MSIE4 DOESN'T FOCUS WINDOWS
}

//#### MENU DE NAVEGACION
navHover = function() {
	var lis = document.getElementById("navmenu-h").getElementsByTagName("LI");
	for (var i=0; i<lis.length; i++) {
		lis[i].onmouseover=function() {
			this.className+=" iehover";
		}
		lis[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" iehover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", navHover);
//##### ENCUESTA
function selctx(radIndex)
{
   var returnValue = true;
      radval = radIndex;
   }
function vote() 
{
	var resultado = true;
	NumResp = document.formaenc.NumResp.value;
	id = document.formaenc.id.value;
	VO = document.formaenc.VO[radval].value;

	if (VO=="vacio"){
		alert("Debe seleccionar una opción para votar en la encuesta");
	}	
	else {
	popup( '/encuestas/votar.asp?VO='+ VO +'&i='+ id, 'Encuesta', 530, 540, 'no');
	}
}

function ver_resultado(id){
	popup( '/encuestas/resultado.asp?i='+ id, 'Encuesta', 530, 540, 'no');
}

//##### CONDICIONES DE USO Y AVISO LEGAL
function condiciones(){
	popup( '/politicas/condiciones.asp', 'CONDICIONES', 500, 550, 'yes');
}

//##### POLITICAS DE PRIVACIDAD
function politicas(){
	popup( '/politicas/politica_privacidad.asp', 'POLITICAS', 500, 550, 'yes');
}

//##### ACCESESIBILIDAD
function accesibilidad(){
	popup( '/politicas/accesibilidad.asp', 'ACCESIBILIDAD', 500, 550, 'yes');
}

//##### STREAMING - RADIO
function streaming(){
	popup( '/multimedia/', 'STREAMING', 386, 187);
}

//##### STREAMING - AUDIO
function audio(url){
	popup( '/multimedia/player.asp?i='+ url, 'STREAMING', 470, 285);
}

//##### STREAMING - AUDIO
function video(url){
	popup( '/multimedia/player2.asp?i='+ url, 'STREAMING', 670, 520);
}

//##### STREAMING - RADIO 2
function streaming3(){
	popup( '/multimedia/audio.asp', 'STREAMING', 470, 330);
}

//##### STREAMING - RADIO 3
function radio(){
	popup( '/multimedia/audio.asp', 'STREAMING', 470, 330);
}

//##### RECOMENDAR ARTICULO
function recomendar_articulo(id){
	//showModalDialog("/core/recomendar.asp?id="+ id,"","dialogHeight: 390px; dialogWidth: 400px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: no; resizable: no; status: no;" );
	popup( '/core/recomendar.asp?id='+ id, 'RECOMENDAR', 390, 350);
}

//##### IMPRIMIR ARTICULO
function imprimir_articulo(id){
	//showModalDialog("/core/imprimir.asp?id="+ id,"","dialogHeight: 500px; dialogWidth: 460px; dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: no; resizable: no; status: no;" );
	popup( '/core/imprimir.asp?id='+ id, 'IMPRIMIR', 650, 500, 'yes');
}
function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) {
		self.print();
		self.close();
	}
}

//##### CODIGO FORO
function foro(){
	popup( '/politicas/codigo_conducta.asp', 'FORO', 500, 550, 'yes');
}

//##### TITULARES
function titulares(){
	popup( '/titulares/config/', 'TITULARES', 670, 450, 'yes');
}

//##### MAILs
function Ocure(domain,user) { 
document.location.href = "mailto:" + user + "@" + domain; 
}

function GoLogin() {
document.login.submit();
}

function GoLogin2() {
document.login2.submit();
}

//##### LEER COOKIE
function leerCookie(nombre) { 
   a = document.cookie.substring(document.cookie.indexOf(nombre + '=') + nombre.length + 1,document.cookie.length); 
   if(a.indexOf(';') != -1)a = a.substring(0,a.indexOf(';')) 
   return a;  
}

//##### CREAR COOKIE
function CrearCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

//##### TAMAÑO DE LA FUENTE
function Tamano(variable){
//var Boton=window.event.srcElement
var Elementos=document.all.tags("font")
var tam

CrearCookie("fuente", variable, 90);
//document.cookie = "fuente = "+ variable +"; expires = 2 Dec 2050 23:59:59 GMT";

for (i=0;i<Elementos.length;i++){
tam = 0;
tam = parseFloat(Elementos[i].style.fontSize);
Elementos[i].style.fontSize = variable
}
}

function TamanoActual(){
var Elementos=document.all.tags("font")
var tam

for (i=0;i<Elementos.length;i++){
tam = 0;
tam = parseFloat(Elementos[i].style.fontSize);
var TamanoActualLeido = leerCookie('fuente');
Elementos[i].style.fontSize = TamanoActualLeido;
}
}