Is_NS=window.navigator.appName == "Netscape"
Is_IE=window.navigator.appName == "Microsoft Internet Explorer"
Redir   = '..';
MailWeb = "webmaster@liceofoscarini.it";
OrarioOra = '../orario3/'

function GetElement(nome){
	if (Is_IE) {
		return document.all[nome];
	} else {
		return document.getElementById(nome);
	}

}

function Person(Nome, Cognome, Classe, EMail){
   this.Cognome = Cognome;
   this.Nome    = Nome;
   this.Classe  = Classe;
   this.EMail   = EMail;
}

Pers = new Array()

function RegistroVis(){
	if (location.host == 'www.provincia.venezia.it') {
		return Redir + '/orario2/registro.phtml'
	}else{
		return '/orario2/registro.phtml'
	};
}

Pers[ 0] = new Person('Paolo', 'Bonavoglia', 'prof.', 'paolo.bonavoglia@liceofoscarini.it');
Pers[ 1] = new Person('Adriana', 'Galvan', 'prof.', 'palmierimauro@tin.it');
Pers[ 2] = new Person('Mariangela', 'Gatti', 'prof.', 'macats@tin.it');
Pers[ 3] = new Person('Pierandrea', 'Malfi', '', 'pierandrea.malfi@liceofoscarini.it');
Pers[ 4] = new Person('Annalisa',   'Caretto', '', '');
Pers[ 5] = new Person('Sebastiano', 'Cibien', '', '');
Pers[ 6] = new Person('Alessandro', 'Milan', 'prof.', '');
Pers[ 7] = new Person('Juli',       'Van Zyverden', 'prof.', '');
Pers[ 8] = new Person('Laura',      'Luchi', 'prof.', '');
Pers[ 9] = new Person('Daniela',    'Magnanini', 'prof.', 'danielamagnanini@hotmail.com');
Pers[10] = new Person('Simone', 'Morandini', 'prof.', 'simmmor@tin.it');
Pers[11] = new Person('Federico', 'Andreolo', 'prof.', 'vicepreside@liceofoscarini.it');
Pers[12] = new Person('Massimiliano', 'Goattin', '', 'goattin@tin.it');
Pers[13] = new Person('Marie', 'Marinaro', '', '');
Pers[14] = new Person('Giorgio', 'Griffon', '', 'conchiglieveneziane@libero.it');
Pers[15] = new Person('Herv&egrave;', 'Bordas', '', 'conchiglieveneziane@libero.it');
Pers[16] = new Person('Daniel', 'Fabris', '', '');
Pers[17] = new Person('Alberto', 'Pallone', '', '');
Pers[18] = new Person('Paolo', 'Azzalin', '', 'azzalin@liceofoscarini.it');
Pers[19] = new Person('Alessia', 'Crozzoli', '', '');


function Persona(Nome, Cognome, tit_it, tit_en, tit_de, tit_fr){
   this.Cognome  = Cognome;
   this.Nome     = Nome;
   this.Titolo   = new Array(tit_it, tit_en, tit_de, tit_fr, '');
}

Presidenza = new Array()
Presidenza[0] = new Persona("Rocco", "Fiano", "Preside-Rettore", "Headmaster", "Leiter", "Proviseur")
Presidenza[1] = new Persona("Federico", "Andreolo", "Collaboratore vicario", "Deputy", "Vertreter", "D&eacute;l&eacute;gu&eacute;")
Presidenza[2] = new Persona("Tiziana", "Voi", "Collaboratore", "Deputy", "Vertreter", "D&eacute;l&eacute;gu&eacute;");

Persone = new Array()
Persone[0] = new Persona("Anna Luisa", "Montagner", 
	"Responsabile amministrativo", "Chief", "Chef", 	"Secr&eacute;taire")
Persone[1] = new Persona("Paolo", "Serena", "Assistente", "", "", "")
Persone[2] = new Persona("Magdalene", "Schremp Liguori", "Commissario straordinario", "Chairman", "Vorsitzender", "Pr&eacute;sident")
Persone[3] = new Persona("Lidia", "Quarin", "Assistente", "", "", "")

function Personale(person, lingua){
	document.write(person.Titolo[lingua], "<EM> ");
	document.write(person.Nome, " ");
	document.write(person.Cognome, "</EM>");
}

function UffPresidenza(lingua){
	for (numero = 1; numero< Presidenza.length; numero++) {
		Personale(Presidenza[numero], lingua);
		document.writeln("<BR>");
	}
}


OrarioOra = Redir + '/orario2/'
LibriOra  = Redir + '/libri01-02/';
EstLibri = '.html'

function ScriviAncora(path, label){
	document.write('<A HREF="', Redir, path, '">', label, '</A>');	
}

function NewOrario(){
	return('../orario1/')
}

function ReplaceURL(nuovo, repdir, homefile){
	newProv = nuovo;
	local = location.pathname.toLowerCase();
	cerca = /\\/gi
	local = local.replace(cerca, '/');
	prov  = local.indexOf(repdir);
	if (prov >= 0){
        	newProv = newProv + local.substr(prov+repdir.length);
	} else {
		newProv = newProv + homefile;
	}
	return(newProv)
}

function NewURL(){
	return (ReplaceURL(OrarioOra, '/orario2/', 'home.htm'));
}

function NewLibriURL(){
	nuovo = ReplaceURL(LibriOra, '/libri/', 'index.htm');
	extpos = nuovo.indexOf('.html');
	if (extpos < 0) {
		nuovo += 'l';
	}
	return (nuovo);
}


function Figura(foto, testo){
	this.Foto = foto
	this.Testo = testo
}

Numero = 0;
TotFoto = 1;

function MostraFoto(Foto, Testo){
	Foto.src = Figure[Numero].Foto
	if (navigator.appName == "Netscape"){
		Testo.value = Figure[Numero].Testo
	} else {
		Testo.innerHTML = Figure[Numero].Testo
	}
}

function Mostra(Foto, Testo, num){
	Numero = num;
	MostraFoto(Foto, Testo)
}
function Avanti(Foto, Testo){
	Numero = (Numero + 1) % TotFoto
	MostraFoto(Foto, Testo)
}

function Indietro(Foto, Testo){
	Numero = (Numero + TotFoto -1)% TotFoto
	MostraFoto(Foto, Testo)
}
WebMaster    = 0;
Informatica  = 0;
Fisica       = 1;
Scienze      = "Daniela Magnanini";
MailRettore  = "preside@liceofoscarini.it";
MailScuola   = "segreteria@liceofoscarini.it";
MailDocenti  = "docenti@liceofoscarini.it";
MailStudenti = "studenti@liceofoscarini.it";
MailBiblio   = "biblio@liceofoscarini.it";
MailWebMaster = "webmaster@liceofoscarini.it";
NomeScuola   = "Liceo Foscarini Venezia";
NomeScuolaW  = 'Liceo Classico "Marco Foscarini" - Venezia';
Indirizzo    = "Cannaregio 4942 - 30131 VENEZIA";
Telefono     = "0415224845";
Fax          = "0415201657";

function ScrivIndirizzo(){
	document.write('Liceo Ginnasio Statale "Marco Foscarini"<BR>')
	document.write(Indirizzo, '<BR>')
	document.write('Tel: ', Telefono, '<BR>')
	document.write('Fax: ', Fax)
}

function ScriviMail(aMail){
	document.write('<A HREF="mailto:', aMail, '">', aMail, '</A>')
}

function ScriviWebMaster(){
	ScriviPersona(WebMaster)
}

function ScriviPersona(num){
	document.write('<EM>', Pers[num].Nome, ' ', Pers[num].Cognome, '</EM> ')
	if (Pers[num].EMail.length > 0){
		document.write('(<I>')
		ScriviMail(Pers[num].EMail);
		document.write('</I>) ')
	}
}

function ScriviLogo(){
	document.writeln('<IMG SRC="/logo.jpg"  USEMAP="#Logo">')
	document.write('<MAP NAME="Logo">');
	document.write('<AREA SHAPE="rect" COORDS="0,4,196,26" HREF="/index.html">');
	document.write('</MAP>');
}

function HomeDir(dir){
	if (location.protocol == 'http:') {
		return 'http://www.provincia.venezia.it/mfosc/'
	} else {
		return dir
	}
}

function PoloEstHREF(dir, href, titolo){
	document.write('<A HREF="', HomeDir(dir), href, '">', titolo, '</A>');
}

function ScriviUltimaData(){
	var datAgg = new Date(document.lastModified);
	with (datAgg) {
		var anno = getFullYear();
//		if (anno < 1980) {anno += 100}
		document.writeln(getDate(), '-', getMonth()+1, '-', anno);
	}
}

function ScriviCoda(dum, aut, tipo){
	document.writeln('<br style="clear: both">')
	if (aut >= 0) {
		if (tipo == 1) {
			document.write('<hr>Testo e foto di ');
		}else if (tipo == 2) {
			document.write('<hr>Testo di ');
		}else {
			document.write('<hr>Pagina a cura di ');
		}
		if (aut2 >0){
		}
		ScriviPersona(aut);
		document.write(' del ');
	} else {
		document.write('<HR>Pagina a cura del')
	}
	document.write('<dl>')
	document.write('<dt>', NomeScuolaW)
	document.write('<dd>E-Mail: '); ScriviMail(MailWeb);
	document.write('<dd><a href="', dum, '/index.html">Presentazione della scuola</a>')
	document.write('<dd><a href="', dum, '', RegistroVis(), '">Registro visitatori</a>')
	document.write('<dd><a href="', dum, '/index.shtml">Indirizzi, Numeri di telefono, E-Mail</a>')
	document.write('</dl>')
	document.write('<hr><div>Pagina aggiornata il ');ScriviUltimaData();
	document.write('</div>');
	document.write('<hr><div><em>@2004 Liceo Foscarini - Venezia</em> ');
	document.write('Testi e foto possono essere riprodotti liberamente a condizione che ');
	document.write('venga citata esplicitamente la fonte, con un link a questa pagina, e che la cosa non abbia fini di lucro.</DIV>');
}

Anno0 = 1996;
AnnoSQL = 2003;
AnnoU = 2003;

function Sequenza(titolo, pre, post, inizio, escluso, fine){
	document.write(titolo);
	for (numero = inizio; numero<=fine; numero++) {
	   if (numero == escluso) {
		document.write('  <STRONG>', numero, "/", (numero+1)%100, "</STRONG>");
	   } else {
		document.write('  <A HREF="', pre, (numero+1)%100, post, '">', numero, '/', (numero+1)%100, '</A>');
	   }
	}
}

function Notizie(escluso, dir){
	if (typeof(dir) != "string"){dir=''}
	Sequenza('Notizie ', dir+'notizie', '.html', Anno0, escluso, AnnoU);
}

function Eventi(escluso, dir){
	if (typeof(dir) != "string"){dir=''}
	Sequenza('Eventi ', dir+'visite', '.html', Anno0, escluso, AnnoU);
}

function Orari(escluso, htmlfile){
	Sequenza('', '../orario', '/'+htmlfile, Anno0, escluso, AnnoSQL-1);
	if (htmlfile == 'docenti.htm'){
		NomeFile = '../orariodin/docenti.phtml?Anno=200';
	} else {
		NomeFile = '../orariodin/orar_docente.phtml?Docente='+htmlfile;
		NomeFile = NomeFile.substring(0, NomeFile.length-4);
		NomeFile += '&Anno=200';
	}
	Sequenza('', NomeFile, '', AnnoSQL, escluso, AnnoU);
}

function Maturi(escluso){
	Sequenza('Esami del ', 'maturita', '.html', Anno0-1, escluso-1, AnnoU-1);
}

function MaturiDir(escluso, dir){
	Sequenza('Esami del ', dir+'maturita', '.html', Anno0-1, escluso-1, AnnoU-1);
}

function Accessi(escluso, dir){
	Sequenza('Statistiche A.S.', dir+'statistiche', '.html', Anno0+1, escluso-1, AnnoU-1);
}
