Shadowbox.init();

  	$(document).ready(function() {		
		$('#main_menu a').click(function() {
			$('#main_menu a').removeClass('active');
			$(this).addClass('active');
		});		
	});
	
function wynik(mecz) {
	$(".mecz").hide();
	$("#"+mecz+"_mecz").fadeIn("slow");
	
	$('#wynik a').removeClass('active');
	$("#"+mecz).addClass('active');	
}
	
function getKalendarz(data) {
	var thisUrll = "/moduly/kalendarz/kalendarz.ajax.php?data="+data; 
	$("#kalendarz").load(thisUrll); 
}

/*
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'random', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:500, //Slide transition speed
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
});
										
*/


/*

  $(document).ready(function(){


											$("#top .main_menu div").mouseenter(function()
											{											
												$(this).children('ul').show();
												$(this).children('.extendable').addClass('active2');												
											});
											
											$("#top .main_menu div").mouseleave(function()
											{												
												$(this).children('ul').hide();
												$(this).children('.extendable').removeClass('active2');
											});


										});
										
*/

//ajax plynny 

/*

function newsPage(nr) {

var thisUrl = "inc/inc.aktualnosc.php?page="+nr; 



$('#news').fadeOut("fast", function() {
   $('#loader').show();
$("#news").load(thisUrl, null,
    function(){
         $('#loader').hide();
        $('#news').fadeIn("fast");
       }
   ); 
});

}

//ajax nie plynny
/*

function newsPage(nr) {

var thisUrl = "inc/inc.aktualnosc.php?page="+nr; 



$("#news").load(thisUrl, null,
    function(){
      //   $('#loader').hide();
        $('#news').show();
       }
   ); 
	 
});

}
*/


function potwierdzenie(pytanie,adres)
	{	
		if (alert(pytanie))
		{
			document.location.href = adres;
		}
	}
	
function back()
{
	javascript:history.go(-1);
}
 
										


function drukuj(){

   if (!window.print){
      alert("Wystapil problem z drukarka!")
   return 0;
   }
 window.print(); // jesli wszystko ok drukuj
}


function bookmarksite(title,url){
if (window.sidebar) 
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ 
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)
	window.external.AddFavorite(url, title);
}


/*
 * Image preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});







