﻿$(document).ready(function() {
		
		$('form input[name=Entrada]').datepicker($.extend({}, 
			$.datepicker.regional["es"], { 
			dateFormat: "dd/mm/yy", 
			showOn: "both",
			buttonImage: "../images/calendario_mini_reservas.gif",
			buttonImageOnly: true 
		}));
		
		$('form input[name=Salida]').datepicker($.extend({}, 
			$.datepicker.regional["es"], { 
			dateFormat: "dd/mm/yy", 
			showOn: "both",
			buttonImage: "../images/calendario_mini_reservas.gif",
			buttonImageOnly: true 
		}));
		
		$('form input[name=Date]').datepicker($.extend({}, 
			$.datepicker.regional["es"], { 
			dateFormat: "dd/mm/yy", 
			showOn: "both",
			buttonImage: "../images/calendario_mini_reservas.gif",
			buttonImageOnly: true 
		}));

		$("#mostrar").click(function(event) {
		event.preventDefault();
		$("#caja").slideToggle();
	});
	
	$("#caja a").click(function(event) {
		event.preventDefault();
		$("#caja").slideUp();
	});

	$("#image").change(function() {
        var src = $(this).val();

        $("#imagePreview").html(src ? "<img src='images/" + src + "'>" : "");
    });	
	
	$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();

	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

	
});

$(function () {
	$(window).load(function () {
		// Simplest jQuery slideshow by Jonathan Snook
		$('#slideshow img').css({'position': 'absolute'});
		
		imageHeight = $("#slideshow img").attr("height");
		
		$("#slideshow").css("height" , imageHeight + "px");
		
		$('#slideshow img:gt(0)').hide();
		
		setInterval(function () {
			$('#slideshow :first-child').fadeOut(1000).next('img').fadeIn(1000).end().appendTo('#slideshow');
		}, 4000);
	});
	
	

});

$(window).resize(function() {
	imageHeight = $("#slideshow img").attr("height");
	
	$("#slideshow").css("height" , imageHeight + "px");
	

	/*var altoslide = $("#slideshow").css("height");  
	alert (altoslide);*/
});



