function otworzokno(numer,wys,szer,nazwa) {
okno=window.open("","",'toolbar=no, menubar=no, personalbar=no, status=no, resizable=no,height='+wys+',width='+szer+',left=100,top=100');
okno.document.write("<html><head><META HTTP-EQUIV='Content-type' CONTENT='text/html; charset=iso-8859-2'><link rel='stylesheet' href='style2.css' type='text/css'><title>" + nazwa + "</title></HEAD><body background='img/kolor.gif' leftmargin='0' rightmargin='0' topmargin='0' marginwidth='0' marginheight='0'><center><table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td valign='middle' align='center'>");
okno.document.write("<a href='javascript:window.close()'><img src='pliki/" + numer + "' border=0></a><br />" + nazwa + "</td></tr></table></center></body></html>");
}
function otworzokno2(numer,wys,szer,nazwa) {
okno=window.open("","",'toolbar=no, menubar=no, personalbar=no, status=no, resizable=no,height='+wys+',width='+szer+',left=100,top=100');
okno.document.write("<html><head><META HTTP-EQUIV='Content-type' CONTENT='text/html; charset=iso-8859-2'><link rel='stylesheet' href='style2.css' type='text/css'><title>" + nazwa + "</title></HEAD><body background='img/kolor.gif' leftmargin='0' rightmargin='0' topmargin='0' marginwidth='0' marginheight='0'><center><table border='0' cellpadding='0' cellspacing='0' width='100%' height='100%'><tr><td valign='middle' align='center'>");
okno.document.write("<a href='javascript:window.close()'><img src='strony/" + numer + "' border=0></a><br />" + nazwa + "</td></tr></table></center></body></html>");
}

function otworzm1(numer,wys,szer) {
	okno=window.open("","",'toolbar=no, menubar=no, personalbar=no, status=no, resizable=no,height='+wys+',width='+szer+',left=100,top=100');
	okno.document.write("<html><title>Komnaty Parteru - Wawel</title><body background='img/kolor.gif' leftmargin=0 rightmargin=0 topmargin=0 marginwidth=0 marginheight=0><center><table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td valign=middle align=center>");
	okno.document.write("<img src=ekspozycje/mapa1.gif border=0 USEMAP='/#mapa1_Map'><MAP NAME='mapa1_Map'><AREA SHAPE='rect' ALT='salon wielkorządcy' COORDS='293,187,394,246' HREF='javascript:opener.location.replace(\"index.php?s=ekspozycje&id=1#1\");'><AREA SHAPE='rect' ALT='salon wielkorządcy' COORDS='9,99,195,124' HREF='javascript:opener.location.replace(\"index.php?s=ekspozycje&id=1#1\");' ></MAP></td></tr></table></center></body></html>");
}

function otworzm(tytul,plik,szer,wys) {
	okno=window.open("","",'toolbar=no, menubar=no, personalbar=no, status=no, resizable=no,height='+ wys +',width='+ szer +',left=100,top=100');
	okno.document.write("<html><title>" + tytul + "</title><body background='img/kolor.gif' leftmargin=0 rightmargin=0 topmargin=0 marginwidth=0 marginheight=0><center><table border=0 cellpadding=0 cellspacing=0 width=100% height=100%><tr><td valign=middle align=center>");
	okno.document.write("<img src=ekspozycje/" + plik + " border=0></td></tr></table></center></body></html>");
}


function show(ele){
		document.getElementById(ele).style.visibility="visible";
		document.all.ele.style.visibility="visible";
}
function hide(ele){
		document.getElementById(ele).style.visibility="hidden";
		document.all.ele.style.visibility="hidden";
}


function getElementsByClassName(oElm, strTag, strClass) {
var arrElements = (strTag == "*" && oElm.all) ? oElm.all : oElm.getElementsByTagName(strTag);
var arrReturnElements = new Array();
strClass = strClass.replace(/\-/g, "\\-");
var oRegExp = new RegExp("(^|\\s)" + strClass + "(\\s|$)");
var oElement;
for (var i=0; i<arrElements.length; i++) {
oElement = arrElements[i];
if(oRegExp.test(oElement.className)) {
arrReturnElements.push(oElement);
}
}
return (arrReturnElements);
}

function zaznacz( strClass) {
var set=false;
elmnts = getElementsByClassName(document, "input", strClass);
for(var i=0; i<elmnts.length; i++) {
elmnts[i].checked=true;
}
}
function odznacz( strClass) {
var set=false;
elmnts = getElementsByClassName(document, "input", strClass);
for(var i=0; i<elmnts.length; i++) {
elmnts[i].checked=false;
}
}

function zaznacz2( strClass, wartosc ) {
var set=false;
elmnts = getElementsByClassName(document, "select", strClass);
for(var i=0; i<elmnts.length; i++) {
elmnts[i].value=wartosc;
}
}


function pokaz_ukryj(warstwa,strClass)
{
 if (document.getElementById(warstwa).style.display!='block') 
 {
 	document.getElementById(warstwa).style.display='block';
	if (strClass != '')
	{
		zaznacz( strClass);
	}
 }
 else 
 {
 	document.getElementById(warstwa).style.display='none';
 	if (strClass != '')
	{
		odznacz( strClass);
	}
 }
}

function sprawdz_podpunkty (punkt,ile)
{
	var wszystkie = true;
	var ile_z = 0;
	for(var i=1; i<=ile; i++)
	{
		j = "tak2_"+punkt+"_"+i+"";
 		if (document.getElementById(j).checked==true)
		{
			ile_z++;
		}
		else
		{
			wszystkie = false;
		}
	}
	if (wszystkie == true)
	{	
		k = "tak_"+punkt+"";
 		document.getElementById(k).checked=true;	
	}
	else 
	{
		if (ile_z > 0)
		{	
			k = "tak_"+punkt+"";
	 		document.getElementById(k).disabled = true;	
			document.getElementById(k).checked=true;	
		}
	}
}




// No further customizations required.
function AddFormField(id,type,name,value,tag) {
if(! document.getElementById && document.createElement) { return; }
var inhere = document[id];
var formfield = document.createElement("input");
if(name.length < 1) {
   DefaultNameIncrementNumber++;
   name = String(DefaultName + DefaultNameIncrementNumber);
   }
formfield.name = name;
formfield.type = type;
formfield.value = value;
if(tag.length > 0) {
   var thetag = document.createElement(tag);
   thetag.appendChild(formfield);
   inhere.appendChild(thetag);
   }
else { inhere.appendChild(formfield); }
} // function AddFormField()
