////////////////////////////////////////////////////////////////////////
////  Grazie per aver visitato questo listato! Per qualsiasi        ////
////  informazioni scrivere a mail@stefanocorradi.com.              ////
////  Se si utilizza questo codice è necessario avvertirne l'autore ////
////  e citarlo all'interno del listato.                            ////
////  Grazie.                                                       ////
////                                                                ////
////  10-5-2002                                                     ////
////                                                                ////
////  Upgraded by Castalia srl    - 15/5/2002                       ////
////                                16/11/2003                      ////
////                                31/08/2004                      ////
////                                                                ////
////////////////////////////////////////////////////////////////////////


var ie = (document.all) ? 1:0;
numLink = 12;		// numero totale dei link generali
alto = 120;
lato = 10;
altLink = 29; // altezza delle righe 

piu1b = true;
piu2b = true;

collegamenti = new Array(true, true, true, true, true, true, true, true, true, true, true, true);

sottoMenu = new Array(false, false);
// bottoni espandi
var bottEsp = new Array ();

bottEsp[0] = new Image ();
bottEsp[0].src = "http://www.steelchecks.com/images/espandiGrigio.gif"; 
bottEsp[1] = new Image ();
bottEsp[1].src = "http://www.steelchecks.com/images/espandiRosso.gif";

// bottoni chiudi
var bottChiudi = new Array ();

bottChiudi[0] = new Image ();
bottChiudi[0].src = "http://www.steelchecks.com/images/chiudiGrigio.gif"; 
bottChiudi[1] = new Image ();
bottChiudi[1].src = "http://www.steelchecks.com/images/chiudiRosso.gif";

// quadratini
var quadratini = new Array ();

quadratini[0] = new Image ();
quadratini[0].src = "http://www.steelchecks.com/images/blu.gif"; 
quadratini[1] = new Image ();
quadratini[1].src = "http://www.steelchecks.com/images/rosso.gif";

// +/-
var piumeno = new Array ();

piumeno[0] = new Image ();
piumeno[0].src = "http://www.steelchecks.com/images/piu.gif"; 
piumeno[1] = new Image ();
piumeno[1].src = "http://www.steelchecks.com/images/meno.gif";

chiuso = true;

// apertura o chiusura del menu ***
function apri ()
{
	if(chiuso)
	{
			sottoMenu[0] = true;
			document.piu1.src = piumeno[1].src; // meno
			piu1b = false;
			chiuso = false;
			document.espandi.src = bottChiudi[0].src; // chiudi grigio
	}
	else
	{
			sottoMenu[0] = false;
			document.piu1.src = piumeno[0].src;
			piu1b = true;
			chiuso = true;		
			document.espandi.src = bottEsp[0].src;	
	}
	posiziona();
}


// 
function espandi_chiudi (sopra)
{
	if(chiuso)
	{
		if(sopra)
		{
			document.bott12.src = quadratini[1].src;
			document.espandi.src = bottEsp[1].src;
		}
		else
		{
			document.bott12.src = quadratini[0].src;
			document.espandi.src = bottEsp[0].src;
		}
	}
	else
	{
		if(sopra)
		{
			document.bott12.src = quadratini[1].src;
			document.espandi.src = bottChiudi[1].src;
		}
		else
		{
			document.bott12.src = quadratini[0].src;
			document.espandi.src = bottChiudi[0].src;
		}
	}
}


div = new Array();

// cambia lo stato del sottomenu n
function sottoM(n)
{
	if(!sottoMenu[n])
	{
		sottoMenu[n] = true;
	}
	else
	{
		sottoMenu[n] = false;
	}
	posiziona();
}

// apre il sottomenu n
function sottoMA(n)
{
	sottoMenu[n] = true;
	posiziona();
}

// crea la stringa di stato per ogni link
function generaDiv()
{
	if(ie)
	{
		for(c = 0;c < numLink; c++)
		{
			div[c] = "document.all.link"+(c+1)+".style";
		}
	}
	else
	{
		for(c = 0;c < numLink; c++)
		{
			div[c] = "document.getElementById('link"+(c+1)+"').style";
		}
	}
}

// setta lo stato dei collegamenti dipendentemente dallo stato dei menu
// esegue un loop e mostra o meno i collegamenti stessi  ***
function posiziona()
{
	if(!sottoMenu[0])
	{
		collegamenti[5] = false;
		collegamenti[6] = false;
		collegamenti[7] = false;
		collegamenti[8] = false;
	}
	else
	{
		collegamenti[5] = true;
		collegamenti[6] = true;
		collegamenti[7] = true;
		collegamenti[8] = true;
	}
	cc = 0;
	for(c = 0;c < numLink; c++)
	{
		if(collegamenti[c])
		{
			cc++;
			posiz = alto + altLink * cc;
			eval(div[c] + ".top = posiz");
			eval(div[c] + ".left = lato");
			mostra = "visible";
		}
		else
		{
			mostra = "hidden";
		}
		eval(div[c]+".visibility = mostra");
	}
}

// crea la stringa oggiE
giorni = new Array("sunday",
						 "monday",
						 "tuesday",
						 "wednesday",
						 "thursday",
						 "friday",
						 "saturday");

mesi = new Array("january", 
					  "february",
					  "march",
					  "april",
					  "may",
					  "june",
					  "july",
					  "august",
					  "september",
					  "october",
					  "november",
					  "december");
orario = new Date();
ggCifra = orario.getDate();
ggNumero = orario.getDay();
ggNome = giorni[ggNumero];
mmCifra = orario.getMonth();
mmNome = mesi[mmCifra];

oggiE = "Today is:" + "&nbsp;" + ggNome + "&nbsp;" + "&nbsp;" + mmNome + " " + ggCifra + "," + 
         " " + orario.getFullYear() +
			" - Last update:" + "&nbsp;" + mmNome + " " + ggCifra + "," + 
         " " + orario.getFullYear()
			" - <a href = 'mailto:staff@steelchecks.com' id = mail>staff@steelchecks.com</a>";

// impostazioni dello schermo
var larghezzaSchermo = screen.availWidth;	
var altezzaSchermo = screen.availHeight;
var larghezzaNuovaFin;
var altezzaNuovaFin;

// apertura di una finestra
function apriFinestra(url, target, larghezzaNuovaFin,  altezzaNuovaFin) 
{
	centroX = larghezzaSchermo / 2 - larghezzaNuovaFin / 2;
	centroY = altezzaSchermo / 2 - altezzaNuovaFin / 2;
	window.open(url, target, "width = "+larghezzaNuovaFin+", height = "+altezzaNuovaFin+", screenX = "+centroX+", screenY = "+centroY+", left = "+centroX+", top = "+centroY)
}