var slideTime = 700;
var floatAtBottom = true;
function adjustLayout(){
	var lHeight = xHeight("left");
	var rHeight = xHeight("right");
	var maxHeight = Math.max(rHeight,lHeight);
	xHeight("wrapper", xClientHeight());
	xHeight("left", maxHeight + xHeight("menubottom") - 1);
	xHeight("right", maxHeight + xHeight("menubottom") - 1);
}

function winOnResize() {
	winOnScroll();
}

function winOnScroll() {
	var y = xScrollTop();
	if (floatAtBottom) {
		y += xClientHeight() - xHeight('menubottom');
	}
	xSlideTo('menubottom', 0, y, slideTime);
}
window.onload = function(){
	adjustLayout();
	winOnResize();
	xAddEventListener(window, 'resize', winOnResize, false);
	xAddEventListener(window, 'scroll', winOnScroll, false);
}

function Modulo(){
//Effettua il controllo sul campo NOME
	if ((document.booking.nome.value == "") || (document.booking.nome.value == "undefined")) {
		alert("Il campo nome è obbligatorio.");
		return false;
	}
	//Effettua il controllo sul campo COGNOME
	else if ((document.booking.cognome.value == "") || (document.booking.cognome.value == "undefined")) {
		alert("Il campo cognome è obbligatorio.");
		return false;
	}
	//Effettua il controllo sul campo E-MAIL
	else if (!email_reg_exp.test(document.booking.email.value) || (document.booking.email.value == "") || (document.booking.email.value == "undefined")) {
		alert("Inserire un email corretta.");
		return false;
	}
	//Effettua il controllo sul campo TELEFONO
	else if (isNaN(document.booking.telefono.value)) {
		alert("Il campo Telefono deve essere numerico.");
		document.booking.telefono.value = "";
		document.booking.telefono.focus();
		return false;
	}
	//Effettua il controllo sul campo MESSAGGIO
	else if ((document.booking.messaggio.value == "") || (document.booking.messaggio.value == "undefined")) {
		alert("Il campo Messaggio è obbligatorio.");
	}
	return true;
}
