//browser sniffer
var NS4 = (document.layers) ? 1 : 0;
var NS5 = (document.getElementById) ? 1 : 0;
var NS6 = (document.getElementById) ? 1 : 0;
var IEX = (document.all) ? 1 : 0;

function init() {
  setTimeout("window.onresize = redo", 1000);
}

function redo() {
  window.location.reload();
}

if (document.layers) window.onload = init;

if (document.layers) {
window.captureEvents(Event.MOUSEMOVE);
}

if (document.all) {
	function MoveHandler() {
	Xpos = document.body.scrollLeft+event.x;
	Ypos = document.body.scrollTop+event.y;
	}
document.onmousemove = MoveHandler;
}

if (document.layers) {
	function xMoveHandler(evnt) {
		Xpos = evnt.pageX;
		Ypos = evnt.pageY;
	}
window.onMouseMove = xMoveHandler;
}

function moveLayer(theLayer, x, y) {
 	if (IEX) {
	// explorer 
	document.all[theLayer].style.pixelTop = y; document.all[theLayer].style.pixelLeft = x;
	}
	else if (NS5 || NS6) {
	// Netscape 6 
	var myElement = document.getElementById(theLayer);
	myElement.style.left = x; myElement.style.top = y;
	}
	else {
	// netscape < 6
	document[theLayer].top = y; document[theLayer].left = x;
	}
}



function mostra(livello) {
var oggetto_livello=document.all[livello];
oggetto_livello.style.visibility="visible";
}
function nascondi(livello) {
var oggetto_livello=document.all[livello];
oggetto_livello.style.visibility="hidden";
}



function getCookie(nome_cookie) {
var nome_cookie = nome_cookie + "="
if (document.cookie.length > 0) {
inizio = document.cookie.indexOf(nome_cookie)
if (inizio != -1) {
inizio += nome_cookie.length
fine = document.cookie.indexOf(";", inizio)
if (fine == -1) {
fine = document.cookie.length
}
return unescape(document.cookie.substring(inizio, fine))
} else {
return null;
}
} else {
return null;
};
}
function logIn() {
var valore_cookie=utente.value;
document.cookie='fleo_nome_utente='+valore_cookie;
window.location.reload();
}
function logOut() {
document.cookie='fleo_nome_utente=';
window.location.reload();
};

var i=0;
var timer_animazione=0;

function scrivi(testo,colore) {
document.write('<font color='+colore+'>'+testo+'</font>');
}

function scrivi_piede() {
document.write('<hr size=1><font size=-2 face=verdana>&copy; Copyright 2003 - <a href="mailto:liceo.curcio@tiscalinet.it"><font size=-2 face=verdana>Istituto di Istruzione Superiore "G.Curcio"</a> - webmaster <a href="mailto:rina.milana@tiscalinet.it"><font size=-2 face=verdana>Rina Milana</font></a><br>');
}


function cambia_colore(id_cella,colore) {
id_cella.style.backgroundColor=colore;
}

function cambia_immagine(id_img,immagine) {
id_img.src=immagine;
}

function mostra(livello) {
var oggetto_livello=document.all[livello];
oggetto_livello.style.visibility="visible";
}

function nascondi(livello) {
var oggetto_livello=document.all[livello];
oggetto_livello.style.visibility="hidden";
}

function sposta(livello) {
var oggetto_livello=document.all[livello];
i=i+4;
if (i>=150) {
clearInterval(timer_animazione);
} else {
oggetto_livello.style.left=i;
};
}


function openWindow(url, name) {
popupWin = window.open(url, name,'width=500,height=400,left=0,top=0,scrollbars=yes,resizable=yes,')}