//skrypt do dopasowania rozmiaru okienka do zdjęcia
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;


// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = false;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}

var optNN='toolbar=no,location=no,status=no,menubar=no,scrollbars=1,resizable=no,scrolling=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='toolbar=no,location=no,status=no,menubar=no,scrollbars=1,resizable=no,scrolling=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open(imageURL,'',optNN);}
if (isIE){imgWin=window.open(imageURL,'',optIE);}
}
//skrypt do dopasowania rozmiaru okienka do zdjęcia
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.
var optNN1='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,scrolling=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
//var optIE1='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
var optIE1='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,scrolling=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
function popImageN(imageURL,imageTitle,idzdjecia_prev,idzdjecia_next){
if (isNN){imgWin=window.open('about:blank','',optNN1);}
if (isIE){imgWin=window.open('about:blank','',optIE1);}
with (imgWin.document){
writeln('<html><head><meta http-equiv="Content-type" content="text/html; charset=iso-8859-2" /><title>Pobieram...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');

writeln('function reSizeToImage(){');
writeln('if (isIE){');
writeln('PositionX = (opener.screen.width - document.images[0].width)/2;')
writeln('PositionY = (opener.screen.height - document.images[0].height)/2;');
writeln('moveTo(PositionX,PositionY);');
writeln('window.resizeTo(100,100);');
writeln('width=document.images[0].width;');
writeln('height=document.images[0].height+70;');//height+30
writeln('window.resizeTo(width,height);}');

writeln('if (isNN){');
writeln('PositionX = (opener.screen.width - document.images["George"].width)/2;')
writeln('PositionY = (opener.screen.height - document.images["George"].height)/2;');
writeln('moveTo(PositionX,PositionY);');
writeln('window.innerWidth=document.images["George"].width;');
writeln('window.innerHeight=document.images["George"].height+20;window.innerHeight=document.images["George"].height;}}');//height+36


writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor="#ffffff" scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor="#ffffff" scroll="no" onload="reSizeToImage();doTitle();self.focus()"; onclick="self.close();">');
//<!-- onblur="self.close()"-->

writeln('<img name="George" src='+imageURL+' style="display:block">');

close();
}}

function okno(o,w_o,h_o,tytul) { //o - obraz, w_o/h_o - szerokość/wysokość okna, w_p/h_p - szerokość/wysokość obrazka
	left1 = (screen.width - w_o)/2;
	top1 = (screen.height - h_o)/2;
	scrollbars1 = 1;
	w_o += 10;
	h_o += 54;
		
	windowprops = "toolbar=no,location=no,status=no,menubar=no,scrollbars="+scrollbars1+",resizable=no,left="+left1+",top="+top1+",width="+w_o+",height="+h_o+",scrolling=1";
	text = "<html><head><meta http-equiv='imagetoolbar' content='no' /> <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-2'><title>"+tytul+"</title></head><body style='background: #000000; margin:0; text-align:center')><img border='0' src='"+o+"'></body></html>";
	preview = window.open('', 'preview', windowprops);
	
	if (scrollbars1) {
		preview.resizeTo((w_o+28),(h_o));
	}
	else {
		preview.resizeTo(w_o,h_o);
	}
	
	preview.document.open();
	preview.document.write(text);
	preview.document.close();
	preview.focus();
}
