var newWindow = null
function makeNewWindow(dir, name,x,y) {
	// check if window already exists
	if (!newWindow || newWindow.closed) {
		// store new window object in global variable
    x=x+20;
	y=y+30;


newWindow = window.open("","","width="+x+",height="+y)
		// assemble content for new window

filename = "images/"+dir+"/"+name;
var newContent = "<HTML><HEAD><TITLE>Hét Nap</TITLE></HEAD>"
newContent += "<BODY bgColor='#DADAB6'>"
newContent +="<div align='center'><img src='"+filename+ "'></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)
	}
}

