﻿function otworzOkno1 (tytul, src, szer, wys) {
		szer_ok = szer+35; wys_ok = wys+25; tlo = 'FFFFFF';	ciemny = 'D5D5E5';	jasny = 'ffffff'; topmargin = 5;
		
		if (wys_ok > screen.availWidth) wys_ok = screen.availWidth;
		if (szer_ok > screen.availHeight) szer_ok = screen.availHeight;

		lok_hor=((screen.availWidth/2)-(szer_ok/2));
		lok_ver=((screen.availHeight/2)-(wys_ok/2));
		//lok_ver = ((768 - wys_ok)/2)-30;
		//lok_hor = (1024 - szer_ok)/2;

		var okienko = window.open("", "", "toolbar=no, scrollbars=yes, menubar=no, top=" + lok_ver + ", left=" + lok_hor + ", width=" + szer_ok + ", height=" + wys_ok);
		okienko.document.write("<HTML>\n<HEAD>\n<TITLE>" + tytul + "</TITLE>\n</HEAD>\n<BODY BGCOLOR=" + tlo + " MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=" + topmargin + " LEFTMARGIN=0 STYLE=\"BACKGROUND: URL(img/tlo_kominy_multiply.gif); SCROLLBAR-FACE-COLOR: #" + ciemny + "; SCROLLBAR-HIGHLIGHT-COLOR: #" + jasny + "; SCROLLBAR-SHADOW-COLOR: #" + jasny + "; SCROLLBAR-DARKSHADOW-COLOR: #" + ciemny + "; SCROLLBAR-3DLIGHT-COLOR: #" + ciemny + "; SCROLLBAR-ARROW-COLOR: #" + jasny + "; SCROLLBAR-TRACK-COLOR: #" + ciemny + ";\"><CENTER><TABLE STYLE=\"border: solid; border-width=4; border-color:DDDDDD\" BORDER=0 WIDTH=" + szer + " HEIGHT=" + wys + "><TR><TD HEIGHT=100% ALIGN=center><IMG SRC=" + src + " VALIGN=middle></TD></TR></TABLE></BODY></HTML>");
}

function otworzOkno (url, width, height) {
		lok_hor=((screen.availWidth/2)-(width/2));
		lok_ver=((screen.availHeight/2)-(height/2));
		if (navigator.appName == 'Microsoft Internet Explorer') {
			width = width+20;
			height = height+25;
		}
        var Win = window.open(url,"OknoSimple",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=1,menubar=no,top='+lok_ver+',left='+lok_hor+',location=no');
		}

function otworzOkno_scroll () {
        var Win = window.open('admin/admin_news/index.php','displayWindow','width=800,height=600,resizable=0,scrollbars=yes,menubar=no');
		}


<!-- Begin SKRYPT DO FLOATING LAYER
window.onerror = null;
var topMargin = 150;
var slideTime = 2400;
var ns6 = (!document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
function layerObject(id,left) {
if (ns6) {
this.obj = document.getElementById(id).style;
this.obj.left = left;
return this.obj;
}
else if(ie4) {
this.obj = document.all[id].style;
this.obj.left = left;
return this.obj;
}
else if(ns4) {
this.obj = document.layers[id];
this.obj.left = left;
return this.obj;
   }
}
function layerSetup() {
floatLyr = new layerObject('floatLayer', pageWidth * .35);
window.setInterval("main()", 10)
}
function floatObject() {
if (ns4 || ns6) {
findHt = window.innerHeight;
} else if(ie4) {
findHt = document.body.clientHeight;
   }
} 
function main() {
if (ns4) {
this.currentY = document.layers["floatLayer"].top;
this.scrollTop = window.pageYOffset;
mainTrigger();
}
else if(ns6) {
this.currentY = parseInt(document.getElementById('floatLayer').style.top);
this.scrollTop = scrollY;
mainTrigger();
} else if(ie4) {
this.currentY = floatLayer.style.pixelTop;
this.scrollTop = document.body.scrollTop;
mainTrigger();
   }
}
function mainTrigger() {
var newTargetY = this.scrollTop + this.topMargin;
if ( this.currentY != newTargetY ) {
if ( newTargetY != this.targetY ) {
this.targetY = newTargetY;
floatStart();
}
animator();
   }
}
function floatStart() {
var now = new Date();
this.A = this.targetY - this.currentY;
this.B = Math.PI / ( 2 * this.slideTime );
this.C = now.getTime();
if (Math.abs(this.A) > this.findHt) {
this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
this.A = this.A > 0 ? this.findHt : -this.findHt;
}
else {
this.D = this.currentY;
   }
}
function animator() {
var now = new Date();
var newY = this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
newY = Math.round(newY);
if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) {
if ( ie4 )document.all.floatLayer.style.pixelTop = newY;
if ( ns4 )document.layers["floatLayer"].top = newY;
if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px";
   }
}
function start() {
if(ns6||ns4) {
pageWidth = innerWidth;
pageHeight = innerHeight;
layerSetup();
floatObject();
}
else if(ie4) {
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
layerSetup();
floatObject();
   }
}

// ukrywanie warstw
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function ukryjWarstwe(nazwa) {
	var x = new getObj(nazwa);
	x.style.display = 'none';
}

function ukryjWszystkieWarstwy() {
	ile_warstw = tablica_warstw.length;
	for (i=0; i<ile_warstw; i++) {
		var x = new getObj(tablica_warstw[i]);
		x.style.display = 'none';
	}
}

function pokazWarstwe(nazwa) {
	var x = new getObj(nazwa);
	x.style.display = 'block';
}

function pokaz1Warstwe(nazwa) {
	ukryjWszystkieWarstwy();
	pokazWarstwe(nazwa);
}

// obsadzanie flasha
function obsadzFlasha(nazwa_pliku, szer, wys, kolor) {
	if (kolor == '') kolor = '#ffffff';
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id="flash" width="'+szer+'" height="'+wys+'">');
  	document.write('<param name="movie" value="'+nazwa_pliku+'">');
	document.write('<param name="bgcolor" value="' + kolor + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="allowscriptaccess" value="always">');
  	document.write('<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+szer+'" height="'+wys+'" name="flash" src="'+nazwa_pliku+'" bgcolor="' + kolor + '" quality="high" swLiveConnect="true" allowScriptAccess="always"></embed>');
	document.write('</object>');
}

function obsadzFlashaLewo(nazwa_pliku, szer, wys, kolor) {
	if (kolor == '') kolor = '#ffffff';
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" id="flash" width="'+szer+'" height="'+wys+'">');
  	document.write('<param name="movie" value="'+nazwa_pliku+'">');
	document.write('<param name="bgcolor" value="' + kolor + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="allowscriptaccess" value="samedomain">');
  	document.write('<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="'+szer+'" height="'+wys+'" name="flash" src="'+nazwa_pliku+'" bgcolor="' + kolor + '" quality="high" swLiveConnect="true" allowScriptAccess="samedomain" align="left"></embed>');
	document.write('</object>');
}
//  End -->