
/* ----- var applet	----*/
var contatoreUp = 100;
var container = null;
var totscorr = 0;
var up = 0;
var FileString = "";
var intervallID1 = null;


/*-----funzioni applet -----*/
function nomefile(){
	miaData = new Date();
	ora=miaData.getHours();
	giorno=miaData.getDate();
	minuti=Math.round(miaData.getMinutes()/2);
	pippo = 1+ ((ora+giorno)*30+minuti)%300;
	numFile= Math.round(pippo);
	FileString = "..\\..\\html\\291\\"+ numFile + ".html";
	return FileString;
	}
	


function init(){
if (ie5 && !isMac){
container = document.all["Layer1"].style;
document.all["layerframe"].src = nomefile();
scrollUp();
}
if (net4){
container = document.layers["Layer2"].document.layers["Layer3"];
document.layers["Layer2"].document.layers["Layer3"].document.layers["Layer4"].src = nomefile();
scrollUp();
}  
} 

function scrollUp(){
	if ((ie5 && !isMac) || net4){
		if (up >= -19){
		up = up -1;
		contatoreUp = contatoreUp - 5;
		container.top = contatoreUp;
		intervallID1 = setTimeout("scrollUp()",10);
		}else {
		totscorr = totscorr + 1;
		up = 0;
			if (totscorr == 10) {contatoreUp = 100;
			totscorr = 0;
			primo = true;
			}
		intervallID1 = setTimeout("scrollUp()", 4000);
		}
	} 
}

function scrollStop(){
clearTimeout(intervallID1);
}

/*----fine funzioni applet ----*/

// var layer
var popactivein = null;
var popactiveout = null;
var flaglink = false;
var startup = false;
var d,dd,st,dst;
var visistatus,hideststus;
var valoredihide = 235;	


if (net4){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = mouseverifymove;

/*-- implementazione oggetti Layer --*/
if (net4){
dd = "document.layers['";
dst ="'].";
d =	"document.layers['";
st = "']";
visistatus="show";
hidestatus="hide";
}
if (dom){
dd = ""
dst = ""
d = "document.getElementById('";
st = "').style";
visistatus="visible";
hidestatus="hidden";
}
// funzioni di visualizzazione layer

function setvisible(popinid, popoutid) {
	
cont = popoutid;
	if (popactivein != null){
		nascondi();
	}	
	if (dom) cont= "";
	if(startup) eval(dd+cont+dst+d+popinid+st).visibility = visistatus;	 
popactiveout = popoutid;
popactivein = popinid;
} 

function nascondi() {
cont = popactiveout; 
	if (popactivein != null) {
		if (dom) cont="";
		if (startup)eval(dd+cont+dst+d+popactivein+st).visibility = hidestatus;
	}
}

function setflag(){

	flaglink = !flaglink
}

function mouseverifymove(e){
   	var Yscreen,Ylayer
		if (ie5 || ie4){
			Yscreen = event.x;
		}
		if (net4 || net6){
			Yscreen = e.pageX;
		}
		if (Yscreen >= valoredihide) {
			nascondi();
		} 
/*implementazione estranea a questo script serve per un'animazione di pagina*/
if ((ie4 || ie5) && startup) {
	document.all["home"].style.top = event.y +20;
	document.all["home"].style.left = event.x -75;

	if (event.x <= 75){
	document.all["home"].style.top = event.y +20;
	document.all["home"].style.left = event.x +30; 
	}
  }
 /*fine implementazione estranea */
}

/*----- fine funzioni layer --*/
/*---- lancio applicazione ---*/

function initstart(){
init();
startup = true;
}
window.onload=initstart