$(document).ready(function(){
	// fancybox image
	$('div.leva-strana a.odkaz-obrazek-rozklik').fancybox({
		'transitionIn'	: 'elastic',
		'transitionOut'	: 'elastic',
		'titlePosition'	: 'inside',
		'centerOnScroll': true
	});
	
	// fancybox iframe
	$('div.leva-strana a.fancyiframe').fancybox({
		'type'          : 'iframe',
 		'width'         : '50%',
 		'height'        : '50%',
		'padding'       : 0,
		'autoScale'     : true,
 		'transitionIn'  : 'none',
 		'transitionOut' : 'none',
		'titlePosition' : 'inside',
		'centerOnScroll': true
	});
	
	// fancybox inline
	$('div.leva-strana a.fancyinline').fancybox({
		'padding'       : 20,
		'hideOnContentClick': true,
		'titlePosition' : 'inside',
		'centerOnScroll': true
	});
	
	// top menu navigation bar
	$("ul#topnav li").hover(function() { //Hover over event on list item
		if ($(this).hasClass('active'))
			$(this).css({'background' : '#2F85B5 url(/images/topnav_active2.png) repeat-x'}); //Add background color + image on hovered list item
		else
			$(this).css({'background' : '#1376c9 url(/images/topnav_active.gif) repeat-x'}); //Add background color + image on hovered list item
		$(this).find('span').show(); //Show the subnav
	} , function() { //on hover out...
		if (!($(this).hasClass('active'))) {
			$(this).css({'background' : 'none'}); //Ditch the background
			$(this).find('span').hide(); //Hide the subnav
		}
	});
});