		Nowe=null;
function Otworz(w,s,file)
{
        iWidth = screen.width;
	     iHeight = screen.height;
        lt = (iWidth - s) / 2;
	     tp = (iHeight - w) / 2;
	
        if (Nowe!=null)
	{
		Nowe.close();
		Nowe=null;
	}
	
Nowe=window.open("","","toolbar=no, top="+tp+",left="+lt+", menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no,height="+w+",width="+s);
Nowe.document.write("<HTML><HEAD></HEAD><BODY style='margin: 0; padding: 5px;'><a href='javascript:window.close()' title='Zamknij okno'><img border='0' src="+file+" ></a><br></BODY></HTML>");
Nowe.focus();
}

function zyczenia()
  {
  new_window = window.open('zyczenia.html','','width=305,height=305,left=100,top=50,resizable=yes,scrollbars=auto,toolbar=no');
  }
function okno(document)
		{
	iWidth = screen.width;
	iHeight = screen.height;
	ht = 480;
	wt = 400;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
n_window = window.open(document,'','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,scrollbars=auto, resizable=yes');
	
		}
function foto_ofer(plik)
		{
	iWidth = screen.width;
	iHeight = screen.height;
	ht = 620;
	wt = 640;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	n_window = window.open(document,'','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,scrollbars=auto, resizable=yes');
	n_window.document.write('<html><head>');
	n_window.document.write('<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2"><style type="text/css"><!--.text {font-size: 8pt;color: #DADADA;text-align: left; margin-left: 12px;} .tytul {font-size: 10pt; color: #FFCC99; font-weight: bold; text-align: left;} img {border: 4px #FFCC99 solid;} body {font-family: Verdana, Arial, sans-serif; scrollbar-face-color:#FFCC99;scrollbar-shadow-color:#000000;scrollbar-highlight-color:#000000;scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color:#000000; scrollbar-track-color:#000000;scrollbar-arrow-color:#000000}A{TEXT-DECORATION: none}A:hover { color: "#ff0000"}--></style></head><body bgcolor="#000000" text="#DADADA">');
   n_window.document.write('<table border=0 width=100% height=100%><tr><td valign=middle align=center><table border=0 bordercolor=#000000 cellpadding=\"3\"><tr bgcolor="#000"><td><div align=center>');
	n_window.document.write('<a href="javascript:window.close()"><img src="' + plik + '" title="Zamknij okno"><a>');
        n_window.document.write('</div></td></tr><tr>');	
	n_window.document.write('</table></td></tr></table>');
	n_window.document.write('</body></html>');
	
		}

function duzy(plik,kategoria, tytul,autor,opis){
         iWidth = screen.width;
	iHeight = screen.height;
	ht = 620;
	wt = 640;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	okno=window.open('','','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=no,scrollbars=no');
	txt = '<title>' + tytul + '</title>';
	okno.document.write('<html><head>');
	okno.document.write(txt);
	okno.document.write('<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2"><style type="text/css"><!--.text {font-size: 8pt;color: #DADADA;text-align: left; margin-left: 12px;} .tytul {font-size: 10pt; color: #FFCC99; font-weight: bold; text-align: left;} img {border: 4px #FFCC99 solid;} body {font-family: Verdana, Arial, sans-serif; scrollbar-face-color:#FFCC99;scrollbar-shadow-color:#000000;scrollbar-highlight-color:#000000;scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color:#000000; scrollbar-track-color:#000000;scrollbar-arrow-color:#000000}A{TEXT-DECORATION: none}A:hover { color: "#ff0000"}--></style></head><body bgcolor="#000000" text="#DADADA">');
        okno.document.write('<table border=0 width=100% height=100%><tr><td valign=middle align=center><table border=0 bordercolor=#000000 cellpadding=\"3\"><tr bgcolor="#000"><td><div align=center>');
	okno.document.write('<a href="javascript:window.close()"><img src="' + plik + '" title="Zamknij okno"><a>');
	okno.document.write('<tr><td class="tytul">GALERIA&nbsp;->&nbsp;'+ kategoria+'</td></tr>');
        okno.document.write('</div></td></tr><tr><td class="text" align=center>Tytuł:&nbsp;'+tytul + ',<br />Opis:&nbsp;'+ opis +'<br />Autor foto:&nbsp;'+ autor +'</td></tr>');	
	okno.document.write('</table></td></tr></table>');
	okno.document.write('</body></html>');
}

/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/

function textCounter(field,counter,maxlimit,linecounter) {
	// text width//
	var fieldWidth =  parseInt(field.offsetWidth);
	var charcnt = field.value.length;

	// trim the extra text
	if (charcnt > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	}

	else {
	// progress bar percentage
	var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
	document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
	document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
	// color correction on style from CCFFF -> CC0000
	setcolor(document.getElementById(counter),percentage,"background-color");
	}
}

function setcolor(obj,percentage,prop){
	obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
	
function pokaz(id)
{
document.getElementById(id).style.display='block';
}
function ukryj(id)
{
document.getElementById(id).style.display='none';
}


function drukuj(){
   iWidth = screen.width;
	iHeight = screen.height;
	ht = 520;
	wt = 580;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	okno = window.open('','','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=yes,scrollbars=yes');
	txt = document.getElementById("zawartosc2").innerHTML;
	dzisiaj = new Date();
	if (navigator.appName=="Netscape"){
		czas = dzisiaj.getDate() + '-' + (dzisiaj.getMonth()+ 1) + '-' + (dzisiaj.getYear()+1900) +'r.'; 
	 
	}
	else {
		czas = dzisiaj.getDate() + '-' + (dzisiaj.getMonth()+ 1) + '-' + dzisiaj.getYear() +'r.';
	}

	okno.document.write('<html><head>');
	okno.document.write('<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-2"><link rel="stylesheet" href="szablon/drukuj.css" type="text/css"><style type="text/css"><!-- body {background :#fff; font-family: Verdana, Arial, sans-serif; } #Menu_s {visibility: hidden;}.prawa_druk {visibility: hidden;} #zawartosc2 {font-size : 9pt;} --></style></head><body>');
	okno.document.write('<div id="zawartosc2" class="tresc_glowna">'+ txt);
	okno.document.write('<div><br /><br /><h4>Wydruk pochodzi z serwisu: www.powiatradzynski.pl&nbsp;<br />wydrukowano:&nbsp;'+ czas +'</h4></div>');
	okno.document.write('<p style="color: White; width: 50%; margin: auto; text-align: center; background-color : Gray;"><a style="color: White;" href="javascript:print();">drukuj</a></p>');
	okno.document.write('</div></body></html>');
	okno.focus();
	
}
function galeria(document){
   iWidth = screen.width;
	iHeight = screen.height;
	ht = 600;
	wt = 560;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	okienko = window.open(document,'','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=yes,scrollbars=yes');
}
//----------------------------------------- funkcje do pozycjonowania

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;

	return curtop;
}

function info_ukryj(id){ 								
	var  info= document.getElementById(id);								
	if (info){										
	info.className='zwin';
	}
     }
							
							
function info_pokaz(id){								
         var  info= document.getElementById(id);
         if (info){
            info.className='podpowiedz';
            }
      }	
function help_p(obj,lyr)
{
	var newX = findPosX(obj);
	var newY = findPosY(obj);
	
	var x = document.getElementById(lyr);
	x.style.top = (newY+20) + 'px';       //o obiektu (obrazka)20 pixeli  w dół i
	x.style.left = (newX-200) + 'px';      //30 pikesli w prawo
	x.className='podpowiedz';
	
}				

// funkcja wyświetla i ukrywa zawartość w span'nie
function rozwin(obj)
{
var i;
i=obj;
//document.write (i);

	if (document.all(obj).style.display == "")
	{
		document.all(obj).style.display = "none";
	} else {
		document.all(obj).style.display = "";
 	}
}
	
function PrntAll(){
 var i,strefa=document.getElementById('zawartosc2'),
  W=strefa.getElementsByTagName('div')
 for(i=0;i<W.length;i++)
  W[i].className='tresc_glowna'
 window.print()
}

// obrazek z podpisem title

function obrazek(w,h,plik,tytul){
iWidth = screen.width;
iHeight = screen.height;
lt = (iWidth - w) / 2;
tp = (iHeight - h) / 2;	
if (Nowe!=null)
	{
		Nowe.close();
		Nowe=null;
	}	
Nowe=window.open("","","toolbar=no, top="+tp+",left="+lt+", menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no,height="+h+",width="+w);
Nowe.document.write("<html><head></head><body style='background-color: #fff; margin: 0; padding: 5px'><a href='javascript:window.close()' title='zamknij okno'><img border='0' src="+plik+" ></a><br><p style=\"color: #6f6f6f; font-size: 11px\">"+tytul +"</p></body></html>");
Nowe.focus();
}
