PositionX = 6;
PositionY = 1;

var AutoClose = false;

var opt='scrollbars=no,location=no,width=150,height=100,left='+PositionX+',top='+PositionY;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;
var isNN=(navigator.appName=="Netscape")?1:0;
var isOpera=(navigator.appName=="Opera")?1:0;

function reSizeToImage(imgWin){
                if (isIE) {
            imgWin.resizeTo(100,100);
            x = imgWin.document.body.offsetWidth - imgWin.document.body.clientWidth;
            y = imgWin.document.body.offsetHeight - imgWin.document.body.clientHeight;
            width = 2*x + imgWin.document.images["img_bos_name"].width + 2;
            height = 100-(imgWin.document.body.clientHeight-imgWin.document.images["img_bos_name"].height);
            imgWin.resizeTo(width,height);
        }
        if (isNN) {
            imgWin.innerWidth=imgWin.document.images["img_bos_name"].width;
            imgWin.innerHeight=imgWin.document.images["img_bos_name"].height;
        }
        if (isOpera) {
                    widthDiff = 10;
            heightDiff = 50;
                       width=imgWin.document.images["img_bos_name"].width + widthDiff;
            height=imgWin.document.images["img_bos_name"].height + heightDiff;
                       imgWin.resizeTo(width,height);
        }
}

function doTitle(imgWin,imageTitle){
  imgWin.document.title=imageTitle;
}

function popImage(imageURL,imageTitle){

  imgWin=window.open('about:blank','',opt);

  with (imgWin.document){
         writeln('<html><head><title>Loading...</title><style>body{margin:0;padding:0;}</style>');

         if (!AutoClose)
      writeln('</head><body bgcolor="black" background="http://www.info-servis.cz/img_webadmin/js/pic_loader.gif" style="background-repeat: no-repeat;" scroll="no" onload="self.focus()">');
         else
      writeln('</head><body bgcolor="black" background="http://www.info-servis.cz/img_webadmin/js/pic_loader.gif" style="background-repeat: no-repeat;" scroll="no" onload="self.focus()" onblur="self.close()">');

         writeln('<img onclick="javascript:window.close()" name="img_bos_name" src='+imageURL+' style="display:block; cursor:pointer;"></body></html>');
         close();
  }

        var img = new Image();
        img.onload = function() { reSizeToImage(imgWin);doTitle(imgWin,imageTitle);};//return false;};
        img.src = imageURL;

}
