function top_menu_over(obj)
{
	obj.oldClassName = obj.className;
	obj.className = "top_menu_hover";
}
function top_menu_out(obj)
{
	obj.className = obj.oldClassName;
}
isGecko = false;
if (navigator.userAgent)
{
agt=navigator.userAgent.toLowerCase();
if (agt.indexOf('gecko') != -1) { isGecko = true; }
}
function getById(id)
{
if (document.getElementById) return document.getElementById(id);
else if (document.all) return document.all[id];
else return null;
}								
function winopen(plik, w, h)
{ return winopen(plik, w, h, "no","no") }
function winopen(plik, w, h, scroll)
{ return winopen(plik, w, h, scroll,"no") }
function winopen(plik, w, h, scroll,resizable)
{
aw=640;
ah=450;
if(window.screen) 
{
	aw=screen.availwidth;
	ah=screen.availheight;
	if (!(aw > 0))
	{ aw=screen.width;ah=screen.height;}
}
ustawienia=
"width="+w+","
+"height="+h+","
+"left="+(aw-w)/2+","
+"top="+(ah-h)/2+","
+"screenX="+(aw-w)/2+","
+"screenY="+(ah-h)/2+","
+"toolbar=no,"
+"location=no,"
+"directories=no,"
+"status=no,"
+"menubar=no,"
+"scrollbars="+scroll+","
+"name="+plik+","
+"resizable="+resizable;
noweokno=window.open(plik,('o_' + Math.random (100)).replace ('.','_'),ustawienia);
return noweokno;
}

mailValidator = /^[a-zA-Z0-9._-]+\@([a-zA-Z0-9_-]+\.){1,}[\w]{1,4}$/;
numberValidator = /^[0-9]+$/;
phoneValidator = /^[0-9 +-]+$/;
letterValidator = /^[a-zA-Z]+$/;
zipCodeValidator = /^\d\d(-)\d\d\d$/;
numberekValidator = /^[a-zA-Z0-9_!.?]*[0-9][a-zA-Z0-9_!.?]*$/;
dateValidator = /^(?=\d)(?:(?!(?:1582(?:\.|-|\/)10(?:\.|-|\/)(?:0?[5-9]|1[0-4]))|(?:1752(?:\.|-|\/)0?9(?:\.|-|\/)(?:0?[3-9]|1[0-3])))(?=(?:(?!000[04]|(?:(?:1[^0-6]|[2468][^048]|[3579][^26])00))(?:(?:\d\d)(?:[02468][048]|[13579][26]))\D0?2\D29)|(?:\d{4}\D(?!(?:0?[2469]|11)\D31)(?!0?2(?:\.|-|\/)(?:29|30))))(\d{4})([-\/.])(0?\d|1[012])\2((?!00)[012]?\d|3[01])(?:$|(?=\x20\d)\x20))?((?:(?:0?[1-9]|1[012])(?::[0-5]\d){0,2}(?:\x20[aApP][mM]))|(?:[01]\d|2[0-3])(?::[0-5]\d){1,2})?$/;
cityNameValidator = /\D+$/;

function sliderNavigation()
{
	$$('img.sliderNav').each(function(arrow, index) 
	{
		Event.observe(arrow,'click',function()
		{
			sliderNavigationDisable();
			
			if ($('slidingBox').readAttribute('curpos')==undefined) $('slidingBox').writeAttribute('curpos','0');
			var curPos = Number($('slidingBox').readAttribute('curpos'));
			var direction = Number((arrow != $$('img.sliderNav')[0]) ? 1 : -1); // <- = -1 ; 1 = ->
			var currentPos = Number($('slidingBox').positionedOffset()[0]);
			var newPos = currentPos - (direction *(($('slidingBox').select('td')[curPos].getWidth()))); // aktualna pozycja (+/-) szerokość komórki
			if ((newPos % 2) != 0) newPos = newPos-1;
			
			curPos += direction;
			$('slidingBox').writeAttribute('curpos',curPos);
			
			if(newPos == 0) // chowanie <-
			{
				$$('img.sliderNav')[0].hide();
			}
			else
			{	
				$$('img.sliderNav')[0].show();
			}
			if(newPos < (($('sliderWrapper').getWidth())-($('slidingBox').getWidth())+($('slidingBox').select('td')[curPos].getWidth()))) // chowanie ->
			{
				$$('img.sliderNav')[1].hide();
			}	
			else
			{
				$$('img.sliderNav')[1].show();
			}
			
			new Effect.Move('slidingBox', { x: newPos, y: 0, mode: 'absolute', duration: 0.3, afterFinish:function(){ sliderNavigation(); }
			});			
		});
	});
}

function sliderNavigationDisable(){
	$$('img.sliderNav').each(function(arrow) 
	{
		arrow.stopObserving('click');
	});
}
