Cufon.replace('#top ul li a span, #sub .menu a span', {
    fontFamily: 'Futura', 
    hover: 'true'
});
Cufon.replace('#rotator .reso .open, #rotator ul li .caption h2, #main-boxes .box .head h2, #form-newsletter h4, #bottom h6, #reserve h5, #sub .box h3, #path h2, .gallery-list ul li h3, #content h3, .promotion-list ul li h2, .tag, .rooms-list ul li h2, #contact h1, #contact h6', {
    fontFamily: 'Futura', 
    hover: 'true', 
    textShadow: '2px 2px #000'
});
Cufon.replace('.btn', {
    fontFamily: 'Futura', 
    hover: 'true', 
    textShadow: '1px 1px #000'
});
$(document).ready(function() {
    
    $(".reserve-online").click(function(){
	Booking.Open({ locale: 'pl'});
	return false;
    });

    $(".gallery-list ul li:nth-child(3n)").addClass("remove");

    $(".rooms-list ul li:nth-child(2n)").addClass("remove");


    $("#rotator .reso .open").click(function() {
										 
	$(this).parent().find(".lay").toggle();
										 
    });

    $("#top .menu li a span").mouseenter(function(){
	var sub = $(this).parent().parent().find(".sub");
	if(sub.find("li").length > 0)
	    sub.show();
    });
    $("#top .menu li").mouseleave(function(){
	$(this).find(".sub").hide();
    });

    /* autoclear function for inputs */
    $('.autoclear').click(
	function() {
	    if (this.value == this.defaultValue) {
		this.value = '';
	    }
	}
	);
    $('.autoclear').blur(
	function() {
	    if (this.value == '') {
		this.value = this.defaultValue;
	    }
	}
	);					   
});

$(function(){
    
    $.datepicker.setDefaults({
	minDate: "+0" 
    });

    $("#date-start").datepicker( {
	minDate: "+0",
	dateFormat: 'dd-mm-yy',
	onSelect: function(dateText, inst){
	    var date = $("#date-start").datepicker("getDate");
	    date.setDate(date.getDate() + 1);

	     $("#date-stop").datepicker( "option", "minDate",  date);   
	     
	     
	     
	}
	
    } ); 
    $("#date-stop").datepicker({
	dateFormat: 'dd-mm-yy',
	minDate: "+1"
    }); 
	
	
	
    $('.rot-photos').cycle({ 
	fx:     'fade', 
	speed:  '1000', 
	timeout: 6000, 
	next:   '.rnext', 
	prev:   '.rprev',
	pager: '.rpager'
    });
    $(".colorbox").colorbox({
	current: "obraz {current} z {total}"
    });
	
	$('.rnext,.rprev').click(function() {
		$('#rotator ul').cycle('pause');
	});
	
	var rotphotosamount = $(".rot-photos li").size();
	
	if(rotphotosamount < 2) {
		$(".rnext, .rprev").hide();
		}
    
    $(".gastro-reservation, .group-reservation, .wedding-reservation, .conference-reservation, .room-reservation").click(function(){ 
	var link = $(this);
	$("#lightbox").css("filter", "alpha(opacity=90)"); 
	
	if(link.is(".conference-reservation"))
	    $("#topic").find("option[value='Rezerwacja konferencyjna']").attr("selected", "selected");
	if(link.is(".wedding-reservation"))
	    $("#topic").find("option[value='Rezerwacja weselna']").attr("selected", "selected");
	if(link.is(".group-reservation"))
	    $("#topic").find("option[value='Inny']").attr("selected", "selected");
	if(link.is(".gastro-reservation"))
	    $("#topic").find("option[value='Rezerwacja bankietu lub imprezy']").attr("selected", "selected");
	
	if(link.is(".conference-reservation"))
	    $("#topic").find("option:eq(1)").attr("selected", "selected");
	if(link.is(".wedding-reservation"))
	    $("#topic").find("option:eq(3)").attr("selected", "selected");
	if(link.is(".group-reservation"))
	    $("#topic").find("option:eq(4)").attr("selected", "selected");
	if(link.is(".gastro-reservation"))
	    $("#topic").find("option:eq(2)").attr("selected", "selected");
	
	
	
	
	$("#lightbox, #lightbox-panel").fadeIn(300, function(){
	

	
	});
	
	return false;
    }) ; 
    
    

    $("#lightbox, #lightbox-close").click(function(){ 
	$("#lightbox, #lightbox-panel").fadeOut(300); 
	return false;
    }); 
    
	$("#cboxprint").click(function(){
		window.print();
		return false;
	});
    
});				

