	$(function() {
		/* carousel */
		$(".anyClass").jCarouselLite({
			btnNext: ".next",
			btnPrev: ".prev",
			circular: false
		});

		/* youtube */		
		$("a.yt").click(function() {
			$.fancybox({
					'padding'		: 0,
					'autoScale'		: false,
					'transitionIn'	: 'elastic',
					'transitionOut'	: 'elastic',
					'title'			: this.title,
					'width'			: 680,
					'height'		: 495,
					'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
					'type'			: 'swf',
					'swf'			: {
						 'wmode'		: 'transparent',
						'allowfullscreen'	: 'true'
					}
				});
			return false;
		});
		
		/* top panel */
		$('.ousko')
			.mouseenter(function() {
				$(this).animate({top:'+=10'}, 200)
			})
			.mouseleave(function() {
				$(this).animate({top:'-=10'}, 200)
			})
		

		/* history */
		
        function load(page) {
        	var templ = page.replace(/^.*!/, '').replace(/\?.*/,'');
        	var params = page.replace(/^.*\?/, '');
        	$('.ajax').removeClass('active');
        	$('#'+templ).addClass('active');
            $('.article-in')
				.load(templ + '.phtml?' + params)
				.ajaxStart(function() {
					$(this).fadeOut();
				})
				.ajaxStop(function() {
					$(this).fadeIn();
				})            
        }

        $.history.init(function(url) {
                load(url == "" ? "uvod" : url);
            });

        $('a.ajax').live('click', function(e) {
                var url = $(this).attr('href');
                url = url.replace(/^.*#/, '');
                $.history.load(url);
                return false;
		});
	});


