var larghezza = "";
var altezza = "";

	function Inizializza() {
		if (document.all) {
           larghezza = TextScroll.offsetWidth;
           altezza = TextScroll.offsetHeight;
           setInterval("TextScroll_IE()", 1);
           TextScroll.style.visibility = "Visible";
       }
		else if (document.layers) {
           larghezza = document.TextScroll.document.width;
           altezza = document.TextScroll.document.height;
           setInterval("TextScroll_NN()", 1);
           document.TextScroll.visibility = "Show";
       }
		else if(document.getElementById) {
		   larghezza = document.getElementById('TextScroll').style.width;
           altezza = document.getElementById('TextScroll').style.height;
           setInterval("ttsW3()", 1);
           document.getElementById('TextScroll').style.visibility = "visible";
        }
    }
    function TextScroll_IE() {
//		TextScroll.style.pixelLeft = document.body.scrollLeft + document.body.clientWidth - larghezza - 10;
		if (document.body.clientWidth < 994)
			TextScroll.style.pixelLeft = 760;
		else
//			TextScroll.style.pixelLeft = 760 + ((document.body.clientWidth - document.body.scrollLeft - 994)/2);
			TextScroll.style.pixelLeft = 760 + ((document.body.clientWidth - 994)/2);
//      TextScroll.style.pixelTop = document.body.scrollTop + document.body.clientHeight - altezza - 10;
		if (document.body.scrollTop <= 120)
			TextScroll.style.pixelTop = 130;
		else
			TextScroll.style.pixelTop = document.body.scrollTop + 10;
    }
    function TextScroll_NN() {
//       document.TextScroll.left = pageXOffset + window.innerWidth - larghezza - 10;
		if (window.innerWidth < 994)
			document.TextScroll.left = 760;
		else
//		    document.TextScroll.left = 760 + ((window.innerWidth - pageXOffset - 994)/2);
		    document.TextScroll.left = 760 + ((window.innerWidth - 994)/2);
//       document.TextScroll.top = pageYOffset + window.innerHeight - altezza - 10;
		if (pageYOffset <= 120)
			document.TextScroll.top = 130;
		else
	        document.TextScroll.top = pageYOffset + 10;
    }
	function ttsW3() {
//		alert("pXO="+pageXOffset+" lar="+larghezza+" iW="+window.innerWidth);
//		document.getElementById('TextScroll').style.left = pageXOffset + window.innerWidth - parseInt(larghezza,10) - 10;
		if (window.innerWidth < 994)
			document.getElementById('TextScroll').style.left = 760;
		else
//		    document.getElementById('TextScroll').style.left = 760 + ((window.innerWidth - pageXOffset - 994)/2);
		    document.getElementById('TextScroll').style.left = 760 + ((window.innerWidth - 994)/2);
//		document.getElementById('TextScroll').style.top = pageYOffset + window.innerHeight - parseInt(altezza,10) - 10;
		if (pageYOffset <= 120)
			document.getElementById('TextScroll').style.top = 130;
		else
	        document.getElementById('TextScroll').style.top = pageYOffset + 10;
	}
	window.onload = Inizializza;
