function slideSwitch()
{
	var activeDiv = $("#slideshow div.active");
	var nextDiv = $(activeDiv).nextAll('div.no-active:first').css({opacity:0.0});
	
	if(nextDiv.length == 0)
	{
		nextDiv = $('#slideshow div').first();
	}
	
	$(activeDiv).css({opacity:0.0});
	$(nextDiv).removeClass('no-active').addClass('active')
		.animate({
			opacity:1.0},1500,function(){
				activeDiv.removeClass('active').addClass('no-active');
	});
	
	
}

$(document).ready(function () {
	setInterval( "slideSwitch()", 5000 );
	
	
	if($("#reservation :input").hasClass('errors')){
		$('#reservation').slideToggle();
	}
	
	if($("#email_send").length > 0){
		//setInterval("emailSend()",5000);
		var width = $(document).width();
		var height = $(document).height();
		$('#email_send').css({'position':'absolute','left':(width/2)-500});
		$('#email_send').css({'top':(height/2)-100});
		$('#email_send').toggle();
		$('#email_send').expose({
															onClose: function() {
																$('#email_send').toggle();
															},
															color: '#707070'
														});
	}
	
	$(".reserve").click(function(){
	
		var my_height = $('#reservation').height();
		//alert(height);
		$('#reservation').slideToggle();
		return false;
	});
	
	/* icon close */
	$("#reserv_close").click(function(){
		$('#reservation').slideUp();
	});
	
	
	$.datepicker.regional['cs'] = {
		closeText: 'Zavřít',
		prevText: '&#x3c;Dříve',
		nextText: 'Později&#x3e;',
		currentText: 'Nyní',
		monthNames: ['leden','únor','březen','duben','květen','červen',
        'červenec','srpen','září','říjen','listopad','prosinec'],
		monthNamesShort: ['led','úno','bře','dub','kvě','čer',
		'čvc','srp','zář','říj','lis','pro'],
		dayNames: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'],
		dayNamesShort: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'],
		dayNamesMin: ['ne','po','út','st','čt','pá','so'],
		weekHeader: 'Týd',
		dateFormat: 'dd.mm.yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''};
		
	$.datepicker.setDefaults($.datepicker.regional['cs']);
	$("input[name='date']" ).datepicker({
						showOtherMonths: true,
						selectOtherMonths: true,
						dateFormat: 'd MM yy',
						showOn: "both",
						buttonText: ""
					});
					
	if($.browser.opera || $.browser.webkit){
		$('#reservation :input.text').css({'width':'193px'});
		$('.ui-datepicker-trigger').css({'top':'3px'});
		$('.ui-datepicker-trigger').css({'left':'-25px'});
		$('#reservation select').css({'border':'1px solid #D4D4D4'});
	}
	if($.browser.msie){
		$('.ui-datepicker-trigger').css({'top':'10px'});
	}
	
});
