
// Oggetto livello
function ObjLivello(livello){
  var objLiv,objLivss,objLivello,livTop,livHeight,livLeft,livWidth,nome;     
  this.nome=livello;          
  if (document.getElementById)
  { // NN>=6; MSIE>5	
    if (eval("document.getElementById('" + livello + "')"))
    {	   	    
		  objLiv=eval("document.getElementById('" + livello + "')");
		  this.objLivss=objLiv;
		  this.livTop=parseInt(objLiv.style.top);
		  this.livHeight=parseInt(objLiv.offsetHeight);
		  this.livLeft=parseInt(objLiv.style.left);
		  this.livWidth=parseInt(objLiv.offsetWidth);			  		  
		  this.objLivello=objLiv.style;
	  }//fine if		
	}	
	else if (document.layers)
	{ // NN<6	
	  if (eval("document.layers['" + livello + "']"))
	  {
		  objLiv=eval("document.layers['" + livello + "']");
		  this.objLivss=objLiv;
		  this.livTop=parseInt(objLiv.top);
			this.livHeight=parseInt(objLiv.clip.height);
		  this.livLeft=parseInt(objLiv.left);
		  this.livWidth=parseInt(objLiv.clip.width);			  
		  this.objLivello=objLiv;		  
	  }//fine if
	}
	else if (document.all)
	{ // MSIE		
	  if (eval("document.all['" + livello + "']"))
	  {
		  objLiv=eval("document.all['" + livello + "']");
		  this.objLivss=objLiv;
		  this.livTop=parseInt(objLiv.style.top);
		  this.livHeight=parseInt(objLiv.offsetHeight);
		  this.livLeft=parseInt(objLiv.style.left);
		  this.livWidth=parseInt(objLiv.offsetWidth);		  
		  this.objLivello=objLiv.style;		  
	  }//fine if		
	}
		
}//fine function

// restituisce il riferimento del livello "livello"
function getObjLivello(livello)
{
    
  var ilLivello,oggettoLivello;   
  
  oggettoLivello= new ObjLivello(livello);
  ilLivello=oggettoLivello.objLivello;
   
  return ilLivello;
}//fine function

function help()
{
	var help_livello = getObjLivello("help");		
	if(help_livello.visibility=="visible")
	{
		help_livello.visibility="hidden";
	}
	else
	{
		help_livello.visibility="visible";
	}
}//fine function

function menuOnOff(strLivello)
{
	var menu_livello = getObjLivello(strLivello);		
	if(menu_livello.visibility=="visible")
	{
		menu_livello.visibility="hidden";
	}
	else
	{
		menu_livello.visibility="visible";
	}
}//fine function


//Oggetto di tipo "livello interno"
function objInnerLivello(livOut, livIn)
{		
	var objInLiv, objInLivss, objInLivello;
	
	if (document.getElementById)
	{ // NN>=6; MSIE>5	
		if (eval("document.getElementById('" + livIn + "')"))
		{	   	    
			objInLiv=eval("document.getElementById('" + livIn + "')");
			this.objInLivss=objInLiv;		 			  		  
			this.objInLivello=objInLiv.style;
		}//fine if		
	}	
	else if (document.layers)
	{ // NN<6	
	  if (eval("document.layers['" + livOut + "']"))
	  {
		  objInLiv=eval("document.layers['" + livOut + "'].document.layers['" + livIn + "']");
		  this.objInLivss=objInLiv;		 			  
		  this.objInLivello=objInLiv;		  
	  }//fine if
	}
	else if (document.all)
	{ // MSIE		
	  if (eval("document.all['" + livOut + "']"))
	  {
		  objInLiv=eval("document.all['" + livOut + "'].document.all['" + livIn + "']");
		  this.objInLivss=objInLiv;		 		  
		  this.objInLivello=objInLiv.style;		  
	  }//fine if		
	}
	
}

//Restituisce il riferimento al livello interno "livIn"
function getObjInnerLivello(livOut, livIn)
{    
  var innerLivello,oggettoInnerLivello;   
  
  oggettoInnerLivello= new objInnerLivello(livOut, livIn);
  innerLivello=oggettoInnerLivello.objInLivello;
   
  return innerLivello;
}//fine function


//Oggetto "dimensioni dello schermo"
function ScreenSize()
{
	var width,height;
		
	this.width=screen.width;
	this.height=screen.height;
}

//Oggetto "dimensioni area utile dl browser"
//Riferito alle misure del "body" o "document" della pagina HTML
function DocumentSize()
{
	//var width, height;
	var vWidth=0;
	var vHeight=0;

	if(document.getElementById)
	{ // NN>=6; MSIE>5
		this.vWidth = window.innerWidth;
		this.vHeight = window.innerHeight;				
	}
	else if (document.layers)
	{ // NN<6
		this.vWidth = window.innerWidth;
		this.vHeight = window.innerHeight;
	} 
	else if (document.all)
	{ // MSIE
		this.vWidth = document.body.clientWidth;
		this.vHeight = document.body.clientHeight;
	}	
}
