function OpenImagePopup(imgPath, title, alt) {
    var win = window.open('','preview',
    'width=300,height=10,left=50,top=50,screenX=0,screenY=0,resizable=0,scrollbar=0,status=0');
    
    var winDoc = win.document;
    if (title == undefined) title = 'My Image, Click to Close';
    if (alt   == undefined) alt   = 'My Image, Click to Close';
    var content = '<html><head><title>' + title + '</title>' +
    			  '<style>body{overflow: hidden;margin:0;}.imgs{border:3px double #99ccff;} A:visited {color: #0066cc;	FONT-WEIGHT: normal; text-decoration: none;} A:link {color: #0066cc;	FONT-WEIGHT: normal; text-decoration: none;} A:hover {color: #0066cc;	FONT-WEIGHT: normal; text-decoration: underline;}</style>' +
    			  '</head><body background="img/whitefon.jpg"><center><img src="img/art_.gif" border="0" alt=""></center></br><div align="center"><a href="javascript:self.close()">' +
    			  '<img alt="' + alt + '" id="image" class="imgs" src="' + imgPath + '" /> </a></div><div align="center"><table cellpadding="2" cellpading="0" width="100"><tr align="center"><td style="border : 1px solid #0066cc; font-size: 14px; color:#0066cc;"><a href="javascript:self.close()">Закрыть</a></td></tr></table></div></body></html>'
    win.document.write(content);
    
    winDoc.body.onload = function() {
    	var obj = winDoc.getElementById('image');
    	var w = obj.width, h = obj.height;
    	var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
    	
    	var left = (self.opera ? iWidth : screen.availWidth)/2.5 - w/2.5;
    	var top =  (self.opera ? iHeight : screen.availHeight)/5 - h/5;
    	win.resizeTo(w=660, h=620);
    	win.moveTo(left, top);
    }
    
    win.onload = winDoc.body.onload; // special for Mozilla
    
    // !!! Very important statement: popup onload won't execute without it!
    win.document.close();
    win.focus();
}   