
    
$(document).ready(function(){   
    // external links...

    anMe();

    $("a[rel=external]").attr("target","_blank");         
    $("#menu>li").hover(function() { $(this).addClass("over"); }, function() { $(this).removeClass("over"); });     
    $("tr:even td").addClass("even");
    fancyBoxInit();

});

function anMe() {

    $(".animate").animate({ color: "#c4a600" }, 1500, function() {
		$(this).animate({ color: "#947d00" }, 1500, function() {
			$(this).stop();
			timeMe();
		});	
	});

}

function anMe2() {
    $(".animate").animate({ color: "#cc6e00" }, 1500, function() {	
		anMe();
	});
}

function timeMe() {
	var t=setTimeout("anMe2();",1000)
}

function fancyBoxInit() {

    $("a.thickbox").fancybox({   
        'titlePosition' : 'inside',     
        'transitionIn'    : 'elastic',
        'transitionOut'    : 'elastic'
    });
    

    $("a.thickbox[rel=gallery]").fancybox({
        'transitionIn'        : 'elastic',
        'transitionOut'        : 'elastic',
        'titlePosition'     : 'inside',        
        'titleFormat'        : function(title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-inside">Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }

    });
}     


function activateTabs() {
    $("#tabMenu a").each(function(index, me) {
        if ($(me).attr("rel")!="link") {
            $(me).attr("rel",$(me).attr("href").substr(1,99));
            $(me).attr("href","javascript:void(0);");
        }
    });
    $("#tabMenu a").click(function() {
        if ($(this).attr("rel")!="link") {
            var anchor = $(this).attr("rel");
            var activeAnchor = $("#tabMenu li.active a").attr("rel"); 
            
            $("#tabMenu li.active").removeClass("active");
                            
            $("#"+activeAnchor).hide();
            $("#"+anchor).hide();        
            $("#"+anchor).removeClass("hidden");
            $("#"+anchor).fadeIn();
            
            $(this).parent().addClass("active");
        }
    });
    
    
    
}

