// JavaScript Document

function calcHeight() {
    var the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
    document.getElementById('the_iframe').height = the_height;
}

function newlink(data) {
	if (!flashMenu2) {
	   	var flashMenu2 = new SWFObject("flash/menu2.swf", "menu2", "929", "175", "7", "#101533");
   		flashMenu2.addParam("quality", "BEST");
   	}
   	flashMenu2.write("flashcontent");
	document.getElementById('the_iframe').src = data;
}

function mostrar(noticia) {
	window.open('noticias_popup_' + noticia + '.html', 'noticias', 'width=520, height=600, scrollbars=yes, menubar=no, location=no, resizable=no');
   	flashMenuUnidades.write("flashcontent2");
   	flashNewsController2.write("noticiasflash");
}

function mostrarnoti(noticia) {
	window.open('noticias_popup.php?id=' + noticia + '', 'noticias', 'width=520, height=600, scrollbars=yes, menubar=no, location=no, resizable=no');
   	flashMenuUnidades.write("flashcontent2");
   	flashNewsController2.write("noticiasflash");
}

function cambiar(numv,numo1,numo2,numo3) {
	document.getElementById("tit" + numv).style.visibility = 'visible'; 
  	document.getElementById("tit" + numo1).style.visibility = 'hidden';
  	document.getElementById("tit" + numo2).style.visibility = 'hidden';
	document.getElementById("tit" + numo3).style.visibility = 'hidden';
}

function CaricaFoto(img) {
    foto1 = new Image();
    foto1.src = (img);
    Controlla(img);
}

function Controlla(img) {
    if ((foto1.width != 0) && (foto1.height != 0)) {
        viewFoto(img);
    } else {
        funzione = "Controlla('" + img + "')";
        intervallo = setTimeout(funzione, 20);
    }
}

function viewFoto(img) {
    largh = foto1.width + 20;
    altez = foto1.height + 20;
    stringa = "width=" + largh + ",height=" + altez;
    finestra = window.open(img, "", stringa);
}