// *** JSF Splash
// *** (c) feel by fish 
// *** http://www.imagen.pl
// *** 2000.11.23
// *** GNU GPL distribution

// * based on trick by WebFX http://webfx.eae.net/

// -> obsluga podkladu w zewn. okienkach

var JSFSplashWin = null;
// static :)
function JSFSplashShowImage(url, width, height, borderless) {
       ScrWidth = 640; ScrHeight = 480;
       if (window.screen) {ScrWidth = window.screen.width; ScrHeight = window.screen.height}
//       PosX = Math.round((ScrWidth - width)/2);
//       PosY = Math.round((ScrHeight - height)/2);

       PosX = screen.width/2-width/2;
       PosY = 0;

       width = width + 16;
       if (width>screen.width)
       {
         width = screen.width-50;
       }
       if (height>screen.height)
       {
         height = screen.height-50;
       }

       if (JSFSplashWin != null && !document.layers) {JSFSplashWin.close();}
       if (borderless && !document.layers) {
              JSFSplashWin = window.open("", "splash", "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0");
              JSFSplashWin.resizeTo(width, height);
              JSFSplashWin.moveTo(PosX, PosY);
       }
       else
              JSFSplashWin = window.open("", "splash", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);

       JSFSplashWin.document.open();
       JSFSplashWin.document.clear();
       JSFSplashWin.document.write("<html><head><title>Foto</title><style><!-- html {margin:0; padding:0} body {background:white}--></style></head><body scroll='yes'><img src='" + url + "' border=0 /><script>function closeMe(e){window.close();} document.onclick = closeMe;</script></body></html>");
       JSFSplashWin.document.close();
       JSFSplashWin.focus();       
}

function JSFSplashShow(url, width, height, borderless) {
       ScrWidth = 640; ScrHeight = 480;
       if (window.screen) {ScrWidth = window.screen.width; ScrHeight = window.screen.height}
//       PosX = Math.round((ScrWidth - width)/2);
//       PosY = Math.round((ScrHeight - height)/2);

       PosX = 50;
       PosY = 50;

       if (JSFSplashWin != null && !document.layers) {JSFSplashWin.close();}
       if (borderless && !document.layers) {
              JSFSplashWin = window.open(url, "splash", "fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0");
              JSFSplashWin.resizeTo(width, height);
              JSFSplashWin.moveTo(PosX, PosY);
       }
       else
       JSFSplashWin = window.open(url, "splash", "fullscreen=1;menubar=0,toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=no");
       JSFSplashWin.focus();       
}


