//dimensioni finestra contenitore
function DimensioniFinestra(larghezza)
{
  var larghezzaFinestra = 0;
  
  if (isNaN(window.scrollY))
    larghezzaFinestra = document.body.clientWidth;
  else
    larghezzaFinestra = window.innerWidth;
  
  if (larghezzaFinestra < 1200)
  {
    //risoluzione minore di 1280
    
    /*
    if (isNaN(window.scrollY))
  	{
      //IE
      document.getElementById("home").style.width = larghezzaFinestra + "px";
      document.getElementById("home").style.position = "absolute";
      document.getElementById("home").style.left = "0px";
      document.getElementById("home").style.top = "-150px";
      document.getElementsByName("home")[0].style.width = larghezzaFinestra + "px";
      document.getElementsByName("home")[0].style.position = "absolute";
      document.getElementsByName("home")[0].style.left = "0px";
      document.getElementsByName("home")[0].style.top = "-150px";
      return (larghezza ? document.body.clientWidth + 300 : document.body.clientHeight + 152);
  	}
  	else
  	{
      //altri
      document.getElementById("home").style.width = larghezzaFinestra + "px";
      document.getElementById("home").style.position = "absolute";
      document.getElementById("home").style.left = "0px";
      document.getElementById("home").style.top = "-75px";
      document.getElementsByName("home")[0].style.width = larghezzaFinestra + "px";
      document.getElementsByName("home")[0].style.position = "absolute";
      document.getElementsByName("home")[0].style.left = "0px";
      document.getElementsByName("home")[0].style.top = "-75px";
  	 	//return (larghezza ? window.innerWidth + 300 : window.innerHeight + 152);
  	 	return (larghezza ? window.innerWidth : window.innerHeight);
  	}
  	*/
  }
  
  if (isNaN(window.scrollY))
	{
	  return (larghezza ? document.body.clientWidth : document.body.clientHeight);
	}
	else
	{
	 	return (larghezza ? window.innerWidth : window.innerHeight);
	}
}

//posizionamento blocchi pagina
function PosizionaBlocco(blocco, larghezzaBlocco, altezzaBlocco)
{
	var bloccoPosizioneY = 0;
	var bloccoPosizioneX = 0;
	if (isNaN(window.scrollY))
	{
		  bloccoPosizioneY = parseFloat(document.body.scrollTop + ((document.body.clientHeight - altezzaBlocco) / 2));
    	bloccoPosizioneX = ((document.body.clientWidth - larghezzaBlocco) / 2);
	}
	else
	{
    	bloccoPosizioneY = parseFloat(window.scrollY + ((window.innerHeight - altezzaBlocco) / 2));
    	bloccoPosizioneX = ((window.innerWidth - larghezzaBlocco) / 2);
	}
  
  	blocco.style.top = bloccoPosizioneY;
  	blocco.style.left = bloccoPosizioneX;
}

