var preloadImage = new Array(); 
function Preload(filename) { 
	var i = preloadImage.length; 
	preloadImage[i] = new Image(); 
	preloadImage[i].src = filename; 
} 


function swapImage(nome,newImg) { 
	eval('document.' + nome + '.src = "' + newImg + '"'); 
}


function showMe(nome) {
	document.getElementById(nome).style.visibility = 'visible';
}


function hideMe(nome) {
	document.getElementById(nome).style.visibility = 'hidden';
}


function showTime() {
	if (!document.layers&&!document.all) return

	var dataora = new Date();
	var anno    = dataora.getYear();
	var mese    = dataora.getMonth();
	var giorno  = dataora.getDate();
	var ore     = dataora.getHours();
	var minuti  = dataora.getMinutes();
	var secondi = dataora.getSeconds();
	
	mese = mese + 1;
	if (parseInt(mese) < 10) mese = "0" + mese;
	if (parseInt(giorno) < 10) giorno = "0" + giorno;
	if (parseInt(minuti) < 10) minuti = "0" + minuti;
	if (parseInt(secondi) < 10) secondi = "0" + secondi;
	
	orologio = ore + ":" + minuti + ":" + secondi;
	calendario = giorno + "/" + mese + "/" + anno;

	if (document.layers) {
		document.layers.div_orologio.document.write(orologio);
		document.layers.div_orologio.document.close();
		document.layers.div_calendario.document.write(calendario);
		document.layers.div_calendario.document.close();
	} else if (document.all) {
		div_orologio.innerHTML = orologio;
		div_calendario.innerHTML = calendario;
	}

	setTimeout("showTime()", 1000);
}

function openNew(url, param) {
	var win_name="win"+Math.round(Math.random()*9999999); 
	return window.open(url, win_name, param);
}

//var param = "width=500,height=400,location=0,menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,screenX=300,left=100,screenY=300,top=100";  

function openLoc(film) {
	openNew("locandina.php?film="+film, "width=300,height=400,resizable=yes,scrollbars=no")
}

function openCent() {
	openNew("locandina.php?film=centenario", "width=768,height=600,resizable=yes,scrollbars=yes")
}

function openMappa() {
	openNew("mappa.html", "width=624,height=370,resizable=yes,scrollbars=no")
}
