$(function() {
	$('.highseason').click(function() {
		$('#lowseason').hide(0);
		$('#highseason').show("blind");
		return false; 
	});
	$('.lowseason').click(function() {
		$('#highseason').hide(0);
		$('#lowseason').show("blind");
		return false; 
	});

    /*$('#cycle').cycle({
		fx:			'curtainX',
		timeout:	0,
		speed:		1000
    });*/
	
	/*$(window).bind('resize', function() {
		$('#cycle div').animate({ width: '100%', height: '100%' }, 1);
		return false; 
    });*/
	
	$('#facebookstream').click(function() {
		if($('#footer').height()==69){
			$('#footer').animate({ height: '350px' }, 1000);
		}
		else{
			$('#footer').animate({ height: '69px' }, 1000);
		}
		return false; 
    });
	$('#angel1').click(function() {
		if($('#angel1').width()==435 && $('#angel2').width()==435) {
			$('#angel1').toggleClass('big');
			$('#angel2').toggleClass('nh');
			setTimeout(function(){
			$('#angel2').animate({ width: 0 }, 1000);
			/*$('#cycle .right').animate({ width: 0 }, 1000);
			$('#cycle .left').animate({ width: '100%' }, 1000);*/
			$('#cycle').animate({left: '-0.01%' }, 1000);
			$('#angel1').animate({ width: 940 }, 1000);
			$('#angel1 .cont').animate({ width: 910 }, 500);
			},200);
		}
		return false; 
    });
	$('#angel2').click(function() {
		if($('#angel1').width()==435 && $('#angel2').width()==435) {
			$('#angel2').toggleClass('big');
			$('#angel1').toggleClass('nh');
			/*$('#cycle .left').animate({ width: 0 }, 1000);
			$('#cycle .right').animate({ width: '100%' }, 1000);*/
			$('#cycle').animate({left: '-100%' }, 1000);
			$('#angel1').animate({ width: 0 }, 1000);
			$('#angel2').animate({ width: 940 }, 1000);
			$('#angel2 .cont').animate({ width: 910 }, 1000);
		}
		return false; 
    });
	
	$('#angel1 .close').click(function() {
		if($('#angel1').width()==940 || $('#angel2').width()==940) {
			/*$('#cycle .left').animate({ width: '50%' }, 1000);
			$('#cycle .right').animate({ width: '50%' }, 1000);*/
			$('#cycle').animate({left: '-50%' }, 1000);
			$('#angel1, #angel2').animate({ width: 435 }, 1000);
			$('#angel1 .cont').animate({ width: 425 }, 1000);
			setTimeout(function(){$('#angel1').removeClass('big')},1000);
			setTimeout(function(){$('#angel2').removeClass('nh')},1000);
		}
		return false; 
    });
	$('#angel2 .close').click(function() {
		if($('#angel1').width()==940 || $('#angel2').width()==940) {
			/*$('#cycle .right').animate({ width: '50%' }, 1000);
			$('#cycle .left').animate({ width: '50%' }, 1000);*/
			$('#cycle').animate({left: '-50%' }, 1000);
			$('#angel1, #angel2').animate({ width: 435 }, 1000);
			$('#angel2 .cont').animate({ width: 425 }, 1000);
			setTimeout(function(){$('#angel2').removeClass('big')},1000);
			setTimeout(function(){$('#angel1').removeClass('nh')},1000);
		}
		return false; 
    });
	
	
	$.datepicker.setDefaults($.datepicker.regional["pl"]);
	$("#data").datepicker({
		showAnim: 'slideDown',
		minDate: "+1D",
		maxDate: "+1Y",
		dateFormat: "yy-m-d",
		firstDay: 1
	});	
	
	$("#form-pl").validate({
	
		rules:{
			imie: 		"required",
			nazwisko: 	"required",
			email: {
				required: 	true,
				email:		true
			},
			telefon:	"required",
			data:		"required"
		},
		messages:{
			imie:		"Wprowadź swoje imię",
			nazwisko:	"Wprowadź swoje nazwisko",
			email: {
				required: 	"Wprowadź adres e-mail",
				email:		"Niepoprawny adres e-mail"
			},
			telefon:	"Wprowadź numer telefonu",
			data:	"Wprowadź datę przyjazdu"
		}
		
	});
	
	$("#form-en").validate({
	
		rules:{
			imie: 		"required",
			nazwisko: 	"required",
			email: {
				required: 	true,
				email:		true
			},
			telefon:	"required",
			data:		"required"
		},
		messages:{
			imie:		"Please enter your name",
			nazwisko:	"Please enter your surname",
			email: {
				required: 	"Please enter your e-mail",
				email:		"Incorrect e-mail address"
			},
			telefon:	"Please enter phone number",
			data:	"Please enter arrival date"
		}
		
	});
	
	$("#form-it").validate({
	
		rules:{
			imie: 		"required",
			nazwisko: 	"required",
			email: {
				required: 	true,
				email:		true
			},
			telefon:	"required",
			data:		"required"
		},
		messages:{
			imie:		"Please enter your name",
			nazwisko:	"Please enter your surname",
			email: {
				required: 	"Please enter your e-mail",
				email:		"Incorrect e-mail address"
			},
			telefon:	"Please enter phone number",
			data:	"Please enter arrival date"
		}
		
	});
	
	$("#form-es").validate({
	
		rules:{
			imie: 		"required",
			nazwisko: 	"required",
			email: {
				required: 	true,
				email:		true
			},
			telefon:	"required",
			data:		"required"
		},
		messages:{
			imie:		"Please enter your name",
			nazwisko:	"Please enter your surname",
			email: {
				required: 	"Please enter your e-mail",
				email:		"Incorrect e-mail address"
			},
			telefon:	"Please enter phone number",
			data:	"Please enter arrival date"
		}
		
	});

	
});
