
//		window.addEvent('domready', function(){
//			var mySlide = new Fx.Slide('top-panel');
//			mySlide.hide(); 
//		
//			$('toggle').addEvent('click', function(e){
//				e = new Event(e);
//				mySlide.toggle();
//				e.stop();
//			});
//		});
Si2Email = {
	d: '@' 
};
function we(n,d,id){
	var e = n + Si2Email.d + d;
	jQuery("#" + id).html(e.link("mailto:" + e));
}
		jQuery(document).ready(function(){
		
			jQuery(".btn-slide").click(function(){
				jQuery("#panel").slideToggle("slow");
				jQuery(this).toggleClass("active"); return false;
			});
			
			 
		});


		function ControlloEmail(mail){
				var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
				if (!espressione.test(mail))
				{
				    alert("La mail inserita non è valida!");
					return false;
				}else{
					return true;
				}				
		}
		
		
		/********************PER NEWSLETTER************************/
        function validateNewsletter(form) {
						
			//if ($('#Accetto').val() == 0 ) {
			//alert("Se non si accetta il trattamento dei dati personali richiesti, non è possibile effettuare l'iscrizione alla newsletter!");
			//$('#Accetto').focus()
			//return false; }
			
			//alert($('#Accetto').val());
			//return false;
			
			//if ($('#Nome').val() == "") {
//			alert("Campo Nome obbligatorio!");
//			$('#Nome').focus()
//			return false; }
			
			//if ($('#Cognome').val() == "") {
//			alert("Campo Cognome obbligatorio!");
//			$('#Cognome').focus()
//			return false; }
			
			if ($('#EMail').val() == "") {
				alert("Campo EMail obbligatorio!");
				$('#EMail').focus()
				return false; 
			}
			
			if ($('#EMail').val() != "") {
				valoreEmail=$('#EMail').val()
				ControlloEmail(valoreEmail)
			}


			if(window.document.getElementById("Accetto1_0").checked ==true)
			{
				alert("E\' obbligatorio accettare l\' informativa sulla privacy!")
				$('#Accetto1_0').focus()
				return false; 
			}

			//if ($('#SMS').val() == "") {
//			alert("Campo Cellulare obbligatorio!");
//			$('#SMS').focus()
//			return false; }
			
														
			if (window.confirm('Confermi la registrazione alla newsletter?')==false) {
			return false;}
			return true;
		}
		
		/******************PER PRENOTAZIONE********************/

        function validate(form) {
						
			if ($('#Nome').val() == "") {
			alert("Campo Nome obbligatorio!");
			$('#Nome').focus()
			return false; }
			
			if ($('#Cognome').val() == "") {
			alert("Campo Cognome obbligatorio!");
			$('#Cognome').focus()
			return false; }
			
			if ($('#EMail').val() == "") {
			alert("Campo EMail obbligatorio!");
			$('#EMail').focus()
			return false; }
			else
			{
				ControlloEmail($('#EMail').val())
			}
			
			if ($('#SMS').val() == "") {
			alert("Campo SMS obbligatorio!");
			$('#SMS').focus()
			return false; }
			
			if ($('#Data').val() == "") {
			alert("Campo Data obbligatorio!");
			$('#Data').focus()
			return false; }
			
			if ($('#NPersone').val() == "") {
			alert("Campo n Persone obbligatorio!");
			$('#NPersone').focus()
			return false; }
							
			if(window.document.getElementById("Accetto1_0").checked ==true)
			{
				alert("E\' obbligatorio accettare l\' informativa sulla privacy!")
				$('#Accetto1_0').focus()
				return false; 
			}
							
			if (window.confirm('Confermi la prenotazione?')==false) {
			return false;}
			return true;
		}




        function validateCamere(form) {
						
			if ($('#Cliente').val() == "") {
				alert("Campo Cliente obbligatorio!");
				$('#Cliente').focus()
				return false; 
			}
			
			if ($('#Telefono').val() == "") {
				alert("Campo Cellulare obbligatorio!");
				$('#Telefono').focus()
				return false; 
			}
			
			if ($('#EMail').val() == "") {
				alert("Campo EMail obbligatorio!");
				$('#EMail').focus()
				return false; 
			}
			else
			{
				ControlloEmail($('#EMail').val())
			}
			
			if ($('#giorno').val() == "" || $('#mese').val() == "" || $('#anno').val() == "") {
				alert("Campo Data arrivo obbligatorio!");
				$('#giorno').focus()
				return false; 
			}


			if ($('#giorno').val() > 32) {
				alert("Campo Giorno Data non e\' valido!");
				$('#giorno').focus()
				return false; 
			}

			if ($('#mese').val() > 12 || $('#mese').val() < 1) {
				alert("Campo Mese Data non e\' valido!");
				$('#mese').focus()
				return false; 
			}

			if ( $('#anno').val() < 2010) {
				alert("Campo Anno Data non e\' valido!");
				$('#anno').focus()
				return false; 
			}

			
			if ($('#Notti').val() == "" || $('#Notti').val() == "0") {
			alert("Campo n. Notti obbligatorio!");
			$('#Notti').focus()
			return false; }
			
			
			
			if ($('#Persone').val() == "" || $('#Persone').val() == "0") {
			alert("Campo n. Persone obbligatorio!");
			$('#Persone').focus()
			return false; }
							
			if(window.document.getElementById("Accetto1_0").checked ==true)
			{
				alert("E\' obbligatorio accettare l\' informativa sulla privacy!")
				$('#Accetto1_0').focus()
				return false; 
			}
							
			if (window.confirm('Confermi la prenotazione della Camera?')==false) {
			return false;}
			return true;
		}



		function cambiaimg(img) {
			window.document.getElementById("IMGLaterale").src='images/RistoranteMenu/' + img
		}		
		
		function apriDiv(cosa)
		{
			if(window.document.getElementById(cosa).style.display=="none")
			{
				/*
				ultimo=window.document.getElementById("divnascosto").value

				if(ultimo!="")
				{window.document.getElementById(ultimo).style.display="none";}
				*/
				window.document.getElementById(cosa).style.display="block";
			}
			else
			{
				window.document.getElementById(cosa).style.display="none";
			}
			
				window.document.getElementById("divnascosto").value=cosa;
		}

