function MenuMuestra(elemento) {
    document.getElementById(elemento).style.display = 'block';
}

function MenuOculta(elemento) {
    document.getElementById(elemento).style.display = 'none';
}


function PopupNoticia(IdNoticia, lang) {
	var total_x = self.screen.width;
	var total_y = self.screen.height;
	ancho = 550;
	alto = 400;
	Top = 60;
	if ( (total_x > ancho) && (total_y > alto) ){
		Left = (total_x - ancho)/2;
	}
	else {
		Left = 0;
	}

	cadena = "window.open('_noticia_detalle.php?IdN='+IdNoticia+'&lang='+lang,'noticia','width="+ ancho +",height="+ alto +",scrollbars=yes,top="+Top+",left="+Left+"')";

	eval(cadena);
}

function VentanaPopup(pagina,valor,alto,ancho) {
	var total_x = self.screen.width;
	var total_y = self.screen.height;
	if ( (total_x > ancho) && (total_y > alto) ){
		Left = (total_x - ancho)/2;
		Top = (total_y - alto)/2;
	}
	else{
		Left = 0;
		Top = 0;
	}

	Top = 0;//para que se centre solo en el eje X

	alto   = eval(alto)+118;
	ancho  = eval(ancho)+40;
	cadena      = "window.open('" + pagina + valor + "','hijo','width="+ ancho +",height="+ alto +",scrollbars=yes,top="+Top+",left="+Left+"')";
	window.name = "padre";
	manejador   = eval(cadena);
	manejador.focus();
}

function agregarAFavoritos(title, url) {
	if(window.sidebar){ // Firefox
		window.sidebar.addPanel(title, url,'');
	}
	else if(window.opera){ //Opera
		var a = document.createElement("A");
		a.rel = "sidebar";
		a.target = "_search";
		a.title = title;
		a.href = url;
		a.click();
	}
	else if(document.all){ //IE
		window.external.AddFavorite(url, title);
	}
	else {
		alert('Para agregar a favoritos utilice Ctrl+D en su teclado');
	}
}

function aAFavoritos() {
	if(window.sidebar){ // Firefox
		document.getElementById('linkAAF').href = "javascript:window.sidebar.addPanel(document.title, document.location,'')";
		document.getElementById('linkAAF').title = title;
	}
	else if(window.opera){ //Opera
		document.getElementById('linkAAF').href = document.location;
		document.getElementById('linkAAF').title = document.title;
		document.getElementById('linkAAF').rel = "sidebar";
		document.getElementById('linkAAF').target = "_search";
	}
	else if(document.all){ //IE
		document.getElementById('linkAAF').href = "javascript:window.external.AddFavorite(document.location, document.title)";
		document.getElementById('linkAAF').title = document.title;
	}
	else {
		document.getElementById('linkAAF').href = "javascript:alert('Para agregar a favoritos utilice Ctrl+D en su teclado')";
		document.getElementById('linkAAF').title = document.title;
	}
}


function ajustarPagina() {
	centroHeight = document.getElementById('diaCentro').offsetHeight;
	diaAreaMenuHeight = document.getElementById('diaAreaMenu').offsetHeight;
	contenidoHeight = document.getElementById('diaContenido').offsetHeight;
	diaContenidoAbajoHeight = document.getElementById('diaContenidoAbajo').offsetHeight;
	if (diaAreaMenuHeight < centroHeight) {
		diaMenuHeight = centroHeight - imgMenuPieHeight;
		document.getElementById('diaMenu').style.height = diaMenuHeight + 'px';
	}
	if (contenidoHeight < centroHeight) {
		contenidoHeightDif = centroHeight - contenidoHeight;
		diaContenidoAbajoHeight = diaContenidoAbajoHeight + contenidoHeightDif;
		document.getElementById('diaContenidoAbajo').style.height = diaContenidoAbajoHeight+'px';
	}
}
