/* ****** Sezione personalizzabile ******* */

var QM=6;   // quanti menu 

var AM=16; // altezza dei menu

var qV1 = 2; // Voci per la tendina 1
var qV2 = 7; // Voci per la tendina 2
var qV3 = 1; // Voci per la tendina 3
var qV4 = 1; // Voci per la tendina 4
var qV5 = 3; // Voci per la tendina 5
var qV6 = 3; // Voci per la tendina 6

var LT= new Array();
LT[0]=0;
LT[1]=90; // Larghezza Tendina 1 
LT[2]=90; // Larghezza Tendina 2
LT[3]=90; // ecc.
LT[4]=90;
LT[5]=90;
LT[6]=90;

var tC=500; //  tempo di chiusura tendina dopo il mouseover
var tso=30; //  tempo di successione scomparsa fra una voce e l'altra
var cMZ="#33B2D6";        // colore menu "zero", cioe', quello che costituisce la barra
var cOmZ="#000000";      // colore menu zero al mouseOver
var cVM="#0066CC";      // colore voci menu  
var cOV="#DC0A09";     // 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=80;    // distanza dall'alto
var dsxP=205; // distanza da sx del Primo Menu
var dMo=1;  // 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('Home','SimplyTech','Explorer');
Voci[2]=new Array('Software','DiskLock','SmartLock','Click!','RemoteHelper','ETRemover','L2MRemover','SmartScan');
Voci[3]=new Array('Hardware','Desulfatron');
Voci[4]=new Array('Forum','Forum');
Voci[5]=new Array('Servizi','Freeware','Data recovery','Solutions on demand');
Voci[6]=new Array('Cont@ct','Chi siamo','Help On Line','E-mail');

var Link=new Array();
Link[0]=0;
Link[1]=new Array('','http://www.simplytech.it/home.htm','http://www.simplytech.it/explorer');
Link[2]=new Array('','http://www.simplytech.it/disklock/index.htm','http://www.simplytech.it/smartlock/index.htm','http://www.simplytech.it/click/index.htm','http://www.simplytech.it/RemoteHelper/index.htm','http://www.simplytech.it/ETRemover/index.htm','http://www.simplytech.it/L2MRemover/index.htm','http://www.simplytech.it/SmartScan/index.htm');
Link[3]=new Array('','http://www.simplytech.it/desulfatron/index.htm');
Link[4]=new Array('','http://www.simplytech.it/forum/');
Link[5]=new Array('','http://www.simplytech.it/freeware.htm','http://www.simplytech.it/data.htm','http://www.simplytech.it/solod.htm');
Link[6]=new Array('','http://www.simplytech.it/who.htm','http://www.simplytech.it/chat/','mailto:info@simplytech.it');

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','b'); // 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','s','s','s','s','s'); // relativamente al secondo menu (come sopra)
Trg[3]=new Array('','s');
Trg[4]=new Array('','s');
Trg[5]=new Array('','s','s','s');
Trg[6]=new Array('','s','s','s');

var TND= new Array(qV1,qV2,qV3,qV4,qV5,qV6);

/* ****** Fine Sezione personalizzabile ******* */

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','toolbar=no,location=no,top=50,left=50,width=300,height=300');
pp.focus();
} else if (tg!="" && tg!="s" && tg!="b" && tg!="p") {
top[tg].location.href=lnk;
	}
}

var CU = new Array(); // fra un momento aggiunge Cento Unita' all'ID di ciascun menu 
CU[0]=0;
dispD=dsxP; // diverra' "Disponi Menu a dx"
diT=0; // decide indice tendine tendine (array TND) 
for (ndc=0; ndc<QM; ndc++) { // "ndc" = numero di comodo
CU[CU.length]=CU[ndc]+100;
uni=ndc+1 // "ndc" da adesso, anziche' da zero, inizia da 1; "uni" sta per "unita'".
IDb="barra"+CU[uni]; // identificativo di ciascuna barra
dispD=dispD+dMo+LT[ndc];
ddx=dispD-dMo; // Disponi Menu a dx
qV="qV"+uni;
cu="CU["+uni+"]";


(DL)? document.writeln('<layer id="'+IDb+'" left="'+ddx+'" top="'+dA+'" width="'+LT[uni]+'" height="'+AM+'" bgcolor="'+cMZ+'" visibility="show" onmouseover="Overa('+qV+','+cu+',0,cOmZ);" onmouseout="outMenu('+qV+','+cu+');"><table width="'+LT[uni]+'" border="'+BrdB+'" cellspacing="'+CspB+'" cellpadding="'+CpdB+'" height="'+AM+'"><tr align="'+aTb+'" valign="middle"><td><a href="javascript:Vai(\''+Link[uni][0]+'\',\''+Trg[uni][0]+'\');" class="bar">'+Voci[uni][0]+'</a></td></tr></table></layer>') : document.writeln('<div id="'+IDb+'" style="position:absolute; width:'+LT[uni]+'px; height: '+AM+'px; background-color:'+cMZ+'; left: '+ddx+'px; top: '+dA+'; visibility: visible" onmouseover="Overa('+qV+','+cu+',0,cOmZ);" onmouseout="outMenu('+qV+','+cu+');" onclick="Vai(\''+Link[uni][0]+'\',\''+Trg[uni][0]+'\');"><table width="'+LT[uni]+'" border="'+BrdB+'" cellspacing="'+CspB+'" cellpadding="'+CpdB+'" height="'+AM+'"><tr align="'+aTb+'" valign="middle"><td style="cursor: pointer"><a class="bar" onFocus="this.blur();">'+Voci[uni][0]+'</a></td></tr></table></div>');

dispB=dA; // diverra' "Disponi Menu verso il Basso"
for (ndcV=0; ndcV < TND[diT]; ndcV++) { // "ndcV" = numero di comodo per le voci delle tendine.
uniV=ndcV+1 // "uniV" da adesso, anziche' da zero, inizia da 1.
IDb="barra"+(CU[uni]+uniV); // identificativo di ciascuna voce della tendina
dispB=dispB+dMv+AM; // Disponi Menu verso il Basso


(DL)? document.writeln('<layer id="'+IDb+'" left="'+ddx+'" top="'+dispB+'" width="'+LT[uni]+'" height="'+AM+'" bgcolor="'+cVM+'" visibility="hide" onmouseover="Overa('+qV+','+cu+','+uniV+',cOV);" onmouseout="outMenu('+qV+','+cu+');"><table width="'+LT[uni]+'" border="'+BrdV+'" cellspacing="'+CspV+'" cellpadding="'+CpdV+'" height="'+AM+'"><tr align="'+aTv+'" valign="middle"><td><a href="javascript:Vai(\''+Link[uni][uniV]+'\',\''+Trg[uni][uniV]+'\');" onclick="setTimeout(\'cB()\',tC);" class="stbar">'+Voci[uni][uniV]+'</a></td></tr></table></layer>') : document.writeln('<div id="'+IDb+'" style="position:absolute; width:'+LT[uni]+'px; height: '+AM+'px; background-color:'+cVM+'; left: '+ddx+'px; top: '+dispB+'; visibility: hidden" onmouseover="Overa('+qV+','+cu+','+uniV+',cOV);" onmouseout="outMenu('+qV+','+cu+');" onclick="Vai(\''+Link[uni][uniV]+'\',\''+Trg[uni][uniV]+'\');"><table width="'+LT[uni]+'" border="'+BrdV+'" cellspacing="'+CspV+'" cellpadding="'+CpdV+'" height="'+AM+'"><tr align="'+aTv+'" valign="middle"><td style="cursor: pointer"><a class="stbar" onFocus="this.blur();">'+Voci[uni][uniV]+'</a></td></tr></table></div>');
}
diT++;
}
