$(document).ready(function() {

// Open links in new window
$("a[rel='external']").click(function(){window.open(this.href); return false;});

// Focus text for searchbox
$("#searchstring").focus(function(){
	if ($(this).val() == $(this)[0].title){
		$(this).removeClass("TextActive");
		$(this).val("");
	}
});
$("#searchstring").blur(function(){
	if ($(this).val() == ""){
		$(this).addClass("TextActive");
		$(this).val($(this)[0].title);
	}
});
$(".Text").blur();        

// Navigation
$('#nav li').hover(function() {
	$(this)
	.find('ul:first')
	.stop(true, true)
	.fadeIn(100);
}, function() {
	$(this)
	.find('ul:first')
	.stop(true,true)
	.slideUp(80);
});

$('#nav li').mouseover(function() {
	$(this).addClass('hover');
});

$('#nav li').mouseout(function() {
	$(this).removeClass('hover');
});

// Antispam
if($('#antispamblock').length){
    $('#antispam').val('777');
    $('#antispamblock').hide();
}

			
});//End document ready

// Fancybox
$(document).ready(function() {

if ($('a[rel*=group]').length) {
	$("a[rel*=group]").fancybox({
	//$(this).fancybox({
		'titlePosition': 'over',
		'titleFormat': function(title, currentArray, currentIndex, currentOpts){
		return '<span id="fancybox-title-over">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
	}
});
}

});//End Fancybox

