function ustawTresc(el, wartosc, deftxt) {
	if(wartosc==''){
		if(deftxt==document.getElementById(el).value){
			document.getElementById(el).value='';
		}
	}else{
		if(document.getElementById(el).value==''){
			document.getElementById(el).value=wartosc;
		}
	}
}

function oknoPopup(adr,nazwa,sze,wys) {
	window.open(adr,nazwa,'width='+sze+',height='+wys+',scrollbars=no,resizable=no,status=yes,menubar=no');
}
function oknoPopupPrint(adr,nazwa,sze,wys) {
	window.open(adr,nazwa,'width='+sze+',height='+wys+',scrollbars=auto,resizable=no,status=yes,menubar=no');
}

function archiwum(ilosc, wartosc, pokaz) {
	var tab = new Array();
	for(i=0;i<ilosc;i++) {
		if(document.getElementById("arch"+i).style.display=='none') {
			tab[i]=0;
		}else {
			tab[i]=1;
			ostatni = i;
		}
	}
	
	if (ostatni >= pokaz-1) {
		if ((ostatni != ilosc-1) && (wartosc==1)) {	
			for(i=0;i<ilosc;i++) {
				if(i == ostatni-pokaz+1) {
					document.getElementById("arch"+i).style.display='none';
				}
				if(i == ostatni+1) {
					document.getElementById("arch"+i).style.display='inline';
				}
			}	
		}
		
		if ((ostatni-pokaz+1 != 0) && (wartosc==-1)) {	
			for(i=0;i<ilosc;i++) {
				if(i == ostatni-pokaz) {
					document.getElementById("arch"+i).style.display='inline';
				}
				if(i == ostatni) {
					document.getElementById("arch"+i).style.display='none';
				}
			}	
		}
	}
}

function wiecej(ilosc, wartosc, pokaz) {
	var tab1 = new Array();
	for(j=0;j<ilosc;j++) {
		if(document.getElementById("wf"+j).style.display=='none') {
			tab1[j]=0;
		}else {
			tab1[j]=1;
			ostatni = j;
		}
	}
	
	if (ostatni >= pokaz-1) {
		if ((ostatni != ilosc-1) && (wartosc==1)) {	
			for(j=0;j<ilosc;j++) {
				if(j == ostatni-pokaz+1) {
					document.getElementById("wf"+j).style.display='none';
					document.getElementById("wfhr"+j).style.display='none';
				}
				if(j == ostatni+1) {
					document.getElementById("wf"+j).style.display='block';
					document.getElementById("wfhr"+j).style.display='block';
				}
			}	
		}
		
		if ((ostatni-pokaz+1 != 0) && (wartosc==-1)) {	
			for(j=0;j<ilosc;j++) {
				if(j == ostatni-pokaz) {
					document.getElementById("wf"+j).style.display='block';
					document.getElementById("wfhr"+j).style.display='block';
				}
				if(j == ostatni) {
					document.getElementById("wf"+j).style.display='none';
					document.getElementById("wfhr"+j).style.display='none';
				}
			}	
		}
	}
}

//function $(id) {
//	return document.getElementById(id);
//}
//function set_bck(blok) {
//	$(blok).className='subcat_a';
//}
//function clear_bck(blok) {
//	$(blok).className='subcat_u';
//}
//function expand(blok) {
//	if ($(blok).style.display=="block") {
//		$('img_'+blok).src="images/st_prawo.gif";
//		$(blok).style.display="none";
//	} else {
//		$('img_'+blok).src="images/st_dol.gif";
//		$(blok).style.display="block";
//	}
//}
//function set_cell(blok) {
//	$(blok).className='cell_on';
//}
//function clear_cell(blok,def) {
//	$(blok).className=def;
//}
//function potwierdzenie(pytanie){
//	if (confirm(pytanie)) {
//    	return true;
//  	} else {
//    	return false;
//  	} 
//}
//function potwierdzenie2(pytanie,pytanie2){
//  if (confirm(pytanie)) {
//    if (confirm(pytanie2)) {
//    	return true;
//  		} else {
//    		return false;
//  	 }
//    return true;
//  } else {
//    return false;
//  } 
// return true;
//}
//function check(element) {
//	if ($(element).style.background==""||$(element).style.backgroundColor=="rgb(0, 255, 0)") {
//		$(element).style.background='#FF0000';
//		putcookie(element,'1',7200);
//	} else {
//		$(element).style.background='';
//		putcookie(element,'0',7200);
//	}
//}
//function set_bck2(element) {
//	if ($(element).style.background=="")
//		$(element).style.background='#00FF00';
//}
//function clear_bck2(element) {
//	if ($(element).style.backgroundColor=="rgb(0, 255, 0)")
//		$(element).style.background='';
//}
//function putcookie(c_name,value,expiredays) {
//    var exdate=new Date();
//    exdate.setDate(exdate.getDate()+expiredays);
//    document.cookie = c_name + "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate);
//}
//function getcookie(c_name) {
//    if(document.cookie.length > 0) {
//        var c_start = document.cookie.indexOf(c_name + "=");
//        if(c_start != -1) {
//            c_start = c_start + c_name.length + 1;
//            var c_end = document.cookie.indexOf(";",c_start);
//            if(c_end == -1)
//                c_end = document.cookie.length;
//            return unescape(document.cookie.substring(c_start, c_end));
//        }
//    }
//    return null;
//}
//function spr_form_wyszuk(scom, smia){
//	if (document.getElementById(scom).value=='' && document.getElementById(smia).value==-1){
//		alert('Proszę o wprowadzenie danych do formularza');
//		return false;
//		
//	}
//	return true;
//}
//
//function fotka_big(foto) {
//	window.open('big_photo.php?zdjecie='+foto,'fotka','width=620,height=510,scrollbars=no,resizable=no,status=yes,menubar=no');
//}
// function pokaz_strone()
//  {
//  
//  var dane=$('jakzalatwiclink').value.split("|");
//	 if (dane[1]=='_blank') {
//	 	window.open(dane[0],'nowe_okno'); 
//	 }
//  	else{
//  	
//  	window.location.href=dane[0];
//  	}
//  }
//  
//  
//function przegladarka(photo) 
//{
//window.open('/index.php?type=przegladarka&photo='+photo,'Galeria','width=625,height=570,scrollbars=no,resizable=no,status=no,menubar=no');
//}
//
//function mapa() 
//{
//window.open('/images/main/mapa.gif','mapa','width=608,height=610,scrollbars=no,resizable=no,status=no,menubar=no');
//}
//function drukuj_art(id_art,nazwa) {
//	window.open('/drukuj_art/'+id_art+'/'+nazwa+'.html','art','width=620,height=494,scrollbars=yes,resizable=yes,status=yes,menubar=no');
//}
//
//function drukuj_news(id_news,nazwa) {
//	window.open('/drukuj_news/'+id_news+'/'+nazwa+'.html','news','width=620,height=494,scrollbars=yes,resizable=yes,status=yes,menubar=no');
//}
//function drukuj_wyd(id_wyd,nazwa) {
//	window.open('/drukuj_wyd/'+nazwa+',w'+id_wyd+'.html','wydarzenie','width=620,height=494,scrollbars=yes,resizable=yes,status=yes,menubar=no');
//}
//function newsletter() {
//	window.open('/newsletter.html','newsletter','width=625,height=263,scrollbars=no,resizable=no,status=yes,menubar=no');
//}
//
//function kontakt() {
//	window.open('/kontakt.html','kontakt','width=625,height=500,scrollbars=no,resizable=no,status=yes,menubar=no');
//}
//
//function clear_value(pole,wart) {
//	if ($(pole).value==wart) {
//		$(pole).value="";
//	}
//}
//
//function set_value(pole,wart) {
//	if ($(pole).value=="") {
//		$(pole).value=wart;
//	}
//}
