/* Since target="_blank" is not allowed anymore, we're faking it ;) */
$(function() {
	$('a.new-window').click( function() {
		window.open(this.href);
		return false;
	});
});

$(document).ready(function() {
/* FAQ Accordion */
	$('div.accordion_head').click(function() {
		$(this).css("color","#c2001a");
		if($(this).next().is(':hidden')) {
			$('div.accordion_text').slideUp('normal');
			$(this).next().slideDown('normal');
		}
		else {
			$('div.accordion_text').slideUp('normal');
		}
	});
	$("div.accordion_text").hide();

/* Fancybox & Image gallery */
	$("a.zoom_image").fancybox({
		'titleShow' : true,
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic',
		'autoScale' : false,
		'titlePosition' : 'inside',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
			return '<span style="text-align:left;display:block;">' + title + '</span>';
		}
	});

	$("a[rel=gallery]").fancybox({
		'titleShow' : true,
		'transitionIn' : 'elastic',
		'transitionOut'	: 'elastic',
		'autoScale' : false,
		'titlePosition' : 'inside',
		'titleFormat'	: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});
});

