function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth) pageWidth = windowWidth;
	else pageWidth = xScroll;
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
} 

function zrob_flasha(szerokosc, wysokosc, kolor, id, plik){
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + szerokosc + '" height="' + wysokosc + '" id="' + id + '" align="middle">');
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="' + plik + '" />');
document.write('<param name="quality" value="high" />');
if(kolor == ""){
document.write('<param name="wmode" value="transparent" />');
var trans;
trans = 'wmode="transparent"';
}
document.write('<param name="bgcolor" value="' + kolor + '" />');
document.write('<embed src="' + plik + '" quality="high" ' + trans + ' bgcolor="' + kolor + '" width="' + szerokosc + '" height="' + wysokosc + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}

function zrob_flasha_glownego(){
	
	var dane=getPageSize();
	var szerokosc = dane[0]-16;
	var wysokosc = 0;
	var plik = "strona53.swf";
	var id = "strona";

	wysokosc = Math.round(szerokosc/1.862);
	if(wysokosc>dane[1])
	{
	  wysokosc=dane[1]-16;
	  szerokosc=Math.round(wysokosc*1.862);
	}

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + szerokosc + '" height="' + wysokosc + '" id="' + id + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + plik + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#005796" />');
	document.write('<embed src="' + plik + '" quality="high" bgcolor="#005796" width="' + szerokosc + '" height="' + wysokosc + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function zrob_flasha_glownego2(){
	
	var dane=getPageSize();
	var szerokosc = dane[0]-16;
	var wysokosc = 0;
	var plik = "strona58.swf";
	var id = "strona";

	wysokosc = Math.round(szerokosc/1.862);
	if(wysokosc>dane[1])
	{
	  wysokosc=dane[1]-16;
	  szerokosc=Math.round(wysokosc*1.862);
	}

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + szerokosc + '" height="' + wysokosc + '" id="' + id + '" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="' + plik + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#005796" />');
	document.write('<embed src="' + plik + '" quality="high" bgcolor="#005796" width="' + szerokosc + '" height="' + wysokosc + '" name="' + id + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=yes,menubar=no' );
}

function galeria(){
	var dane=getPageSize();
	var szerokosc = dane[0]-50;
	var wysokosc = 0;

	wysokosc = Math.round(szerokosc/1.862);
	if(wysokosc>dane[1])
	{
	  wysokosc=dane[1]-16;
	  szerokosc=Math.round(wysokosc*1.862);
	}
    var Win = window.open('galeria.php',"galeria",'width=' + szerokosc + ',height=' + wysokosc + ',resizable=0,scrollbars=no,menubar=no');
}

function openImg(id){
   var Win = window.open("pokaz.php?id="+id,"openImg",'width=660,height=480,resizable=0,scrollbars=yes,menubar=no');
}

function zmien_obrazek (adres){
   document.getElementById('obrazek').src = adres;
}
