var imageWindow; 
function ImgWin(src,width,height,print){ // открыть окно с изображением 
	var scroll='no';
	var w=20;
	var h=0;

	if( height>600 ) { w = w+width; h=600; scroll='yes'; }
	else { w=width; h=height; scroll='no'; }
	if(print) h=h+20;
	imageWindow=window.open("","blankImageWindow", 'status=no,scrollbars=no,resizable=0,width=0,height=0'); 
	imageWindow.close(); 
	imageWindow=window.open("","blankImageWindow", 'status=no,scrollbars='+scroll+',resizable=0,width='+w+',height='+h+''); 
	imageWindow.document.write("<html><head><title>Элеватормельмаш</title>"); 
	imageWindow.document.write("<body topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=white text=black link=black alink=black vlink=black>"); 
	imageWindow.document.write("<center>"); 
	imageWindow.document.write("<table border=0 cellspacing=0 cellpadding=0 bgcolor=#AAAAAA>"); 
	imageWindow.document.write("<tr><td align=center bgcolor=white>"); 
	imageWindow.document.write("<a href='javascript:self.close();' title='закрыть окно'><img src='"+src+"' width="+width+" height="+height+" border=0></a>"); 
	if(print) imageWindow.document.write("</td></tr><tr><td align='center'><a href='javascript:self.print();'>Распечатать</a></td></tr>"); 
	else imageWindow.document.write("</td></tr>"); 
	imageWindow.document.write("</table>"); 
	imageWindow.document.write("</body></html>"); 
	imageWindow.document.close(); 
	imageWindow.focus(); 
} 


// ---  открыть окно с изображением
	var wrImageWindow;
	function rOpenImageWindow(src,width,height){ 
		wWidth = (width)?width+4:470;
		wHeight = (height)?height+4:470;
		wrImageWindow=window.open("","blankImageWindow", 'status=no,scrollbars=no,resizable=yes,width='+(wWidth)+',height='+(wHeight)+'');
			wrImageWindow.document.write("<html><head><title>Изображение</title>");			
			wrImageWindow.document.write("<style>.visible{display:block;} .hide{display:none;} div,a{font:10px verdana,tahoma,sans-serif;text-decoration:none;}</style>");


			wrImageWindow.document.write("<script>function printshow(over){document.getElementById('menu').setAttribute(classFix,(over)?'visible':'hide');}</script>");


			wrImageWindow.document.write("<body class=popupWnd topmargin=0 marginheight=0 leftmargin=0 marginwidth=0 bgcolor=white text=black link=black alink=black vlink=black>");

			wrImageWindow.document.write("<script>var classFix = (document.body && document.body.getAttribute('className'))?'className':'class';</script>");

			wrImageWindow.document.write("<table border=0 cellspacing=0 cellpadding=0 width=100% height=100%><tr><td align=center onmouseover='printshow(true);' onmouseout='printshow(false);'>");
			wrImageWindow.document.write("<table border=0 cellspacing=1 cellpadding=1 bgcolor=#333333><tr><td bgcolor=white>");
			wrImageWindow.document.write("<div id='menu' class='hide' style='position:absolute;z-index:1;background:white;top:2px;left:2px;padding:5px;border:#333333 1px solid;'>");
				wrImageWindow.document.write("[<a href='javascript:;' onclick='printshow(false);self.print();' title='распечатать'>распечатать</a>] &nbsp;");
				wrImageWindow.document.write("[<a href='javascript:;' onclick='self.close();' title='закрыть окно'>закрыть</a>]");
			wrImageWindow.document.write("</div>");
			wrImageWindow.document.write("<img src='"+src+"' width='"+width+"' height='"+height+"' border=0>");
			wrImageWindow.document.write("</td></tr></table>");
			wrImageWindow.document.write("</td></tr></table>");
			wrImageWindow.document.write("</body></html>");
			wrImageWindow.document.close();
		wrImageWindow.resizeTo(wWidth+30,wHeight+40);
		wrImageWindow.focus();
	}
