// gestioneLivelli1.0
// --------------------

// imposta variabile di controllo avvenuto caricamento
var gestioneLivelli = 1;

// verifica avvenuto caricamento delle librerie necessarie
// -------------------------------------------------------
if (typeof(checkBrowser)=="undefined") alert("Attenzione!\n--------------\n La libreria \"gestioneLivelli\" necessita della libreria \"checkBrowser\".");

// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// utility di gestione livelli (inizio Codice)
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function getLayHeight(layObj)
{
	// ---------------------------------------------------------
	// restituisce l'altezza del livello ricevuto come parametro
	// ---------------------------------------------------------
	var theClientBrowser = new String(); // <-- Contiene il browser utilizzato dall'utente
	theClientBrowser = clientBrowser(); // <-- funzione istanziata in "checkBrowser.js"
	if (theClientBrowser=="netscape4.x") return layObj.clip.height;
	else return layObj.offsetHeight;
};

function moveLayBy(layObj, x, y)
{
	// ------------------------------------------------
	// sposta  le  coordinate   del   livello  ricevuto 
	// come parametro nella misura specificata in x e y
	// ------------------------------------------------
	var stringX, stringY = new String();
	var theClientBrowser = new String(); // <-- Contiene il browser utilizzato dall'utente
	theClientBrowser = clientBrowser(); // <-- funzione istanziata in "checkBrowser.js"
	if (theClientBrowser=="netscape4.x")
	{
		layObj.top += y;
		layObj.left += x;
	}
	else
	{
		//layObj.style.posTop += y;	<-- Funziona solo con Explorer
		//layObj.style.posLeft += x; <-- Funziona solo con Explorer
		layObj.style.top=(parseInt(layObj.style.top)+y).toString()+"px"; // <-- Testato su Navigator6, Opera, Explorer
		layObj.style.left=(parseInt(layObj.style.left)+x).toString()+"px"; // <-- Testato su Navigator6, Opera, Explorer
	};
};

function moveLayTo(layObj, x, y)
{
	// ---------------------------------
	// sposta  il livello  ricevuto come 
	// parametro  alle  coordinate x e y
	// ---------------------------------
	var theClientBrowser = new String(); // <-- Contiene il browser utilizzato dall'utente
	theClientBrowser = clientBrowser(); // <-- funzione istanziata in "checkBrowser.js"
	if (theClientBrowser=="netscape4.x")
	{
		layObj.top = y;
		layObj.left = x;
	}
	else
	{
		//layObj.style.posTop = y;	<-- Funziona solo con Explorer
		//layObj.style.posLeft = x;	<-- Funziona solo con Explorer
		layObj.style.top = y.toString()+"px"; // <-- Testato su Navigator6, Opera, Explorer
		layObj.style.left = x.toString()+"px"; // <-- Testato su Navigator6, Opera, Explorer
	};
};

function getLayTop(layObj)
{
	// -------------------------------------------------
	// restituisce la voordinata y del livello  ricevuto 
	// -------------------------------------------------
	var theClientBrowser = new String(); // <-- Contiene il browser utilizzato dall'utente
	theClientBrowser = clientBrowser(); // <-- funzione istanziata in "checkBrowser.js"
	if (theClientBrowser=="netscape4.x")
	{
		return layObj.top;
	}
	else
	{
		return parseInt(layObj.style.top);
	};
};

function getLayLeft(layObj)
{
	// -------------------------------------------------
	// restituisce la voordinata x del livello  ricevuto 
	// -------------------------------------------------
	var theClientBrowser = new String(); // <-- Contiene il browser utilizzato dall'utente
	theClientBrowser = clientBrowser(); // <-- funzione istanziata in "checkBrowser.js"
	if (theClientBrowser=="netscape4.x")
	{
		return layObj.left;
	}
	else
	{
		return parseInt(layObj.style.left);
	};
};

// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// utility di gestione livelli (fine Codice)
// \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\