/****************************************************************

RITORNO ALLA HOME PAGE DOPO 5 MINUTI DI INATTIVITA'
N.B. attivare solo per la versione "totem"
viene chiamata da un OnLoad presente nel BODY

****************************************************************/

window.onLoad=gotohome()

function gotohome(){
//		setTimeout("parent.location.href='../index.htm'",300000);
}

/****************************************************************

RICONOSCIMENTO DEL BROWSER
N.B. da aggiornare per riconoscere anche i browser 5

****************************************************************/

var	ns4=(document.layers)? true:false
var	ie4=(document.all)? true:false

/****************************************************************

DIMENSIONI FINESTRA
N.B. da richiamare con uno script DOPO il TAG BODY nelle pagine 
mappa che usano le funzioni show() e hide()

****************************************************************/

function winDIM() {
	winL = (ns4)? window.innerWidth : document.body.offsetWidth-20
	winH = (ns4)? window.innerHeight : document.body.offsetHeight-4
}

/****************************************************************

FUNZIONI SHOW(), SETCOORDS() E HIDE()
Utilizzate nelle 5x19 mappe interattive

****************************************************************/


function hide(id){
	if(ns4){document.layers[id].visibility="hide"}
	else if(ie4) {document.all[id].style.visibility="hidden"}
}


document.onmousemove= setCoords;
if(ns4){document.captureEvents(Event.MOUSEMOVE);}

var mouseX=0
var mouseY=0
var mouseRelX=0
var mouseRelY=0

function setCoords(e) {
	if(ns4){
  		mouseX=e.pageX;
  		mouseY=e.pageY;
  		mouseRelX=(mouseX-window.pageXOffset);
  		mouseRelY=(mouseY-window.pageYOffset);
  		}
  	if(ie4){
  		mouseRelX=event.x;
  		mouseRelY=event.y;
  		mouseX=(mouseRelX+document.body.scrollLeft);
  		mouseY=(mouseRelY+document.body.scrollTop);
  		}
  	return true
}


function show(id){

	if ((winL-mouseRelX)<200){divX=mouseX-180}
	else {divX=mouseX+30}

	if ((winH-mouseRelY)<100){divY=mouseY-30}
	else {divY=mouseY}
	

	if(ns4){
		document.layers[id].left=divX
		document.layers[id].top=divY
		document.layers[id].visibility="show"
	}
	if(ie4){
		document.all[id].style.left=divX
		document.all[id].style.top=divY
		document.all[id].style.visibility="visible"
	}
}

/****************************************************************

FUNZIONE GOBYMAP()
chiamata dal Site Map nella pagina Help

****************************************************************/

function goByMap(top,bottom){
	
	parent.topFrm.location.href=top;
	document.location.href=bottom;
}

/****************************************************************

FUNZIONE newWin()

****************************************************************/

function newWin(nameWin){
var siviWin = window.open(nameWin,'siviWin','toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,copyhistory=0,width=790,height=530,screenX=0,screenY=0');
}
