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;
	}
}
