﻿// *** JSF Main Routines
// *** (c) feel by fish, http://www.imagen.pl

//display window
var JSFSplashWin = null;

var singleImage = new Image();
singleImage.onload = displaySingleOnload;

function displaySingle(url, text) {

	displayWidth = 300; displayHeight = 100;
	if (window.screen) {screenWidth = window.screen.width; screenHeight = window.screen.height}
	displayPosX = Math.round((screenWidth - displayWidth)/2);
	displayPosY = Math.round((screenHeight - displayHeight)/2);

	singleImage = new Image();
	singleImageText = text;
	singleImage.onload = displaySingleOnload;

	JSFSplashWin = window.open("", "splash", "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=" + displayWidth + ",height=" + displayHeight + ",left=" + displayPosX + ",top=" + displayPosY);
	
	JSFSplashWin.moveTo(displayPosX, displayPosY);
	JSFSplashWin.resizeTo(displayWidth, displayHeight);
	
	JSFSplashWin.document.open();
	JSFSplashWin.document.clear();
	JSFSplashWin.document.write('<html><head><title>Foto</title><link rel="stylesheet" href="defs.css" type="text/css"><style><!-- body{background: #FFFFFF;} --></style></head><body scroll="no" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><script>function closeMe(e){window.close();} /* document.onclick = closeMe; */</script><table  width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" ><tr><td ><p align="center"><a href="javascript:closeMe();"><img src="gfx/px.gif" name="displayImage" border="0" ></a><br><div align="center" class="reg" id="loadInfo">ładowanie zdjęcia..</div></p></td></tr></body></html>');
	JSFSplashWin.document.close();
	JSFSplashWin.focus();
	
	singleImage.src = url;
}

var singleImageText = "";
function displaySingleOnload() {

	displayWidth = singleImage.width + 50; displayHeight = singleImage.height + 120;
	displayPosX = Math.round((screenWidth - displayWidth)/2);
	displayPosY = Math.round((screenHeight - displayHeight)/2);

	JSFSplashWin.moveTo(displayPosX, displayPosY);
	JSFSplashWin.resizeTo(displayWidth, displayHeight);

	JSFSplashWin.document.displayImage.src = singleImage.src;
	if (document.getElementById)
		JSFSplashWin.document.getElementById("loadInfo").innerHTML = singleImageText;
	else
		JSFSplashWin.document.all["loadInfo"].innerText = singleImageText;

	JSFSplashWin.focus();
}