isGecko=false;
if(navigator.userAgent)
{
	if(navigator.userAgent.toLowerCase().indexOf('gecko')!=-1) isGecko=true
}

isLinux=false;
if(navigator.platform)
{
	if(navigator.platform.toLowerCase().indexOf('linux')!=-1) isLinux=true
}



function testFirefoxFlashLinuxBug()
{
	if (isGecko && isLinux && DetectFlashVer(10,0,0) == false)
	{
		if (flashFixType == 1)
		{
			var elem = getById('page_bg');
			if (elem)
			{
				elem.innerHTML = '<img src=\'/sys_images/linuxflashfix1.jpg\' width=\'986\' border=\'0\' alt=\'\'/>';
			}
		}
		else if (flashFixType == 2)
		{
			var elem = getById('page_bg');
			if (elem)
			{
				elem.innerHTML = '<img src=\'/sys_images/linuxflashfix2.jpg\' width=\'986\' border=\'0\' alt=\'\'/>';
			}
		}
	}	
}

function testFirefoxFloatBug()
{
	if (isGecko)
	{
		setTimeout(function() {firefoxFloatBug();},100);
		setTimeout(function() {firefoxFloatBug();},2000);
	}
}

function firefoxFloatBug()
{
	var oLink = document.createElement("link") 
	oLink.href = "/css/FF_floatbug_style.css"; 
	oLink.rel = "stylesheet"; 
	oLink.type = "text/css"; 
	oLink.media = "screen,print";
	document.body.appendChild(oLink); 
}




function getById(a)
{
if(document.getElementById) return document.getElementById(a);
else if(document.all) return document.all[a];
else return null
}
function winopen(a,w,h)
{
	return winopen(a,w,h,"no","no")
}
function winopen(a,w,h,b)
{
	return winopen(a,w,h,b,"no")
}
function winopen(a,w,h,b,c)
{
	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="+b+","+"name="+a+","+"resizable="+c;
	noweokno=window.open(a,('o_'+Math.random(100)).replace('.','_'),ustawienia);
	return noweokno
}
function addEnterHandler(e,a)
{
	if(!e)
	{
		var e=window.event;
		window.event.cancelBubble=true
	}
	var b;
	if(e.keyCode)b=e.keyCode;
	else if(e.which)b=e.which;
	if(b==13)setTimeout(a,0)
}
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+$/;

var menuTableEvent = new Object();
menuTableEvent[0] = new Object();
menuTableEvent[1] = new Object();

function top_menu_over(obj,maxH,table)
{
try
{
	var elem = obj.childNodes.item(1);
	if (elem!=null)
	{
		if (menuTableEvent[table]['current']!='') menuTableEvent[table][menuTableEvent[table]['current']] = 'out';
		if (menuTableEvent[table][elem.id] != 'over')
		{
			menuTableEvent[table]['current'] = elem.id;
			menuTableEvent[table][elem.id] = 'over';
			
			elem.style.overflow = 'hidden';
			elem.style.display = 'block';
			expandMenu(elem,maxH,table);
			shrinkMenu(elem,table);
		}
	}
}
catch (ex)
{
}
}
function top_menu_out(obj,table)
{	
try
{
	var elem = obj.childNodes.item(1);
	if (elem!=null)
	{
		menuTableEvent[table][elem.id] = 'out';
		var objStyle = elem.style;
		objStyle.overflow = 'visible';
		objStyle.display = 'none';
		objStyle.height = '1px';
		menuTableEvent[table][elem.id] = '';
	}
}
catch (ex)
{
}
}

function expandMenu(obj,maxH,table)
{
	try
	{
		if (menuTableEvent[table][obj.id] == 'over')
		{
			var objStyle = obj.style;
			//var curHdouble = Number(objStyle.height.replace('px',''))*1.5;
			//if (curHdouble>=maxH)
			//{
				objStyle.overflow = 'visible';
				objStyle.height = maxH+'px';
				return;
			//}
			//objStyle.height = Math.round(curHdouble)+'px';
			//setTimeout(function() {expandMenu(obj,maxH,table);},15);
		}
	}
	catch(ex)
	{
	}
}

function shrinkMenu(obj,table)
{
	try
	{
		//var objStyle = obj.style;
		//var curHdouble = Number(objStyle.height.replace('px',''));
	
		if (menuTableEvent[table][obj.id] != 'over')
		{
			//objStyle.overflow = 'hidden';
			//curHdouble = curHdouble*0.5;
			//if (curHdouble<=1)
			//{
				var objStyle = obj.style;
				objStyle.overflow = 'visible';
				objStyle.display = 'none';
				objStyle.height = '1px';
				menuTableEvent[table][obj.id] = '';
				return;
			//}
			//objStyle.height = Math.round(curHdouble)+'px';
			
		}
		setTimeout(function() {shrinkMenu(obj,table);},5);
	}
	catch (ex)
	{
	}
}

