<!--

function newImageWindow(href, target, w,h, scroll) {

	if (!scroll) {

		scroll = 'no';

	}

	//var top = (document.body.clientHeight - height) / 2;
	//var left = (document.body.clientWidth - width) / 2;
	//top = Math.round(top);

	top1 = 0;
	left1 = 0;
	width = 400;
	height = 400;

	content = '<title>Просмотр</title><body style="margin: 0; padding: 0"><img src="' + href + '" border="0" alt="Закрыть" title="Закрыть" style="cursor: pointer" onclick="window.close()" onload="opener.resizeWindow()"><br>';
	win =  window.open('about:blank', target, 'toolbar=no, width=' + (width - 19) + ', height=' + (height - 2) + ', top=' + top1 + ', left=' + left1 + ', scrollbars=' + scroll + ', status=yes, resizable=yes');
	win.document.open();
	win.document.write(content);

}



function resizeWindow() {

	var image = win.document.body.getElementsByTagName('img')[0];
	var width = image.width;
	var height = image.height;

	win.resizeTo(Number(width) + 8, Number(height) + 61);
	win.moveTo(((document.body.clientHeight - height) / 2), (document.body.clientWidth - width) / 2);

}

//-->