function BrowserCheck()
{
	// OPERA
	if (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) browser="OP";
	// Internet Explorer e.g. IE4 upwards :
	if (document.all) browser="IE";
	// Netscape version 4
	if (document.layers) browser="NN";
	//Mozila e.g. Netscape 6 upwards
	if (!document.all && document.getElementById) browser="MO";
	return browser;
}

function DisplayLayer(id,action)
{
	// Sprawdzanie wersji przegl?darki
	browser = BrowserCheck();

	wynik=false;

	if ((browser == "IE") && (document.all[id]))
	{
		eval("document.all." + id + ".style.display = '" + action + "'");
		wynik = true;
	}
	if ((browser == "NN") && (document[id]))
	{
		eval("document." + id + ".display = '" + action + "'");
		wynik = true;
	}
	if ((browser == "MO" || browser == "OP") && (document.getElementById(id)))
	{
		eval("document.getElementById('" + id + "').style.display = '" + action + "'");
		wynik = true;
	}

	return wynik;
}
  widac_warstwe = false;
	function twoje_dane_click(id)
	{
		if (widac_warstwe == true) 
		{ 
			DisplayLayer(id,'none');
		}
		else 
		{ 
			DisplayLayer(id,''); 
		}
		widac_warstwe = !widac_warstwe;
		return true;
	}
	
var popupWin_Sec = null;
function showPopup_Sec(url, width, height, features, position, closeOld) {
	scrWidth = 640; scrHeight = 480;
	if (window.screen) {scrWidth = window.screen.width; scrHeight = window.screen.height}
    posX = 0; posY = 0;
    if (position == null || position == 0) {
        posX = Math.round((scrWidth - width)/2);
        posY = Math.round((scrHeight - height)/2);
    } else if (position == 1) {
        posX = document.body.offsetWidth - width - 10;
        posY = window.screenTop;
    }

	var inpopupWin_Sec = null;
	var windowName = closeOld? "popupWin_Sec": "new_sec";
	var inFeatures = "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no,copyhistory=no,dependent=yes,width=" + width + ",height=" + height + ",left=" + posX + ",top=" + posY;
	if (features) inFeatures += "," + features;
	if (closeOld && popupWin_Sec != null && !document.layers) {popupWin_Sec.close();}
	inpopupWin_Sec = window.open(url, windowName, inFeatures);

	inpopupWin_Sec.focus();	
	if (closeOld) 
		popupWin_Sec = inpopupWin_Sec;
		
	return inpopupWin_Sec;
}

function zmien(ile,grafika,plik) 
{ 
	//alert(grafika);
	//alert(ile);
	//alert(document.getElementById(grafika));
	browser = BrowserCheck();
	if(document.getElementById(grafika).value == 0)
	{
		if(ile >=1)
		{
			if ((browser == "IE"))
			{
				document.getElementById('1_'+grafika).src=plik; 
			}
			if ((browser == "MO" || browser == "OP"))
			{
				document.images['1_'+grafika].src=plik; 
			}
			if(ile >= 2)
			{
				if ((browser == "IE"))
				{
					document.getElementById('2_'+grafika).src=plik; 
				}
				if ((browser == "MO" || browser == "OP"))
				{
					document.images['2_'+grafika].src=plik; 
				}
				if(ile >= 3)
				{
					if ((browser == "IE"))
					{
						document.getElementById('3_'+grafika).src=plik; 
					}
					if ((browser == "MO" || browser == "OP"))
					{
						document.images['3_'+grafika].src=plik; 
					}
					if(ile >= 4)
					{
						if ((browser == "IE"))
						{
							document.getElementById('4_'+grafika).src=plik; 
						}
						if ((browser == "MO" || browser == "OP"))
						{
							document.images['4_'+grafika].src=plik; 
						}
						if(ile == 5)
						{
							if ((browser == "IE"))
							{
								document.getElementById('5_'+grafika).src=plik; 
							}
							if ((browser == "MO" || browser == "OP"))
							{
								document.images['5_'+grafika].src=plik; 
							} 
						}
					}
				}
			}
		}
	}
}

function ocen(id,ile)
{
	document.getElementById(id).value = ile;
}
