/* ****** Sezione personalizzabile ******* */

var QM=5;   // quanti menu 

var AM=21; // altezza dei menu

var qV1 = 7; // Quante Voci per la tendina 1
var qV2 = 2; // Quante Voci per la tendina 2
var qV3 = 3; // ecc.
var qV4 = 4;
var qV5 = 2;

// in teoria ne regge fino a 99, eventualmente va allungato l'array TND (tendine). Pero', che me ne faccio di 99 menu?

var LT= new Array();
LT[0]=0;
LT[1]=140; // Larghezza Tendina 1 
LT[2]=140; // Larghezza Tendina 2
LT[3]=140; // ecc.
LT[4]=140;
LT[5]=140;

var tC=400; //  tempo di chiusura tendina dopo il mouseover
var tso=30; //  tempo di successione scomparsa fra una voce e l'altra
var cMZ="#2A358E";        // colore menu "zero", cioe', quello che costituisce la barra
var cOmZ="#787AB5";      // colore menu zero al mouseOver
var cVM="#0066CC";      // colore voci menu  
var cOV="#990066";     // colore voci al mouseOver

var aTb="center"     // allineamento testo menu barra (possibilita': left, center, right) 
var aTv="center"    // allineamento testo voci menu (come sopra)

var CspB=0;        // cellspacing (table barra)
var CpdB=0;       // cellpadding (table barra)
var BrdB=0;      // border (table barra)

var CspV=0;        // cellspacing (table voci)
var CpdV=0;       // cellpadding (table voci)
var BrdV=0;      // border (table voci)

var dA=172;    // distanza dall'alto
var dsxP=23; // distanza da sx del Primo Menu
var dMo=0;  // distanza fra un menu e l'altro in orizzontale
var dMv=0; // distanza fra un menu e l'altro in verticale

var Voci= new Array();
Voci[0]=0;
Voci[1]=new Array('INFORMAZIONI','Presentazione','Finalitą e Scopi','Sede corsi/Inizio lezioni','Attivitą motoria e Ballo','Frequenza','Come contattarci','Archivio documenti');
Voci[2]=new Array('ISCRIZIONI','Modalitą','Iscriviti Online');
Voci[3]=new Array('MATERIE','Le nostre Materie','I Docenti','Orario Lezioni');
Voci[4]=new Array('STATUTO','Leggi lo STATUTO','Leggi il REGOLAMENTO','Scarica lo STATUTO','Scarica il REGOLAMENTO');
Voci[5]=new Array('AIUTO','Suggerimenti','Web Master');

var Link=new Array();
Link[0]=0;
Link[1]=new Array('','index.asp?page=presentazione','index.asp?page=finalita','index.asp?page=sede','index.asp?page=motoria','index.asp?page=frequenza','index.asp?page=contatti','javascript:{openFileBrowser();}');
Link[2]=new Array('','index.asp?page=modalita','index.asp?page=iscriviti');
Link[3]=new Array('','index.asp?page=materie','index.asp?page=docenti','public/orario.pdf');
Link[4]=new Array('','index.asp?page=statuto','index.asp?page=regolamento','index.asp?page=statuto','public/regolamento.zip');
Link[5]=new Array('','index.asp?page=help','index.asp?page=webmaster');

var Trg=new Array(); // Il link funziona SOLO se viene specificato un target. Per aprire la pag.htm nella finestra corrente scrivere 's' (sta per _self); per una nuova finestra scrivere 'b' (_blank); per un frame scrivere il 'NomeFrame'; per una popup scrivere 'p'.
Trg[0]=0;
Trg[1]=new Array('','s','s','s','s','s','s','s'); // relativamente al primo menu: target per link 0 (quello della voce barra), di seguito il target per i link 1, 2 , 3, ecc.
Trg[2]=new Array('','s','s');// relativamente al secondo menu (come sopra)
Trg[3]=new Array('','s','s','p');
Trg[4]=new Array('','s','s','s','p');
Trg[5]=new Array('','s','s');


/* ****** Fine Sezione personalizzabile ******* */
/* */
/* Da qui in poi eventuali modifiche sono consigliabili solo a chi e' molto esperto di JavaScript, vi invitiamo a non */
/* intervenire se non siete sicuri di quel che fate, non vi garantiamo risposta alcuna */
/* */

var TND= new Array(qV1,qV2,qV3,qV4,qV5);


var DG=(document.getElementById);
var DL=(document.layers);
var DA=(document.all);

// le var sottostanti vanno pre-inizializzate per non creare errori

var cQV=""; // convenzionalmente Quale Voce, "convenzionalmente" significa: anziche' "barra1", scrivo barra101 o barra201 ecc.
var CmB=""; // chiudi menu Barra
var AmB=""; // apri menu Barra
var ndcB="";   // numero di comodo Barra 
var ndcQVM=""; // numero di comodo Quante Voci Menu (idem)
var cQVM="";   //
var VZ="barra100";   //

function Overa(qVOver,NumConB,quale,colOv) { // quante voci (serve per chiuderle), numero convenzionale Barra, quale voce (1,2,3, ecc), OverMenuColor
window.clearTimeout(CmB);
if(quale==0) {
for(cs=ndcQVM; cs>ndcB; cs--) {
qVcs="barra"+cs; // quali voci chiudo subito
(DA)?document.all[qVcs].style.visibility="hidden" : (DL)? document.layers[qVcs].visibility="hide" : document.getElementById(qVcs).style.visibility ="hidden";
}
for (cbg=1; cbg<=QM; cbg++) {
rip="barra"+cbg+"00";
(DA)?document.all[rip].style.background=cMZ : (DL)? document.layers[rip].bgColor=cMZ : document.getElementById(rip).style.background=cMZ; //torna colore originario
  }
}

cQV=qVOver+NumConB; 
cQm="barra"+(quale+NumConB); // convenzionalmente quale menu
if (quale==0) {
for (i=NumConB+1; i<=cQV; i++) {
qualeVoceApro="barra"+i;
(DA)?document.all[qualeVoceApro].style.visibility="visible" : (DL)? document.layers[qualeVoceApro].visibility="show" : document.getElementById(qualeVoceApro).style.visibility="visible";
   }
}
(DA)?document.all[cQm].style.background=colOv : (DL)? document.layers[cQm].bgColor=colOv : document.getElementById(cQm).style.background=colOv;
}

function outMenu(qVOut,NumConBOut) {

cQVM=cQV;
cQV=qVOut+NumConBOut;
ndcB=NumConBOut;
ndcQVM=NumConBOut+qVOut;

VZ="barra"+ndcB; // Voce Zero


for (b=NumConBOut+1; b<=cQV; b++) {
qualeVoceB="barra"+b;
(DA)?document.all[qualeVoceB].style.background=cVM : (DL)? document.layers[qualeVoceB].bgColor=cVM : document.getElementById(qualeVoceB).style.background=cVM; //torna colore originario
}
CmB=setTimeout('cB()',tC); 
}

function cB() { // chiudi barra
if (cQVM>ndcB) {
qualeVoceCh="barra"+cQVM;
(DA)?document.all[qualeVoceCh].style.visibility="hidden" : (DL)? document.layers[qualeVoceCh].visibility="hide" : document.getElementById(qualeVoceCh).style.visibility="hidden";
cQVM--;
setTimeout('cB()',tso);
} else {
(DA)?document.all[VZ].style.background=cMZ : (DL)? document.layers[VZ].bgColor=cMZ : document.getElementById(VZ).style.background=cMZ; //torna colore originario
cQVM=ndcB;
  }
}

function Vai(lnk,tg) {
if (tg=="s") {
self.location.href=lnk;
} else if (tg=="b") {
window.open(lnk,'','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes');
} else if (tg=="p") {
pp=window.open(lnk,'pp','resizable=yes,toolbar=no,location=no,top=50,left=50,width=640,height=480');
pp.focus();
} else if (tg!="" && tg!="s" && tg!="b" && tg!="p") {
top[tg].location.href=lnk;
	}
}