/*
// =========================================================

// Configuración del portal y sus efectos.

// =========================================================
*/


// Scripts ejecutados cuando termina la carga de la página.
jQuery(document).ready(function(){

// Alert de prueba
	//alert('Estamos en fase de prueba de nuestro nuevo portal, por favor, si tienen cualquier duda u obserban un comportamiento anormal del mismo, por favor, pónganse en contacto con nosotros en el 986730761 o en info@hotelpuentedelatoja.com. Discuplen las molestias y gracias.');
	
// Fotos del Encabezado
	if (document.location.href == 'http://hotelpuentedelatoja.com/') {
		var timeout_temp = 15000;
	} else {
		var timeout_temp = 5000;
	}
	jQuery('#fotos_pagina').animatedinnerfade({
		speed: 5000,
		timeout: timeout_temp,
		type: 'random',
		containerheight: '260px',
		containerwidth: '575px',
		animationSpeed: 15000,
		animationtype: 'fade',
		bgFrame: 'none',
		controlBox: 'none',
		displayTitle: 'none'
	});

// Efecto deslizante de los contenidos de las ofertas en la página principal.
	jQuery('.post').livequery(function() {
			jQuery(this).hover(
					function(){
						jQuery(".slide_promo", this).stop().animate({top:'40px'},{queue:false,duration:300});
					},
					function() {
						jQuery(".slide_promo", this).stop().animate({top:'150px'},{queue:false,duration:300});
					}
				);
			}
	);

// Efecto deslizante de las ofertas
	jQuery('.promo').scrollable(
			{ size: 2}
		).navigator().autoscroll(
			{
				autoplay: true,
				interval: 5000,
				steps: 2
			}
		).mousewheel().circular();

// Tips superpuestos en el calendario
	jQuery('td.ec3_eventday a.eventday[title]').tooltip('#tip_calendario');
	jQuery('#icos_services img[title]').tooltip({
			tip: '#tip_icos_services',
			effect: 'fade',
			position: 'top left',
	        offset: [22, -10]
	});
	
//Auto-selección de todos los campos de texto inputs
	jQuery('input[type=text]').focus( 
		function() {
			this.select();
		}
	);

	
// Overlay del formulario de reserva
	var triggers = jQuery('#boton_reserva_BTN').overlay({
		expose: {
			color: '#000',
			loadSpeed: 300,
			opacity: 0.8
		},
		closeOnClick: false
	});
	// Reseteo y mostrado de nuevo
	jQuery('#boton_reserva_BTN').click(
			function() {
   				jQuery('#form_reseva').each(
   						function() {
   							this.reset();
   						}
   					);
   				jQuery('#resolucion_envio').hide();
   				jQuery('#wizard_frm_reserva').show();
   		   		jQuery("#enviar_reserva img").hide();
   		   		jQuery("input#btn_enviar").show();
				var numhab = parseInt(jQuery('input#numhab').val());
				var html_formfinal = '';
				if (typeof numhab == 'number' && isFinite(numhab)) {
					for (i=0; i<numhab; i++) {
						var html_tipohab = '<div id=\"hab_'+i+'\"><label for=\"tipohabitacion_'+i+'\" id=\"lbl_tipohabitacion_'+i+'\" class=\"lbl_tipohabitacion\"><span>Tipo:</span><select name=\"tipohabitacion_'+i+'\" id=\"tipohabitacion_'+i+'\" class=\"selectbox tipohabitacion_sel\"><option value=\'--Seleccione--\' selected=\'selected\'>--Seleccione--</option><option value=\'Individual (IND)\'>Individual (IND)</option><option value=\'Doble (DBL)\'>Doble (DBL)</option><option value=\'Triple (TPL)\'>Triple (TPL)</option><option value=\'Cuádruple (CPL)\'>Cuádruple (CPL)</option></select></label><label for=\"tipoocupantes_'+i+'\" id=\"lbl_tipoocupantes_'+i+'\" class=\"lbl_tipoocupantes\"><span>Seleccione modo:</span><select name=\"tipoocupantes_'+i+'\" id=\"tipoocupantes_'+i+'\" class=\"selectbox tipoocupantes_sel\"><option value=1>--- Debe escoger un tipo de habitación</option></select></label><label for=\"opcioncuna_'+i+'\" id=\"lbl_opcioncuna_'+i+'\" class=\"opcioncuna\"><span>Supl. cuna?</span><input type=\"checkbox\" name=\"opcioncuna_'+i+'\" id=\"opcioncuna_'+i+'\"/></label></div>';
						html_formfinal = html_formfinal + html_tipohab;
					}
				} else {
					html_formfinal = ' ';
				}
				jQuery('#form_reserva_opciones').html(html_formfinal);
				jQuery('#fechaentrada').datepicker('setDate', '+0');
				jQuery('#fechasalida').datepicker('setDate', '+1');
			}
		);
	
// Hover de las promos singles para home o reserva
	jQuery('a#btn_home').hover(
			function(){
				jQuery('span#texto_bottom').html("Principal");
			},
			function(){
				jQuery('span#texto_bottom').html(" ");
			}				
		);

	jQuery('a#boton_reserva_BTN').hover(
			function(){
				jQuery('span#texto_bottom').html("Reservar");
			},
			function(){
				jQuery('span#texto_bottom').html(" ");
			}				
		);
	
// Menús pequeños, over para visualización de función
	jQuery('a#menup_correo_i').hover(
			function(){
				jQuery('#menup_correo_t').css('display', 'block');
			},
			function(){
				jQuery('#menup_correo_t').css('display','none');
			}
		);
	
	jQuery('a#menup_quenesomos_i').hover(
			function(){
				jQuery('#menup_quenesomos_t').css('display', 'block');
			},
			function(){
				jQuery('#menup_quenesomos_t').css('display','none');
			}
		);

	jQuery('a#menup_otempo_i').hover(
			function(){
				jQuery('#menup_otempo_t').css('display', 'block');
			},
			function(){
				jQuery('#menup_otempo_t').css('display','none');
			}
		);
	
// Despliegue y recogida de los menús superiores
	jQuery('.toggle_superior').click (
			function(){
				jQuery('#menu_superior_sidebar').animate(
						{ opacity: 0 },
						500
						);
				jQuery('#menu_superior').animate(
						{ height: '275px' }, 
						500, 
						function(){
							jQuery('#menu_superior_sidebar').css({display:'none'});
							jQuery('#menu_superior_interact').animate(
									{
										opacity: 1,
										width: '950px',
										height: '245px'
									},
									150
									);
						}
						);
				jQuery('#menu_pequeno').animate(
						{top: '275px'},
						500
						);
				jQuery('a#back_top').animate(
						{
							opacity: 1,
							top: '275px'
						},
						500,
						function() {
							jQuery('a#back_top').css({display:'block'});
							jQuery('#menu_superior').css({overflow:'visible'});
							}
						);	
			}
		);
	
	jQuery('a#back_top').click (
			function(){
				jQuery('#menu_superior_sidebar').animate(
						{ opacity: 1 },
						500
						);
				jQuery('#menu_superior').animate(
						{ height: '30px' }, 
						500, 
						function(){
							jQuery('#menu_superior_sidebar').css({display:'block'});
							jQuery('#menu_superior_interact').animate(
									{
										opacity: 0,
										height: '0px'
									},
									150
									);
						}
						);
				jQuery('#menu_pequeno').animate(
						{top: '30px'},
						500
						);
				jQuery('a#back_top').animate(
						{ 
							opacity: 0,
							top: '18px'
						},
						500,
						function() {
							jQuery('a#back_top').css({display:'none'});
							jQuery('#menu_superior').css({overflow:'hidden'});
							}
						);
				}
			);
	
// Despliegue menú/submenús superiores
//jQuery("ul.subnav").parent().append("<span></span>"); Puede servir para hacer un slidedown con trigger  

     jQuery("#menu_superior ul li span").hover(
    		 function() {
    			 jQuery('#menu_superior').css({overflow:'visible'});
    			 jQuery(this).parent().find("ul").slideDown('fast').show();
    			 jQuery(this).css({'font-weight': 'bold', 'background' : '#333'});
    			 jQuery(this).parent().hover(
    					 function() {
    					 },
    					 function(){
    						 	jQuery(this).parent().find("ul").slideUp('slow');
    		    			 	jQuery('#menu_superior ul li span').css({'font-weight': 'normal', 'background' : '#000'});
 								jQuery('#menu_superior').css({overflow:'hidden'});
    					 }
    			);
    		 },
    		 function() {
    			 //Salida del hover
    		 }
    	);  

	
// Slide desde top de la promo xacobeo
	jQuery('#Promo_Xacobeo').animate(
			{top: '55px'},
			5000
			);
	
// Menú tabulado superior interactivo
    jQuery('ul.menu_pequeno_tabs').tabs('div#menu_superior_interact > div', {
    			effect: 'fade',
    			fadeOutSpeed: 'slow'
    		}); 
   
// Formulario reserva interactivo
    var wizard = jQuery('#wizard_frm_reserva');
    
    jQuery('ul.wfrm_tabs', wizard).tabs('.wiz_panels > div.wiz_panels_ind', function(event, index) {
    	jQuery('.lbl_error, .lbl_error2').hide();
    	switch (index) {
	    	case 0:
	    		break
	       
	    	case 1: 
	    		// Comprobaciones de la reserva
	        	var res_numhab = jQuery("input#numhab").val();  
	        	if (!res_numhab.toString().match(/^[-]?\d*\.?\d*$/)) {  
	        		jQuery("label#numhab_error").html('Campo NUMÉRICO requerido');
	        		jQuery("label#numhab_error").show();  
	        		jQuery("input#numhab").focus();  
	        		return false;  
	        	} else if (res_numhab == "0")  {
	        		jQuery("label#numhab_error").html('Mínimo 1 habitación');
	        		jQuery("label#numhab_error").show();  
	        		jQuery("input#numhab").focus();
	        		return false;  
	        	}
	        	
	        	var res_horallegada = jQuery("input#horallegada").val();
	        	res_horallegada = res_horallegada.split(":");
	        	res_horallegada_h = parseInt(res_horallegada[0]);
	        	res_horallegada_m = parseInt(res_horallegada[1]);
	        	if (res_horallegada_h > 24 || res_horallegada_h < 00 || res_horallegada_m > 59 || res_horallegada_m < 00) {
	        		jQuery("label#horallegada_error").html('Hora errónea');
	        		jQuery("label#horallegada_error").show();  
	        		jQuery("input#horallegada").focus();  
	        		return false;  
	        	}
	        	
	        	var error_habitaciones = false;
	        	for (i=0; i<res_numhab; i++) {
		        	var res_tipohab = jQuery("select#tipohabitacion_"+i).val();
		        	if (res_tipohab == "--Seleccione--") {
		        		jQuery("div#hab_"+i).addClass("error_tipohab");
		        		jQuery("select#tipohabitacion_"+i).focus();
		        		error_habitaciones = true;
		        	}	        
		        }
	        	if (error_habitaciones == true) {
	        		return false;
	        	}
	        	
	    		break
	    		
	    	case 2: 
	    		
	    		// Comprobaciones de la tab de datos del usuario
	        	var res_name = jQuery("input#nombre").val();  
	        	if (res_name == "" ) {  
	        		jQuery("label#name_error").html('Campo requerido');
	        		jQuery("label#name_error").show();  
	        		jQuery("input#nombre").focus();  
	        		return false;  
	        	} else if (res_name.length < 3) {
	        		jQuery("label#name_error").html('Mínimo 3 caracteres');
	        		jQuery("label#name_error").show();  
	        		jQuery("input#nombre").focus();
	        		return false;  
	        	}
	
	        	var res_apellidos = jQuery("input#apellidos").val();  
	        	if (res_apellidos == "") {  
	        		jQuery("label#apellidos_error").html('Campo requerido');
	        		jQuery("label#apellidos_error").show();  
	        		jQuery("input#apellidos").focus();  
	        		return false;  
	        	} else if (res_apellidos.length < 5) {
	        		jQuery("label#apellidos_error").html('Mínimo 5 caracteres');
	        		jQuery("label#apellidos_error").show();  
	        		jQuery("input#apellidos").focus();
	        		return false;  
	        	} 

	        	var res_email = jQuery("input#email").val();
	        	if (res_email == "") {
	        		jQuery("label#email_error").html('Campo requerido'); 
	        		jQuery("label#email_error").show();  
	        		jQuery("input#email").focus();  
	        		return false;  
	        	}  else if (res_email.length < 5 || res_email.indexOf('.') < 2 || res_email.indexOf('@') < 0 ) {
	        		jQuery("label#email_error").html('eMail inválido');
	        		jQuery("label#email_error").show();  
	        		jQuery("input#email").focus();
		        	return false;  
	        	}
	
	        	var res_telefono = jQuery("input#telefono").val();  
	        	if (res_telefono == "") {  
	        		jQuery("label#telefono_error").html('Campo requerido'); 
	        		jQuery("label#telefono_error").show();  
	        		jQuery("input#telefono").focus();  
	        		return false;  
	        	} else if (res_telefono.length < 9 || !res_telefono.toString().match(/^[-]?\d*\.?\d*$/) ) {
	        		jQuery("label#telefono_error").html('Mínimo 9 números');
	        		jQuery("label#telefono_error").show();  
	        		jQuery("input#telefono").focus();
	        		return false;  
	        	} 
	        	
	        	var res_terms = jQuery('input#terminos'); 
	        	if (!res_terms.get(0).checked)  { 
	            	jQuery('label#terminos_error').show();
	        		res_terms.parent().addClass('error');
	    			jQuery("input#terminos").focus();
	            	return false; 
	        	}
	        	
	        	//Actualización de los datos del preview
	       		//Datos del usuario
	        	jQuery("span#resumen_nombre").html(jQuery("input#nombre").val());
	        	jQuery("span#resumen_apellido").html(jQuery("input#apellidos").val());
	        	jQuery("span#resumen_telefono").html(jQuery("input#telefono").val());
	        	jQuery("span#resumen_email").html(jQuery("input#email").val());
	        	//Descripción de la reserva
	        	var res_numhab = jQuery("input#numhab").val();
	        	if (res_numhab > 1) {
	        		jQuery("span#resumen_numhab").html(res_numhab).append(' habitaciones ');
	        	} else {
	        		jQuery("span#resumen_numhab").html(res_numhab).append(' habitación ');
	        	}
	        	jQuery("span#resumen_fechaentrada").html(jQuery("#fechaentrada").val());
	        	jQuery("span#resumen_fechasalida").html(jQuery("#fechasalida").val());
	        	jQuery("span#resumen_horallegada").html(jQuery("input#horallegada").val());
	        	if (jQuery("textarea#observaciones").val() == ""){
	        		jQuery("p.resumen_nota").hide();
	        	} else {
	        		jQuery("span#resumen_observaciones").html(jQuery("textarea#observaciones").val());
	        	}

	        	if (jQuery("select#ofertas").val() == 'No deseo oferta'){
	        		jQuery("p.resumen_oferta").hide();
	        	} else {
		        	jQuery("span#resumen_ofertas").html(jQuery("select#ofertas").val());
	        	}
	        	
	        	//Deatos de las habitaciones
	        	var res_habitaciones = new Array(res_numhab);
	        	for (i=0; i<res_numhab; i++) {
	        		res_habitaciones[i] = new Array(3);
	        		res_habitaciones[i][0] = jQuery('#tipohabitacion_' + i).val();
	        		res_habitaciones[i][1] = jQuery('#tipoocupantes_' + i).val(); 
	        		res_habitaciones[i][2] = jQuery('#opcioncuna_' + i);
	        		var tipohab_print = '';
	        		if (res_habitaciones[i][1] != null) {
	        			tipohab_print = ' ( ' + res_habitaciones[i][1] + ')';
	        		} else {
	        			tipohab_print = '';
	        		}
	        		var cuna_print = '';
	        		if (jQuery('#opcioncuna_' + i).is(':checked')) {
	        			cuna_print = ' + Cuna';
	        		} else {
	        			cuna_print = '';
	        		}
	        		if (i==0) {
			        	jQuery("p.resumen_habit").html('<span class="resumen_hab_ind">Habitación ' + (i+1) + ': ' + res_habitaciones[i][0] + tipohab_print + cuna_print + '</span>');
	        		} else {
			        	jQuery("p.resumen_habit").append('<span class="resumen_hab_ind">Habitación ' + (i+1) + ': ' + res_habitaciones[i][0] + tipohab_print + cuna_print + '</span>');
	        		}
	        	}
	        	
	        	break
    	}

    });
    
    // Boton Siguiente y Anterior
    var api = jQuery("ul.wfrm_tabs", wizard).tabs(0); 
    jQuery(".next a", wizard).click(function() { 
        api.next();
    	top_total = jQuery('#form_reserva').height() - 35;
		jQuery('ul.wfrm_tabs').css({top : top_total +'px'});
    });
    jQuery(".prev a", wizard).click(function() { 
        api.prev();
    	top_total = jQuery('#form_reserva').height() - 35;
		jQuery('ul.wfrm_tabs').css({top : top_total +'px'});
    });
    
	// Actualizador de habitaciones en número
	jQuery('input#numhab').blur(
			function(){
				var numhab = parseInt(jQuery(this).val());
				var html_formfinal = '';
				if (typeof numhab == 'number' && isFinite(numhab)) {
					for (i=0; i<numhab; i++) {
						var html_tipohab = '<div id=\"hab_'+i+'\"><label for=\"tipohabitacion_'+i+'\" id=\"lbl_tipohabitacion_'+i+'\" class=\"lbl_tipohabitacion\"><span>Tipo:</span><select name=\"tipohabitacion_'+i+'\" id=\"tipohabitacion_'+i+'\" class=\"selectbox tipohabitacion_sel\"><option value=\'--Seleccione--\' selected=\'selected\'>--Seleccione--</option><option value=\'Individual (IND)\'>Individual (IND)</option><option value=\'Doble (DBL)\'>Doble (DBL)</option><option value=\'Triple (TPL)\'>Triple (TPL)</option><option value=\'Cuádruple (CPL)\'>Cuádruple (CPL)</option></select></label><label for=\"tipoocupantes_'+i+'\" id=\"lbl_tipoocupantes_'+i+'\" class=\"lbl_tipoocupantes\"><span>Seleccione modo:</span><select name=\"tipoocupantes_'+i+'\" id=\"tipoocupantes_'+i+'\" class=\"selectbox tipoocupantes_sel\"><option value=1>--- Debe escoger un tipo de habitación</option></select></label><label for=\"opcioncuna_'+i+'\" id=\"lbl_opcioncuna_'+i+'\" class=\"opcioncuna\"><span>Supl. cuna?</span><input type=\"checkbox\" name=\"opcioncuna_'+i+'\" id=\"opcioncuna_'+i+'\"/></label></div>';
						html_formfinal = html_formfinal + html_tipohab;
					}
				} else {
					html_formfinal = ' ';
				}
				jQuery('#form_reserva_opciones').html(html_formfinal);
				top_total = jQuery('#form_reserva').height() - 35;
				jQuery('ul.wfrm_tabs').css({top : top_total +'px'});
			}
		);
	jQuery('input#numhab').keydown(
			function(){
				var numhab = parseInt(jQuery(this).val());
				var html_formfinal = '';
				if (typeof numhab == 'number' && isFinite(numhab)) {
					for (i=0; i<numhab; i++) {
						var html_tipohab = '<div id=\"hab_'+i+'\"><label for=\"tipohabitacion_'+i+'\" id=\"lbl_tipohabitacion_'+i+'\" class=\"lbl_tipohabitacion\"><span>Tipo:</span><select name=\"tipohabitacion_'+i+'\" id=\"tipohabitacion_'+i+'\" class=\"selectbox tipohabitacion_sel\"><option value=\'--Seleccione--\' selected=\'selected\'>--Seleccione--</option><option value=\'Individual (IND)\'>Individual (IND)</option><option value=\'Doble (DBL)\'>Doble (DBL)</option><option value=\'Triple (TPL)\'>Triple (TPL)</option><option value=\'Cuádruple (CPL)\'>Cuádruple (CPL)</option></select></label><label for=\"tipoocupantes_'+i+'\" id=\"lbl_tipoocupantes_'+i+'\" class=\"lbl_tipoocupantes\"><span>Seleccione modo:</span><select name=\"tipoocupantes_'+i+'\" id=\"tipoocupantes_'+i+'\" class=\"selectbox tipoocupantes_sel\"><option value=1>--- Debe escoger un tipo de habitación</option></select></label><label for=\"opcioncuna_'+i+'\" id=\"lbl_opcioncuna_'+i+'\" class=\"opcioncuna\"><span>Supl. cuna?</span><input type=\"checkbox\" name=\"opcioncuna_'+i+'\" id=\"opcioncuna_'+i+'\"/></label></div>';
						html_formfinal = html_formfinal + html_tipohab;
					}
				} else {
					html_formfinal = ' ';
				}
				jQuery('#form_reserva_opciones').html(html_formfinal);
			}
		);
	jQuery('.tipohabitacion_sel').livequery('change', function() {
		var id_selectbox = jQuery(this).parents('div:first').find('.tipoocupantes_sel').attr('id');
		var tipo_escogido = jQuery(this).val();
		switch (tipo_escogido) {
			case 'Individual (IND)':
				jQuery('#'+id_selectbox).html('<option value=" " disabled="disabled"> </value>');
				break
			case 'Doble (DBL)':
				jQuery('#'+id_selectbox).html('<option value=" " disabled="disabled"> </value>');
				break
			case 'Triple (TPL)':
				jQuery('#'+id_selectbox).html('<option value=\'2 Adultos + 1 niño\' selected=\'selected\'>2 Adultos + 1 niño</option><option value=\'3 Adultos\'>3 Adultos</option>');
				break
			case 'Cuádruple (CPL)':
				jQuery('#'+id_selectbox).html('<option value=\'2 Adultos + 2 niños\' selected=\'selected\'>2 Adultos + 2 niños</option><option value=\'3 Adultos + 1 niño\'>3 Adultos + 1 niño</option><option value=\'4 Adultos\'>4 Adultos</option>');
				break
			default:
				jQuery('#'+id_selectbox).html('<option value=" " disabled="disabled">Debe escoger un tipo de habitación</value>');
		}
	});
	
	// Envío del formulario 
   	jQuery("input#btn_enviar").click(function() {
   		jQuery("#enviar_reserva img").show();
   		jQuery("input#btn_enviar").hide();
   		//Datos del usuario
    	var res_nombre = jQuery("input#nombre").val();  
    	var res_apellidos = jQuery("input#apellidos").val();  
    	var res_email = jQuery("input#email").val();  
    	var res_telefono = jQuery("input#telefono").val();
    	var StringUser = 'nombre='+ res_nombre + '&apellidos=' + res_apellidos + '&email=' + res_email + '&telefono=' + res_telefono;
    	//Descripción de la reserva
    	var res_fechaentrada = jQuery("#fechaentrada").val();
    	var res_fechasalida = jQuery("#fechasalida").val();
    	var res_horallegada = jQuery("input#horallegada").val();
    	var res_observaciones = jQuery("textarea#observaciones").val();
    	var res_ofertas = jQuery("select#ofertas").val();
    	var StringDescrip = '&fechaentrada=' + res_fechaentrada + '&fechasalida=' + res_fechasalida + '&horallegada=' + res_horallegada + '&observaciones=' + res_observaciones + '&ofertas=' + res_ofertas;
    	//Deatos de las habitaciones
    	var res_numhab = jQuery("input#numhab").val();
    	var res_habitaciones = new Array(res_numhab);
    	var StringRooms = '&numhabs=' + res_numhab;
    	for (i=0; i<res_numhab; i++) {
    		res_habitaciones[i] = new Array(3);
    		res_habitaciones[i][0] = jQuery('#tipohabitacion_' + i).val();
    		res_habitaciones[i][1] = jQuery('#tipoocupantes_' + i).val();
    		if (jQuery('#opcioncuna_' + i).is(':checked')) {
    			res_habitaciones[i][2] = 'SI';
    		} else {
    			res_habitaciones[i][2] = 'NO';
    		}
    		StringRooms = StringRooms + '&tipohabitacion_' + i + '=' + res_habitaciones[i][0] + '&tipoocupantes_' + i + '=' + res_habitaciones[i][1] + '&opcioncuna_' + i + '=' + res_habitaciones[i][2];
    	}
    	//String a enviar para correo
    	var dataString = StringUser + StringDescrip + StringRooms;  
   		
    	//alert (dataString);return false;  
   		
   		jQuery.ajax({  
   			type: "POST",  
   			url: "http://hotelpuentedelatoja.com/wp-content/themes/hotelpuentedelatoja/functions/sendEmail.php",
   			data: dataString,  
   			success: function() {
   				jQuery('#wizard_frm_reserva').hide();
   				jQuery('#load_reserva').append("<div id='resolucion_envio'></div>");  
   				jQuery('#resolucion_envio').html("<h3>Solicitud de reserva enviada correctamente</h3>")
   					.append("<p>Nos pondremos en contacto con usted en las próximas horas <i>(siempre en menos de 24 horas)</i>. </p>")
   					.append("<p>La solicitud de reserva <b>no implica la confirmación de la misma</b> por lo que debe esperar confirmación por parte del hotel.</p>")
   					.append("<p>Le ha sido enviada una copia de la solicitud a su correo electrónico. Conserve dicha copia por si fuese necesario. </p>")
   					.append("<p>Muchas gracias por su confianza.</p>")
   					.append("<p class=\"firma_hotel\">Hotel Puente de La Toja.</p>")
   					.hide()
   					.fadeIn(
   							1500, 
   							function() {  
   								jQuery('#resolucion_envio').append("<img id='checkmark' src='http://hotelpuentedelatoja.com/wp-content/themes/hotelpuentedelatoja/images/tick.png' />");  
   							}
   					);
   				}  
   		});  
   		return false;     	
   	});  	
	
	
});


// Desplegables para selección de fechas
jQuery(function() {
	var dates = jQuery('#fechaentrada, #fechasalida').datepicker({
		defaultDate: "+0",
		minDate: "+0",
		dateFormat: 'dd/mm/yy',
        dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
        monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
        monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],  
		onSelect: function(selectedDate) {
			var option = this.id == "fechaentrada" ? "minDate" : "maxDate";
			var instance = jQuery(this).data("datepicker");
			var date = jQuery.datepicker.parseDate(instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat, selectedDate, instance.settings);
			dates.not(this).datepicker("option", option, date);
		}
	});
	//Inicialización principal para data + 1
	jQuery('#fechasalida').datepicker('option', {minDate: "+1"});

});

// Eliminar Key Intro
function stopRKey(evt) {
	  var evt = (evt) ? evt : ((event) ? event : null);
	  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	  if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
	}

	document.onkeypress = stopRKey; 