Cufon('h1');Cufon('h2');Cufon('h3');Cufon('h4');Cufon('.datum');Cufon('.ticket .date p');
$(function(){

	if($('#placeholder').length > 0)
	{
		$('#placeholder').crossSlide({
			fade: 1
		}, [
			{
				src: '/_img/baner/stala-expozice-1.jpg',
				from: '100% 80% 1x',
				to:   '100% 0% 1.5x',
				time: 5},
			{
				src: '/_img/baner/bile-tramy.jpg',
				from: '100% 80% 1x',
				to:   'top left 1.5x',
				time: 5},
			{
				src: '/_img/baner/expozice-2.jpg',
				from: '100% 80% 1.5x',
				to:   '80% 15% 1.1x',
				time: 5},
			{
				src: '/_img/baner/expozice-1.jpg',
				from: '100% 0% 1x',
				to:   '40% 80% 1.5x',
				time: 5},
			{
				src: '/_img/baner/capek.jpg',
				from: '100% 80% 1.5x',
				to:   '80% 20% 1x',
				time: 5},
			{
				src: '/_img/baner/skala-a-deti.jpg',
				from: '100% 20% 1x',
				to:   '20% 80% 1.5x',
				time: 5}
		]);

	}

	activeLink();

	$("#calendar a").mouseover(function(){
		$(this).attr('title');

	});

	$('#calendar td').hover(function(e) {
		// Hover over code
		var titleText = $(this).find('a').attr('title');
		if(titleText != '')
		{
			textArray = titleText.split('%separator%');
			$(this)
			.find('a')
			.data('tipText', titleText)
			.removeAttr('title');
			$('<p class="tooltip"></p>')
			.append(textArray.join('<hr/>'))
			.appendTo('body')
			.css('top', (e.pageY - 10) + 'px')
			.css('left', (e.pageX + 20) + 'px')
			.fadeIn('slow');
		}
	}, function() {
		$(this).find('a').attr('title', $(this).find('a').data('tipText'));
		$('.tooltip').remove();
	}).mousemove(function(e) {
		// Mouse move code
		$('.tooltip')
		.css('top', (e.pageY - 10) + 'px')
		.css('left', (e.pageX + 20) + 'px');
	});

	//	var mh = $('#main-content article').height();
	//	var ph = 0;
	//
	//	$('#main-content nav.submenu').each(function(){
	//		ph += $(this).height();
	//	});
	//
	//	$('#main-content aside').each(function(){
	//		ph += $(this).height();
	//	});
	//
	//	if (mh < ph)
	//	{
	//		$('#main-content article').css('min-height', ph);
	//	}


	function activeLink()
	{
		urlStr = window.location;
		urlStr = urlStr.toString();
		urlPart = urlStr.split("/");

		linkOnPath = '';
		for ( i in urlPart)
		{
			if (i > 2 && urlPart[i] != '')
			{
				linkOnPath += '/'+urlPart[i];
				$("a[href="+linkOnPath+"]").addClass('active');
			}
			if (i == 3 && urlPart[i] == '')
			{
				linkOnPath += '/'+urlPart[i];
				$("a[href="+linkOnPath+"]").addClass('active');
			}
		}

	}

});
