var newWindow = null
function makeNewWindow(name,x,y) {
	// check if window already exists
	if (!newWindow || newWindow.closed) {
		// store new window object in global variable
    x=500;
    y=550;
    x=x+20;
	y=y+30;


newWindow = window.open("","","status=0, toolbar=no, location=no, width="+x+",height="+y)
		// assemble content for new window

filename = "../images/picture_gallery/"+name+".jpg";
var newContent = "<HTML><HEAD><TITLE>www.mrazovack9.com</TITLE><link rel='stylesheet' type='text/css' href='../dm.css'></HEAD>"
newContent += "<BODY bgColor='#FFFFFF'>"
newContent +="<div align='center'><img src='"+filename+ "'><a href='javascript:self.close()'><br>Close</a></div>"
newContent += "</BODY></HTML>"
newWindow.document.write(newContent)
newWindow.document.close()
	} else {
	// window already exists, so bring it forward
	newWindow.close()
	makeNewWindow(name,x,y)
	}
}


