Is_NS = window.navigator.appName == "Netscape"
Is_IE = window.navigator.appName == "Microsoft Internet Explorer"
Redir   = '..';
MailWeb = "webmaster@liceofoscarini.it";
OrarioOra = '../orariodin/'

function GetElement(nome){
	if (Is_IE) {
		return document.all[nome];
	} else {
		return document.getElementById(nome);
	}
}

function CambiaFoto(fname){
	GetElement('Scelta').value = fname;
	GetElement('Foto').src = fname;
}

function ColOrdina(chiave){
	ord = document.forms[0].Ordine;
	ord.value = chiave;
	tip = document.forms[0].Tipo;
	if (tip.value == 'ASC'){
		tip.value = 'DESC';
	} else {
		tip.value = 'ASC';
	}
	document.forms[0].submit()
}

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 'http://www.liceofoscarini.it/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@#toglimi#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.', 'morandinis@yahoo.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', '', '');
Pers[20] = new Person('Adriana', 'Galvan', '', '');
Pers[21] = new Person('Lorenzo', 'Pacagnella', '', '');
Pers[22] = new Person('Mattia', 'Don&agrave;', '', '');
Pers[23] = new Person('Francesco', 'Zantedeschi', '', '');
Pers[24] = new Person('Leonardo', 'Mezzaroba', '', '');
Pers[25] = new Person('Antonella', 'Antonelli', '', 'antonlli@tin.it');
Pers[26] = new Person('Giuseppe', 'Pagliara', '', '');

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
}


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     = "041 5224845";
Fax          = "041 5201657";

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, aut2){
	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 if (tipo == 3) {
			document.write('<hr>Fotografia di ');
		}else {
			document.write('<hr>Pagina a cura di ');
		}
		if (aut2 >0){
		}
		ScriviPersona(aut);
		if (aut2 >= 0){
			document.write('e di ');
			ScriviPersona(aut2);
		}
		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="http://www.liceofoscarini.it/index.phtml">Presentazione della scuola</a>')
	document.write('<dd><a href="', RegistroVis(), '">Registro visitatori</a>')
	document.write('<dd><a href="http://www.liceofoscarini.it/biglietto.html">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>@2007 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   = 2000;
AnnoSQL = 2003;
AnnoU   = 2004;

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 Accessi(escluso, dir){
	Sequenza('Statistiche A.S.', dir+'statistiche', '.html', Anno0+1, escluso-1, AnnoU-1);
}

function Orari(escluso, dir){
	Sequenza('Orari', '../orario', '/'+ dir, Anno0+1, escluso-1, 2001);
}

