<!--
	$.preLoadImages("images/hp/img_arte_on.png", "images/hp/img_fotografia_on.png", "images/hp/img_lingua_on.png", "images/hp/img_scuola_on.png", "images/doposcuola_home_on.png", "images/corsi_home_on.png", "images/fotografia_home_on.png", "images/laboratori_home_on.png");
	
	$(document).ready(function(){
		$(document).pngFix({
			blankgif: "images/blank.gif"
		});
		
		$("#content").ascensor({
			AscensorName: "content", 
			WindowsFocus: true, 
			WindowsOn: 2, 
			NavigationDirection: "xy", 
			Direction: "y", 
			Navig: false, 
			Link: false, 
			ReturnURL: false, 
			PrevNext: false, 
			CSSstyles: true, 
			KeyArrow: true, 
			keySwitch: false, 
			ReturnCode: false, 
			ChocolateAscensor: true, 
			AscensorMap: "3|3", 
			ContentCoord: "1|1 & 1|3 & 2|2 & 3|1 & 3|3"
		});
		
		$("#parallax").jparallax({
			"mouseport": $("#content2")
		});
		
		$("#parallax > div:lt(4) img:first-child").hover(function(){
			 $(this).attr("src", "images/hp/" + $(this).attr("id") + "_on.png");
		}, function(){
			 $(this).attr("src", "images/hp/" + $(this).attr("id") + "_off.png");
		});
		
		$("#parallax a").click(function(){
			$("#footer").hide();
		});
		
		$(".contentLink1").hover(function(){
			$("img", this).attr("src", "images/" + $("img", this).attr("id") + "_on.png");
		}, function(){
			$("img", this).attr("src", "images/" + $("img", this).attr("id") + "_off.png");
		}).click(function(){
			$("#footer").show();
		});
		
		$(".a_fancy").fancybox({
			"frameWidth": 930, 
			"frameHeight": 650
		});
		
		$(".a_thumb").fancybox();
	});
	
	function mailNoSpam(user, dominio){
		document.location.href = "mailto:" + user + "@" + dominio;
	}
	
	function trim(stringa){
		while(stringa.substring(0, 1) == " ")
			stringa = stringa.substring(1, stringa.length);
		
		while(stringa.substring(stringa.length-1, stringa.length) == " ")
			stringa = stringa.substring(0, stringa.length-1);
		
		return stringa;
	}
	
	function checkForm(){
		var goodEmail = document.forms[0].mail.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		
		if(trim(document.forms[0].nome.value) == ""){
			alert("Attenzione!\nIl campo NOME non è stato compilato correttamente.");
			document.forms[0].nome.focus();
		}
		else if(trim(document.forms[0].cognome.value) == ""){
			alert("Attenzione!\nIl campo COGNOME non è stato compilato correttamente.");
			document.forms[0].cognome.focus();
		}
		else if(!goodEmail){
			alert("Attenzione!\nIl campo E-MAIL non è stato compilato correttamente.");
			document.forms[0].mail.focus();
		}
		else if(trim(document.forms[0].richiesta.value) == ""){
			alert("Attenzione!\nIl campo RICHIESTA non è stato compilato correttamente.");
			document.forms[0].richiesta.focus();
		}
		else{
			$(document).ajaxStop($.unblockUI);
			
			$.blockUI.defaults.applyPlatformOpacityRules = false;
			
			$.blockUI({
				message: $("#loader")
			});
			
			$.ajax({
				url: "_mail.php", 
				type: "POST", 
				data: "nome=" + document.forms[0].nome.value + "&cognome=" + document.forms[0].cognome.value + "&mail=" + document.forms[0].mail.value + "&richiesta=" + document.forms[0].richiesta.value, 
				cache: false, 
				success: function(html){
					$("#content_mail").show().html(html);
				}, 
				complete: function(html){
					$("#main").css({
						"height": ($("#main").height()+70) + "px"
					});
				}
			});
		}
	}
//-->
