$(document).ready(function(){
	
	/* animace mainMenu */
	$("#mainMenu li").each(function () {
		var theString = $(this).html() + "<div class='onmouse'></div>";
		$(this).html(theString)
	});
	
	$("#mainMenu li").hover(function () {
		$(this).find(".onmouse").animate({ 
			top: "0px"
		}, 200 );
	}, function() {
		$(this).find(".onmouse").animate({ 
			top: "40px"
		}, 300 );
	});
	/* animace mainMenu - konec */
	
	/* prvoci v odkazich titul */
	$("#cols3 a").each(function () {
		var linkContent = $(this).html() + "&nbsp;<img src='pics/prvok.gif' width='7' height='7' alt='' /><br />";
		$(this).html(linkContent)
	});
	/* prvoci v odkazich titul - konec */
	
	/* inicializace slidu prioritniho pole */
	$("#pPole ul li .slideCaption").each(function () {
		var captionContent = "<span class='captionBackground'>&nbsp;</span><span class='captionContent'>" + $(this).html() + "</span>";
		$(this).html(captionContent)
	});
	
	$("#pPole").hover(function () {
		$(this).find("#pPoleNav").fadeIn(300);
	}, function() {
		$(this).find("#pPoleNav").fadeOut(300);
	});
	
	$(".pPoleCarousel").jCarouselLite({
		btnPrev: "#pPrev",
		btnNext: "#pNext",
		auto: 6000,
		speed: 350,
		visible: 1,
		mouseWheel: true
	});
  /* inicializace slidu prioritniho pole - konec */
  
  /* inicializace tabu */                                      /* 10000 */
	$("#tabs").tabs({ fx: { opacity: "toggle" } }).tabs("rotate", 0).tabs("option", "selected", 0);
	/* inicializace tabu - konec */
	
	/* onmouse v panelu fotogalerie */
	$(".fotoPanel a").each(function () {
		var photoContent = $(this).html() + "<span>&nbsp;</span>";
		$(this).html(photoContent);
		$(this).find("span").fadeTo("slow", .5);
	});
	
	$(".fotoPanel a").hover(function () {
		$(this).find("span").fadeTo("slow", 0);
	}, function() {
		$(this).find("span").fadeTo("slow", .5);
	});
	/* onmouse v panelu fotogalerie - konec */
	
	/* odsazeni textu v perexu pokud je obrazek */
	$(".perex").each(function () {
		if ($(this).find("img").length > 0) {
			$(this).css("padding-left", "100px");
			$(this).find("img").css("visibility", "visible");
		} else {
			$(this).addClass("noMinHeight");
		}
	});
	/* odsazeni textu v perexu pokud je obrazek - konec */
	
	/* lightbox */
	$(function(){
	  $("a[rel^='lightbox']").lightbox();
	});
	/* lightbox - konec */
	
	/* kalendar */
		$(".calendar_active_item, .calendar_active_item_weekend").hover(function () {
			$(this).css("z-index", "2");
			$(this).animate({ 
				backgroundColor: "#2e8cdc",
				color: "#fff"
			}, "fast" );
			$(this).find(".info").slideDown("fast");
		}, function () {
			$(this).animate({ 
				backgroundColor: "#fff",
				color: "#2e8cdc"
			}, "fast" );
			$(this).find(".info").fadeOut("fast");
			$(this).css("z-index", "1");
		});
	/* kalendar - konec */
	
	/* obecna tabulka */
	$(".tabCommon").find("tr:last td, tr:last th").each(function () {
		$(this).addClass("lastRow");
	});
	/* obecna tabulka - konec */
	
	/* fotogalerie nahledy - vystredeni */
	$(".fotoThumb img").each(function () {
		this.alt = "";
		vystredS = ($(this).width()/2)*-1;
		vystredV = ($(this).height()/2)*-1;
		$(this).css("margin-left", vystredS);
		$(this).css("margin-top", vystredV);
		$(this).css("display", "block");
	});
	
	$(".fotoName").jTruncate({
		length: 30
	});
	
	/* fotogalerie nahledy - vystredeni - konec */
  
});
