

function confirmSearch()
{
	var val = document.getElementById('klucz').value;
	if (val == '' || val == 'wpisz szukaną frazę' )
	{
		alert('Podaj frazę którą chcesz wyszukać.');
		return false;
	}
	else
		return true;
}

function movePanel()
{
	var ilePaneli  = 4; var czas = 1000; var przerwa = 5000;
	if (typeof(this.pop) == 'undefined')
		this.pop = 1;
	
	
	if (typeof(this.nast) == 'undefined')
		this.nast = 2;
	
	
	$('#panel'+this.pop).stop().animate( {'top':'30px','height':'208px'},czas);
	$('#plac'+this.pop).stop().animate( {'color':"#5A5A5A"},czas);
	$('#szczegoly'+this.pop).stop().animate({opacity:'0'},czas);
	
	$('#panel'+this.nast).stop().animate( {'top':'0px','height':'248px'},czas);
	$('#plac'+this.nast).stop().animate( {'color':"#007FC9"},czas);
	$('#szczegoly'+this.nast).stop().animate({opacity:'1'},czas, function() { setTimeout('movePanel();',przerwa); });
	
	if (this.nast == 2)
		$('#infoPanel').animate({'margin-left':'250px'},czas);
	else if (this.nast == 3)
		$('#infoArrow').animate({'margin-left':'360px'},czas);
	else if (this.nast == 4)
		$('#infoPanel').animate({'margin-left':'505px'},czas);
	else if (this.nast == 1)
	{
		$('#infoPanel').animate({'margin-left':'0px'},czas);
		$('#infoArrow').animate({'margin-left':'101px'},czas);
	}
	
	$('#txt'+this.pop).animate({opacity:'0'},czas);
	$('#txt'+this.nast).animate({opacity:'1'},czas);
	
	
	this.pop = this.nast;
	
	this.nast == ilePaneli ? this.nast=1 : this.nast++;
}

var timeoutID = false;
function slideBanner(ktory)
{
	if (typeof(this.ile) == 'undefined')
		this.ile = $('img.mainGalleryImg').length;
	if (typeof(this.pop) == 'undefined')
		this.pop = 1; 
	if (typeof(this.nast) == 'undefined')
		this.nast = 2;
	
	
	var czas = 1000;
	var nast = (ktory == false) ?  this.nast :  ktory;
	
	if (ktory != false)
	{
		$('#bannerImg' + this.pop).stop();
		$('#bannerImg' + nast).stop();
		
		if (timeoutID != false)
			clearTimeout(timeoutID);
	}
		
	
	if (this.pop != nast)
	{
		document.getElementById('btn'+this.pop).className = 'btn';
		document.getElementById('btn'+nast).className = 'btn sel';
	
	
		$('#bannerImg' + this.pop).stop().animate({'opacity':0},czas, 
			function() 
			{ 
				$('#bannerImg' + nast).stop().animate( {'opacity':1},czas, 
					function() { timeoutID = setTimeout("slideBanner(false)",4100); } ); 
			} );
	}
	
	
	this.pop = this.nast;
	this.nast == this.ile ? this.nast=1 : this.nast++;
	
}


function showSubmenu()
{
	$('#submenuPanel').stop().animate({'opacity':1},500);
}
var timerID;
function stopHide()
{
	clearTimeout(timerID);
}

function hideMenu()
{
	$('#submenuPanel').stop().animate({'opacity':0},500);
}

