$(document).ready(function(){

	$('.event').colorTip({color:'blue', timeout:250});

	if(location.hash!="" && location.href.search("wyszukaj")!=-1) pokazStrone(location.hash);
	

	Cufon.replace('h1', {
		color: '-linear-gradient(#1c57b9, #18438c)',
		textShadow: '0px 1px rgba(0, 0, 0, 0.25)'
	});
	Cufon.replace('h2', {
		color: '-linear-gradient(#1c57b9, #18438c)',
		textShadow: '0px 1px rgba(0, 0, 0, 0.25)'
	});
	Cufon.replace('h3', {
		color: '-linear-gradient(#1c57b9, #18438c)',
		textShadow: '0px 1px rgba(0, 0, 0, 0.25)'
	});
	Cufon.replace('h5', {
		color: '-linear-gradient(#1c57b9, #18438c)',
		textShadow: '0px 1px rgba(0, 0, 0, 0.25)'
	});
	Cufon.replace('h6', {
		color: '#fff',
		textShadow: '0px 1px rgba(0, 0, 0, 0.5)'
	});
	
	$(document).ready(function() {			
		$("a.fancy").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'		:	600, 
			'speedOut'		:	200,
			'overlayShow'	:	false,
			'titlePosition'	:	'over'
		});
	});	
	
});

$(window).hashchange(function(){
	pokazStrone(location.hash);	
});



function pokazStrone(hash) {
	if($(".strona").length>1){
		$(".strona").hide();
		$(".str"+hash.replace("#","")).show();
		$(".linkStrony").removeClass("active");
		$(".link"+hash.replace("#","")).addClass("active");
	}
}

function kalendarz(miesiac, rok) {

	$.ajax({url: $("base").attr("href")+"kalendarz/box.html",
        type: "POST",
        data: {
			miesiac: miesiac,
			rok: rok
		},
        error: function() {
			alert('Wystąpił błąd podczas przeładowania kalendarza');
		},
        success: function(data) {
			$("#calendarBox").replaceWith(data);
        }
    });
	
}
