function openWindow(file) {
  catWindow = window.open(file, "catWin", "menubar=0,location=no,status=no,directories=no,toolbar=no,scrollbars=yes,width=500,heigth=450")
 }

 function closeWindow() {
   if (catWindow && !catWindow.closed) {
 catWindow.close() }

 function showFoto(obj) {
   fotoFile = "upload/img/" + obj;
   catWindow = window.open( fotoFile, "fotoWin", "width=500,heigth=450");
 }
}

//--- Открываем окно
var X = 200;  // change the # at the left for a fixed X co-ordinate to accommodate non-compatible browsers
var Y = 200;  // change the # at the left for a fixed Y co-ordinate to accommodate non-compatible browsers
(document.getElementById && !document.all) ? dom = true : dom = false;
if (document.layers || dom) {
document.captureEvents(Event.MOUSECLICK)
function getcoords(e) {
X = parseInt(e.screenX) - 80;  // change the # at the left to further adjust the left-margin depending on the size of the window
Y = parseInt(e.screenY) - 60;  // change the # at the left to further adjust the top-margin depending on the size of the window
return true;}
document.onmouseclick = getcoords;
function open_win(obj) {
if (document.all) {
//X = parseInt(event.screenX) - 80;  // change the # at the left to further adjust the left-margin depending on the size of the window
//Y = parseInt(event.screenY) - 60;  // change the # at the left to further adjust the top-margin depending on the size of the window
X = 100;
Y = 50;
}  
SW=window.open(obj,"NewWin","menubar=0,location=no,status=no,directories=no,toolbar=no,scrollbars=yes,height=500,width=500,resizable=yes");
SW.moveTo(X,Y);
 }
}
