﻿$(function () {
	/* solapas */
	$('a.elpremio').click(function () {
		$('#nosconoces').slideUp('slow');
		$('#elpremio').slideToggle('slow');
		return false;
	});
	$('a.nosconoces').click(function () {
		$('#elpremio').slideUp('slow');
		$('#nosconoces').slideToggle('slow');
		return false;
	});
	$('#elpremio a.cerrar').click(function () {
		$('#elpremio').slideUp('slow');
		return false;
	});
	$('#nosconoces a.cerrar').click(function () {
		$('#nosconoces').slideUp('slow');
		return false;
	});
	$('#prebases a.cerrar').click(function () {
		$('#prebases').slideUp('fast');
		return false;
	});
	
	/* jCarousel Lite */
	$("#hotelescar").jCarouselLite({
		visible: 2,
		btnNext: "#hoteles .flechad",
        btnPrev: "#hoteles .flechai"
    });
	
	/* limpiar formulario */
	$('#formulario .derecha input[type=text]').focus(function() {
		$(this).attr('value', '');
	});
	
	/* abrir hoteles */
	$("#hotelescar a.hotel").click(function () {
		var h = $(this).attr('rel');
		for(i=1; i<6; i++) if(h != i) $("#hotel"+i).slideUp('slow');
		$("#hotel"+h).slideDown('slow');
		return false;		
	});

	/* cerrar hoteles */
	$("div.deshotel a.cerrar").click(function () {
		var h = $(this).attr('rel');
		$("#hotel"+h).slideUp('slow');
		return false;		
	});

	/* jCarousel Lite HOTELES */
	$("#hotel1car").jCarouselLite({
		visible: 1,
		btnNext: "#hotel1 .flechad",
        btnPrev: "#hotel1 .flechai"
    });
	$("#hotel2car").jCarouselLite({
		visible: 1,
		btnNext: "#hotel2 .flechad",
        btnPrev: "#hotel2 .flechai"
    });
	$("#hotel3car").jCarouselLite({
		visible: 1,
		btnNext: "#hotel3 .flechad",
        btnPrev: "#hotel3 .flechai"
    });
	$("#hotel4car").jCarouselLite({
		visible: 1,
		btnNext: "#hotel4 .flechad",
        btnPrev: "#hotel4 .flechai"
    });
	$("#hotel5car").jCarouselLite({
		visible: 1,
		btnNext: "#hotel5 .flechad",
        btnPrev: "#hotel5 .flechai"
    });
	
	/* cerrar todos los hoteles */
	/* al cargar, para que funcione el jcarousel */
	for(i=1; i<6; i++) $("#hotel"+i).hide('fast');
});

function prebases() {
	$("#prebases_contenido").load("pprebases.html");
	$("#prebases").slideDown('slow');
	return false;
}

