function ImgShwMs(ID, width, height, alt)
{
	var scroll = "no";
	var top=0, left=0;
	if(width > screen.width-10 || height > screen.height-28) scroll = "yes";
	if(height < screen.height-28) top = Math.floor((screen.height - height)/2-14);
	if(width < screen.width-10) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
height = height + 35;
	var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write(
		"<html><head>"+
		"<"+"script type=\"text/javascript\">"+
		"function KeyPress()"+
		"{"+
		"	if(window.event.keyCode == 27) "+
		"		window.close();"+
		"}"+
		"</"+"script>"+
		"<title>"+(alt == ""? "Картинка":alt)+"</title>" +
"<style type=\"text/css\">\n"+
     "body{\n"+
          "background:#287465;\n"+
          "text-align:center;\n"+
"font: 12px Tahoma;\n"+
     "}\n"+
     "img{\n"+
          "display:block;\n"+
          "margin:0 auto;\n"+
     "}\n"+
     "a{\n"+
          "color:#fff;\n"+
          "padding-left:20px;\n"+
          "background: url(/img/print.gif) 0 6px no-repeat;\n"+
     "}\n"+
"</style>\n"+
"</head>"+
		"<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">"+
		"<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\" />"+
"<a href=\"javascript:print();\" />распечатать</a>" +
		"</body></html>"
	);
	wnd.document.close();
}