//header-zdjecia
$(document).ready(function() {
    $('#banner2').cycle({
		fx: 'scrollDown', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:    4000, 
		timeout:  5000,
		random: 1
	});
});

//nastepna, poprzednia kolejka
$(function() {
	$("#show-prev").click(function(){
		$("#prev-round").show(1200);
		$("#show-prev").hide();
		$("#hide-prev").show();
		return false;	
	});
	
	$("#hide-prev").click(function(){
		$("#prev-round").hide(1200);
		$("#show-prev").show();
		$("#hide-prev").hide();
		return false;	
	});
});

$(function() {
	$("#show-next").click(function(){
		$("#next-round").show(1200);
		$("#show-next").hide();
		$("#hide-next").show();
		return false;	
	});
	
	$("#hide-next").click(function(){
		$("#next-round").hide(1200);
		$("#show-next").show();
		$("#hide-next").hide();
		return false;	
	});
});

//tabela
$(document).ready(function() {	

	//Get the height of the first item
	$('#mask').css({'height':$('#table-all').height()});	
	
	//Calculate the total width - sum of all sub-panels width
	//Width is generated according to the width of #mask * total of sub-panels
	$('#panel').width(parseInt($('#mask').width() * $('#panel div').length));
	
	//Set the sub-panel width according to the #mask width (width of #mask and sub-panel must be same)
	$('#panel div').width($('#mask').width());
	
	//Get all the links with rel as panel
	$('a[rel=panel]').click(function () {
	
		//Get the height of the sub-panel
		var panelheight = $($(this).attr('href')).height();
		
		//Set class for the selected item
		$('a[rel=panel]').removeClass('selected');
		$(this).addClass('selected');
		
		//Resize the height
		$('#mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		//Scroll to the correct panel, the panel id is grabbed from the href attribute of the anchor
		$('#mask').scrollTo($(this).attr('href'), 800);		
		
		//Discard the link default behavior
		return false;
	});
	
});

//scroll-news
$(function(){ $("ul#scroll-news").liScroll(); }); 

