// copyright 2008 mauro gallo web creations
var pulsanti = new Array(0, 0, 0, 0, 0, 0); // 0 = ready; 1 = exploding; 2 = imploding


function centraVert() {
	var altezzaClient = null;
	if (window.innerHeight) {
		altezzaClient = window.innerHeight;
	}
	else {
		altezzaClient = document.documentElement.clientHeight;
	}
	var topPos = (altezzaClient - 500) / 2;
	if (topPos < 60)
		topPos = 60;
	var container = document.getElementById("container");
	var bio = document.getElementById("bio");
	container.style.top = topPos + "px";
	bio.style.top = (topPos - 40) + "px";
	var heightFooter = (altezzaClient - (topPos + 380));
	if (heightFooter < 180)
		heightFooter = 180;
	var footer = document.getElementById("footer");
	footer.style.height = heightFooter + "px";
	var topLogo = heightFooter - 140;
	var logo = document.getElementById("logo");
	logo.style.paddingTop = topLogo + "px";
	//alert("topLogo = " + topLogo);
}

function menuExpl(imgId, position, imgNew, wNew, start) {
	var button = document.getElementById(imgId);
    if (start) {
		pulsanti[position] = 1;
		button.src = imgNew;
	}
	if (pulsanti[position] == 1) {
		var w = button.width;
		w += 2;
		if (w > wNew) {
			button.width = wNew;
			pulsanti[position] = 0;
		}
		else {
			button.width = w;
			setTimeout("menuExpl('" + imgId + "', " + position + ", '" + imgNew + "', " + wNew + ", false)", 40);
		}
	}
}

function menuImpl(imgId, position, imgNew, wNew, start) {
    var button = document.getElementById(imgId);
    if (start) {
		pulsanti[position] = 2;
		button.src = imgNew;
	}
	if (pulsanti[position] == 2) {
		var w = button.width;
		w -= 2;
		if (w < wNew) {
			button.width = wNew;
			pulsanti[position] = 0;
		}
		else {
			button.width = w;
			setTimeout("menuImpl('" + imgId + "', " + position + ", '" + imgNew + "', " + wNew + ", false)", 40);
		}
	}
}


