var inss = 0;
var wnd;

// функция открытия окна с какой-либо картинкой
function openImageWindow(src, width, height, title) {
	//title += ' - обложка пластинки';
	if (inss == 1) {wnd.close();}
	title = title.replace('\"', '\\"');
	var corner = getWindowCorner(width, height);
	wnd = window.open("", "imageWindow", 
		"left=" + corner["left"] + ",top=" + corner["top"] + ",width=" + width + ",height=" + height);
	var doc = wnd.document;
	doc.open();
	doc.write('<html><head><title>' + title + '</title></head>' + 
						'<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">' +
						'<img src="' + src + '" width="' + width + '" height="' + height + 
						'" vspace="0" hspace="0" alt="' + title + '">' +
						'<br></body></html>'
						);
	doc.close();
	wnd.focus();
	inss = 1;
	return false;
}

//----------------------------------------
// функция для расчета угла popup окна
function getWindowCorner(width, height) {
	var retVar = new Array();
	retVar["left"] = (screen.width / 2) - (width / 2);
	retVar["top"]	 = (screen.height / 2) - (height / 2);
	return retVar;
}

