            /*********************
//* jQuery Multi Level CSS Menu (horizontal)- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//* Menu instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//* Last modified: Sept 6th, 08'. Usage Terms: http://www.dynamicdrive.com/style/csslibrary/tos/
*********************/

//Specify full URL to down and right arrow images (25 is padding-right to add to top level LIs with drop downs):
var arrowimages={down:['downarrowclass', 'arrow-down.gif', 25], right:['rightarrowclass', 'arrow-right.gif']}

var jquerycssmenu={

fadesettings: {overduration: 100, outduration: 50}, //duration of fade in/ out animation, in milliseconds

buildmenu:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenu=$("#"+menuid+">ul")
		var $headers=$mainmenu.find("ul").parent()
		$headers.each(function(i){
			var $curobj=$(this)
			var $subul=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulw:$subul.outerWidth(), subulh:$subul.outerHeight()}
			this.istopheader=$curobj.parents("ul").length==1? true : false
			$subul.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			$curobj.children("a:eq(0)").css(this.istopheader? {paddingRight: arrowsvar.down[2]} : {}).append(
				''
			)
			$curobj.hover(
				function(e){
					var $targetul=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleft=this.istopheader? 0 : this._dimensions.w
					menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())? (this.istopheader? -this._dimensions.subulw+this._dimensions.w : -this._dimensions.w) : menuleft
					$targetul.css({left:menuleft+"px"}).fadeIn(jquerycssmenu.fadesettings.overduration)
				},
				function(e){
					$(this).children("ul:eq(0)").fadeOut(jquerycssmenu.fadesettings.outduration)
				}
			) //end hover
		}) //end $headers.each()
		$mainmenu.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myjquerymenu" on page:
jquerycssmenu.buildmenu("myjquerymenu", arrowimages)



function news(slug){
window.location = 'http://orleta.lukow.pl/News/Show/s/'+slug
}

function displayQCalendar(m, y) {
	var div = $("#quickCalender");
	var host = (("www.orleta.lukow.pl" == document.domain) ? "http://www.orleta.lukow.pl/" : "http://orleta.lukow.pl/");

	div.html('<img id="ajaxloader" src="Template/images/ajax-loader.gif" style="display: block; margin: 0 auto;">'); 
	$.ajax({  
		type: "GET", url: host + "ajax/kalendarz.php", data: 'm='+m+'&y='+y,  
			complete: function(data){  
			div.html(data.responseText);  
		}  
	});  	
}
function tabelka(jebac) {
	var div = $("#tabelka");
	var host = (("www.orleta.lukow.pl" == document.domain) ? "http://www.orleta.lukow.pl/" : "http://orleta.lukow.pl/");

	div.html('<img id="ajaxloader" src="Template/images/ajax-loader.gif" style="display: block; margin: 0 auto;" />'); 
	$.ajax({  
		type: "GET", url: host + "tabela/show.php", data: 'show_table=yes&jebac_radzyn='+jebac+'&typ=1',  
			complete: function(data){
			$("#tabelka").html(data.responseText); 
			$("td:contains('Orlęta Łuków')").parent().css("font-weight", "bold");

		}  
	});  	
}
function mecz(mecz_id) {
	var div = $("#mecze");
	var host = (("www.orleta.lukow.pl" == document.domain) ? "http://www.orleta.lukow.pl/" : "http://orleta.lukow.pl/");

	div.html('<img id="ajaxloader" src="Template/images/ajax-loader.gif" style="display: block; margin: 0 auto;">'); 
	$.ajax({  
		type: "GET", url: host + "Ajax/mecze/", data: 'mecz='+mecz_id,  
			complete: function(data){  
			div.html(data.responseText);  
		}  
	});  	
}
function kolejka(kolejka) {
	var div = $("#rozgrywki");
	var host = (("www.orleta.lukow.pl" == document.domain) ? "http://www.orleta.lukow.pl/" : "http://orleta.lukow.pl/");

	div.html('<img id="ajaxloader" src="Template/images/ajax-loader.gif" style="display: block; margin: 0 auto;">'); 
	$.ajax({  
		type: "GET", url: host + "ajax/rozgrywki.php", data: 'k='+kolejka,  
			complete: function(data){  
			div.html(data.responseText);  
		}  
	});  	
}




/* ------------------------- */
//Radoslaw Zatoka
//wild_king@o2.pl
// Array of all slides
var allSlides;
// Slide counter
var currSlide;
// select with fixtures
var fixtureSelect;
// Set global with array of slide elements
function getAllSlides(slideContainer) {
	var allChildren = document.getElementById(slideContainer).childNodes;
	var slideElems = new Array();
	for (var i = 0; i < allChildren.length; i++) {
		if (allChildren[i].nodeType == 1) {
			slideElems[slideElems.length] = allChildren[i];
		}
	}
	allSlides = slideElems;
}
// Advance to next slide
function next() {
	if (currSlide < 0) { //poza zakresem z dolu
		allSlides[++currSlide].style.display = "block";
	} else if (currSlide < allSlides.length - 1) { //wyswietlony nieostatni
		allSlides[currSlide].style.display = "none";
		allSlides[++currSlide].style.display = "block";
	}
	updateSelect();
}

// Go to previous slide
function prev() {
	if (currSlide > allSlides.length - 1) { //poza zakresem z gory
		allSlides[--currSlide].style.display = "block";
	} else if (currSlide > 0) { //wyswietlony niepierwszy
		allSlides[currSlide].style.display = "none";
		allSlides[--currSlide].style.display = "block";
	}
	updateSelect();
}

// Ukrywa poprzedni i pokazuje wskazany
function show(number) {
	allSlides[currSlide].style.display = "none";
	allSlides[number].style.display = "block";
	currSlide = number;	
}

function updateSelect(){
	fixtureSelect[currSlide].selected = true;
}

function initSlides(visible, slideContainer, slideId, selectId) {
	document.getElementById(slideId+visible).style.display = 'block';
	currSlide = visible;
	fixtureSelect = document.getElementById(selectId);
	updateSelect();
	getAllSlides(slideContainer);
}
/* ------------------------- */

