var i_tappo = 0;
function dimensionaDivBox() {
	var inner_height;
	var page_height;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight;
	i_tappo++;
	if (test1 > test2) {// all but Explorer Mac
		page_height = document.body.scrollHeight;
	} else {// Explorer Mac; would also work in Explorer 6 Strict, Mozilla and Safari
		page_height = document.body.offsetHeight;
	}
	if (self.innerHeight) {// all except Explorer
		inner_height = self.innerHeight;
	} else
	if (document.documentElement && document.documentElement.clientHeight) {// Explorer 6 Strict Mode
		inner_height = document.documentElement.clientHeight;
	} else
	if (document.body) {// other Explorers
		inner_height = document.body.clientHeight;
	}
	//alert("scroll:" + document.body.scrollHeight + "; client:" + document.documentElement.clientHeight);
	if (i_tappo < 20) {
		// risoluzione consigliata: 1024x768. 676 641 640
		if (inner_height < 640) {
			document.getElementById("divbox").style.height = (page_height - 362) + "px";
			document.getElementById("td_bodyleft").style.height = (page_height - 242) + "px";
			document.getElementById("td_boxleft").style.height = (page_height - 331) + "px";
			document.getElementById("td_boxright").style.height = (page_height - 331) + "px";
			//alert("divbox:" + document.getElementById("divbox").style.height + "; td_bodyleft:" + document.getElementById("td_bodyleft").style.height + "; td_boxleft:" + document.getElementById("td_boxleft").style.height + "; td_boxright:" + document.getElementById("td_boxright").style.height);
		} else {
			document.getElementById("divbox").style.height = (inner_height - 362) + "px";
			document.getElementById("td_bodyleft").style.height = (inner_height - 242) + "px";
			document.getElementById("td_boxleft").style.height = (inner_height - 331) + "px";
			document.getElementById("td_boxright").style.height = (inner_height - 331) + "px";
			//alert("divbox:" + document.getElementById("divbox").style.height + "; td_bodyleft:" + document.getElementById("td_bodyleft").style.height + "; td_boxleft:" + document.getElementById("td_boxleft").style.height + "; td_boxright:" + document.getElementById("td_boxright").style.height);
		}
	}
}
