		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=yes, resizable=yes');
	
		}

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: #9DCE0B; font-weight: bold; text-align: left;} img {border: 4px #9DCE0B solid;} body {font-family: Verdana, Arial, sans-serif; scrollbar-face-color:#D9D9D9;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;
	www = "huszlew.pl";
	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 a, .prawa a {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 +'&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 = 580;
	wt = 580;
	lt = (iWidth - wt) / 2;
	tp = (iHeight - ht) / 2;
	okienko = window.open(document,'','height='+ht+',width='+wt+',top='+tp+',left='+lt+',toolbar=yes,scrollbars=yes');
}
