    function showphoto(photoURL,width,height,caption)
   {
     windowid = photoURL.slice(0,photoURL.length-4);
     windowid = windowid.replace(/[ -\/]/g,"_");
     var remote = open("",windowid,'width='+width+',height='+height+',screenX=10,screenY=10,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=no');
     if (remote.opener == null)
     remote.opener = window;
     remote.document.write('<html><head><title>'+caption+'</title><link rel="stylesheet" href="/style.css" type="text/css"></head>\n');
     remote.document.write('<div align="center"><a href="" onclick="window.close()"><div style="color: #FFFFFF; background-color: #1C71B4; border: 2px solid #ADB638; padding: 2px; width: 100%; font-size: 13px; cursor: hand;">&nbsp;закрыть&nbsp;</div></a></div>');
     remote.document.write('<script> function resize() { document.getElementById("load").style.display = "none"; new_width = document.getElementById("pic_'+windowid+'").width + 30;  new_height = document.getElementById("pic_'+windowid+'").height + 150;  window.resizeTo(new_width,  new_height);}</script>\n');
     remote.document.write('<div align="center" id="load">Loading...\nЗагрузка Изображения</div>\n');
     remote.document.write('<body onLoad="resize()" bgcolor="#FFFFFF" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0>\n');
     remote.document.write('<br><div align="center"><img id="pic_'+windowid+'" src="'+photoURL+'" alt="'+caption+'" becho="1"></div>\n');
     remote.document.write('<div align="center">'+caption+'</div><img src="/images/1x1.gif" width="1" height="5" alt="" border="0"><br>\n');
     remote.document.write('<br></body></html>\n');
     remote.document.close();
     remote.focus();
     return remote;
   }