<!-- FUNZIONI PER LA VISUALIZZAZIONE DHTML //-->

<!-- creazione della classe Browser per definire il tipo di browser //-->
function Browser() {
	this.n4 = (document.layers) ? 1 : 0;
	this.ie = (document.all) ? 1 : 0;
	this.n6 = (document.getElementById) ? 1 : 0;
}

<!-- definizione della posizione del layer sulla base del browser e dei dati ricevuti //-->
function centra(id,left) {
	if (bw.n4){
		this.obj = document.layers[id];
	}else if(bw.ie){
		this.obj = document.all[id].style;
	}else if(bw.n6){
		this.obj = document.getElementById(id).style;
	}
		this.obj.left = (left>50) ? left : 50;
		this.obj.top = 15;
		return this.obj;
}

<!-- definizione delle dimensioni utili della pagina, e di setup del layer al primo e successivi accessi //-->
function setup(prima){

	<!-- creazione di una istanza della classe Browser, di nome bw //-->
	bw = new Browser();
	if(bw.ie) {
		wdth = Math.round(document.body.clientWidth);
	}else if(bw.n4 || bw.n6){
		wdth = Math.round(window.innerWidth);
	}
	if(prima){
		//lay = new centra('logo', Math.round((wdth/2)-350));
		scrivi()
	}else{
		if(bw.n4){
			location.reload();
		}else if(bw.ie || bw.n6){
			//lay = new centra('logo', Math.round((wdth/2)-350));
		}
	}	
		
}

function chiudi()
{ 
document.getElementById("logo").style.height="70px";
document.getElementById("logo").style.width="210px";
}






<!-- scelta del contenuto del layer in base al browser e all'accesso //-->
function scrivi() {
	var net = "<OBJECT id='concorso' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH='203' HEIGHT='64'><PARAM NAME=movie VALUE='/images/flash/caccia_alla_luna_fermo.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#CCCCCC><EMBED  src='/images/flash/caccia_alla_luna_fermo.swf' quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH='203' HEIGHT='64' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT>";
	var exp = "<OBJECT id='concorso' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' WIDTH='300' HEIGHT='400'><PARAM NAME=movie VALUE='/images/flash/caccia_alla_luna.swf'><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#CCCCCC><EMBED name='concorso' swLiveConnect='true' src='/images/flash/caccia_alla_luna.swf' quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH='300' HEIGHT='400' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'></EMBED></OBJECT>"
	if (bw.n4) {
		document.layers.logo.document.close();
		document.layers.logo.document.write(net);
		document.layers.logo.document.close();
	}else if(bw.ie){
		if(document.readyState == "complete"){
			
				eval("document.all.logo.innerHTML = exp");	
			setTimeout("chiudi()",15000);
		}else{
			timerID = setTimeout("scrivi()",100);
		}
	}else if(bw.n6){
		document.getElementById("logo").innerHTML = net;
		setTimeout("chiudi()",1);
	}
}






