$(document).ready(function() {
	Cufon.replace('.sliderPanel-in h2')('#homeBox h3:not(.nocufon)')('.boxItem h2');

	$('#sliderPanel ul')
	.after('<div id="nav" class="clearfix">')
	.cycle({
		fx:     'fade', 
		speed:  'fast', 
		timeout: 5000, 
		next:   '.next', 
		prev:   '.previous',
		pager:  '#nav'
	});

	$('.services ul')
	.after('<div id="newsNavigation" class="noscreen">')
	.cycle({
		fx:     'fade', 
		speed:  'fast', 
		timeout: 5000, 
		next:   '.newsNext', 
		prev:   '.newsPrev',
		after:  onBefore,
		pager:  '#newsNavigation'
	});
	
	var liCount = $("#serviceSlider").find("li").length;
	$("#newsCount").html(liCount);
	
	function onBefore() {
		var item = $(".services .activeSlide").html();
		var activeItem = document.getElementById("newsActual");
		if (item != null)
			activeItem.innerHTML = item;
	};
	
	$(".ourTeam .teamContent").hide();
	
	$(".ourTeam .more .link").click(function(){
		if ($(this).attr("class") == "link more")
		{
			$(this).parent("p").parent(".info").find(".teamContent").show();
			$(this).attr("class","link less");
			$(this).html("Méně informací");
		}
		else
		{
			$(this).parent("p").parent(".info").find(".teamContent").hide();
			$(this).attr("class","link more");
			$(this).html("Více informací");
		}
	});
	
	$(".ourTeam .picture a").click(function(){
		$(this).parent(".picture").parent(".ourTeam").find(".teamContent").show();
		$(this).parent(".picture").parent(".ourTeam").find(".link").attr("class","link less");
		$(this).parent(".picture").parent(".ourTeam").find(".link").html("Méně informací");
	});
	
	$(".ourTeam .picture a").click(function(){
		$(this).parent(".picture").parent(".ourTeam").find(".teamContent").show();
		$(this).parent(".picture").parent(".ourTeam").find(".link").attr("class","link less");
		$(this).parent(".picture").parent(".ourTeam").find(".link").html("Méně informací");
	});
	
	$(".ourTeam .info h3 a").click(function(){
		$(this).parent("h3").parent(".info").find(".teamContent").show();
		$(this).parent("h3").parent(".info").find(".link").attr("class","link less");
		$(this).parent("h3").parent(".info").find(".link").html("Méně informací");
	});

});
