function pop_strona(url, width, height) {
	var left = (screen.width/2) - width/2;
	var top = (screen.height/2) - height/2;
	var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	var okno=window.open(url, "_blank", styleStr);
}

function pop_img(plik, szerokosc, wysokosc, opis) {
	opis= !opis ? 'Zdjêcie' : opis;	
	var left = (screen.width/2) - szerokosc/2;
	var top = (screen.height/2) - wysokosc/2;
	var styl = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no';
	styl += ',width='+szerokosc+',height='+wysokosc+',left='+left+',top='+top+',screenX='+left+',screenY='+top;
	var pop_okno = window.open("", "_blank", styl);
	var zawartosc = '<html>';
	zawartosc += '<head>';
	zawartosc += '<title>'+opis+'</title>';
	zawartosc += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />';
	zawartosc += '</head>';
	zawartosc += '<body style="background-color:#000; margin:0px">';
	zawartosc += '<table cellspacing="0" style="width:100%; height:100%; padding:0px; border:0px">';
	zawartosc += '<tr>';
	zawartosc += '<td align="center" valign="middle">';
	zawartosc += '<img src="'+plik+'" onClick="window.close()" border="0" alt="Zamknij" title="Zamknij" />';
	zawartosc += '</td>';
	zawartosc += '</tr>';
	zawartosc += '</table>';
	zawartosc += '</body>';
	zawartosc += '</html>';
	pop_okno.document.write(zawartosc);
	pop_okno.document.close();
}

function closePopImg() {
	document.getElementById("popImg").style.display = "none";
}


function setActiveBudynek(nr) {
	document.getElementById("budynek1").style.backgroundColor = '#DDD7CE';
	document.getElementById("budynek2").style.backgroundColor = '#DDD7CE';
	document.getElementById("budynek3").style.backgroundColor = '#DDD7CE';
	
	document.getElementById("budynek1").style.color = '#6C6457';
	document.getElementById("budynek2").style.color = '#6C6457';
	document.getElementById("budynek3").style.color = '#6C6457';	
	
	//document.getElementByClass("budynki1").style.display = "none";
	//document.getElementByClass("budynki2").style.display = "none";
	//document.getElementByClass("budynki3").style.

	document.getElementById("budynek"+nr.toString()).style.backgroundColor = '#6C6457';
	document.getElementById("budynek"+nr.toString()).style.color = '#FFFFFF';
	
	//document.getElementByClass("budynki"+nr.toString()).style.display = 'inherit';	
	
	
	var allHTMLTags=document.getElementsByTagName("*");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className == "budynki1" || allHTMLTags[i].className == "budynki2" || allHTMLTags[i].className == "budynki3") {
			//alert(allHTMLTags[i].style.display);
			allHTMLTags[i].style.display = 'none';
		}
		if (allHTMLTags[i].className == "budynki"+nr.toString()) {
			allHTMLTags[i].style.display = 'table-row';
		}
	}
	
	document.getElementById("planBudynkow").style.backgroundImage = "url(images/plany/plan_osiedla"+nr.toString()+".jpg)";
}

function gotoBudynek(nr) {
	window.top.location.href = 'index.php?strona=00013&obiekt=00010&budynek='+nr.toString();
}
