var x
var y
var newImgWindow
function makeNewImgWindow (x, y) {
	var sizeX = x + 20
	var sizeY = y + 30
	if (screen.Width <= sizeX) {var xMoveTo = 0}
	else {var xMoveTo = (screen.Width - sizeX) / 2}
	if (screen.availHeight <= sizeY) {var yMoveTo = 0}
	else {var yMoveTo = (screen.Height - sizeY) / 2}
	newImgWindow = window.open("","","width="+ sizeX +", height="+ sizeY +", toolbar=no, menubar=no")
	newImgWindow.moveTo(xMoveTo, yMoveTo);
}
function closeNewImgWindow () {
	if (newImgWindow) {
		newImgWindow.close()
	}

}

function showImg (poImg,x,y) {
	if (!x) {x = 800}
	if (!y) {y = 600}
	var x2 = x / 2
	var y2 = y / 2
	closeNewImgWindow ()
	makeNewImgWindow (x, y)
	var newImgWindowContent = "<HTML><HEAD><TITLE>Zdjêcie</TITLE>"
	newImgWindowContent += "<META http-equiv='Content-Type' content='text/html; charset=iso-8859-2'></HEAD>"
	newImgWindowContent += "<BODY oncontextmenu='event.returnValue=false;'><DIV align='center'>"
	newImgWindowContent += "<A href='javascript:self.close()'><img src='gfx/spacer.gif' alt='kliknij by zamkn±æ okno' width='"+x+"' height='"+y+"' border='0' style='position:absolute;left:10;top:15;z-index:100'></A>"
	newImgWindowContent += "<TABLE width='"+x+"' height='"+y+"' border='0' cellspacing='0' cellpadding='0'>"
	newImgWindowContent += "<TR><TD><IMG src='gfx/"+poImg+"_01.jpg' width='"+x2+"' height='"+y2+"'></TD><TD><IMG src='gfx/"+poImg+"_02.jpg' width='"+x2+"' height='"+y2+"'></TD></TR>"
	newImgWindowContent += "<TR><TD><IMG src='gfx/"+poImg+"_03.jpg' width='"+x2+"' height='"+y2+"'></TD><TD><IMG src='gfx/"+poImg+"_04.jpg' width='"+x2+"' height='"+y2+"'></TD></TR>"
	newImgWindowContent += "</TABLE></DIV></BODY></HTML>"
	newImgWindow.document.write(newImgWindowContent)
	newImgWindow.document.close()
}
function showImg2 (poImg,x,y,bgcolor) {
	if (!x) {x = 800}
	if (!y) {y = 600}
	if (!bgcolor) {bgcolor = white}
	var x2 = x / 2
	var y2 = y / 2
	closeNewImgWindow ()
	makeNewImgWindow (x, y)
	var newImgWindowContent = "<HTML><HEAD><TITLE>Zdjêcie</TITLE>"
	newImgWindowContent += "<META http-equiv='Content-Type' content='text/html; charset=iso-8859-2'></HEAD>"
	newImgWindowContent += "<BODY oncontextmenu='event.returnValue=false;' bgcolor='"+bgcolor+"'><DIV align='center'>"
	newImgWindowContent += "<A href='javascript:self.close()'><img src='gfx/spacer.gif' alt='kliknij by zamkn±æ okno' width='"+x+"' height='"+y+"' border='0' style='position:absolute;left:10;top:15;z-index:100'></A>"
	newImgWindowContent += "<IMG src='gfx/"+poImg+".jpg' width='"+x+"' height='"+y+"'>"
	newImgWindowContent += "</DIV></BODY></HTML>"
	newImgWindow.document.write(newImgWindowContent)
	newImgWindow.document.close()
}