$(function(){
	$(".calendar").datepicker(
	{
		dateFormat:'dd.mm.yy',
		dayNamesMin: ['Ne', 'Po', 'Ut', 'St', 'Čt', 'Pá', 'So', 'Ne'],
		firstDay: 1,
		monthNames: ['Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Posinec']
	}
	);
});

$(window).load(function() {
    $('#featured').orbit({
	     animation: 'horizontal-push',                  // fade, horizontal-slide, vertical-slide, horizontal-push
	     animationSpeed: 1000,                // how fast animtions are
	     timer: true, 			 // true or false to have the timer
	     advanceSpeed: 13000, 		 // if timer is enabled, time between transitions 
	     pauseOnHover: false, 		 // if you hover pauses the slider
	     startClockOnMouseOut: false, 	 // if clock should start on MouseOut
	     startClockOnMouseOutAfter: 1000, 	 // how long after MouseOut should the timer start again
	     directionalNav: true, 		 // manual advancing directional navs
	     captions: true, 			 // do you want captions?
	     captionAnimation: 'fade', 		 // fade, slideOpen, none
	     captionAnimationSpeed: 800, 	 // if so how quickly should they animate in
	     bullets: false,			 // true or false to activate the bullet navigation
	     bulletThumbs: false,		 // thumbnails for the bullets
	     bulletThumbLocation: '',		 // location from this file where thumbs will be
	     afterSlideChange: function(){} 	 // empty function 
    });
});
                        
$(document).ready(function(){
    	$("a.zoom").fancybox();
	$("a.zoom1").fancybox({
		'overlayOpacity':0.0,
		'overlayColor':'#FFFFFF'
	});
  
	$("a.zoom2").fancybox({
		'zoomSpeedIn':500,
		'zoomSpeedOut':500,
		'overlayShow':false
	});

	$(".iframe").fancybox({
		'frameWidth'			: 674,
		'frameHeight'			: 425,
		'autoScale'     	: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity': '0.0',
		'overlayColor': '#000000',
		'centerOnScroll' : false
	});	
	$("a.zoom-yt").click(function() {
		$.fancybox({
			'padding'             : 0,
			'autoScale'   : false,
			'transitionIn'        : 'none',
			'transitionOut'       : 'none',
			'title'               : this.title,
			'overlayOpacity'		: 0.8,
			'overlayColor'		: '#000000',
			'width'               : 680,
			'height'              : 495,
			'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'                : 'swf',    // <--add a comma here
			'swf'                 : {
				'allowfullscreen':'true'
			} // <-- flashvars here
		});
		return false;

	});	
	
	$('a.email').each(function(){
		e = this.title.replace('[A]','@');
		var mail_array = e.split('[+]');
		var mail = mail_array.join('') 
		this.href = 'mailto:' + mail;
		this.title = 'email';
		$(this).text(mail);
	});	
	
	$('.ad-gallery').adGallery({
		height : 370,
		width : 960,
		animate_first_image: false, // Should first image just be displayed, or animated in?
		animation_speed: 1500, // Which ever effect is used to switch images, how long should it take?
		display_next_and_prev: true, // Can you navigate by clicking on the left/right on the image?
		slideshow: {
			enable: true,
			autostart: true,
			speed: 5000
		},
		effect: 'fade', // 'slide-hori'or 'slide-vert', 'resize', 'fade', 'none' or false
		enable_keyboard_move: false, // Move to next/previous image with keyboard arrows?
		cycle: true // If set to false, you can't go from the last image to the first, and vice versa
	});
	
	$('.nav').find('a.active').parentsUntil('.nav > ul').filter('li').addClass('active');
	
});
