
 function otworz_okno(url, szer, wys)
 {
 	var nowe_okno = null;
 	nowe_okno = window.open("", "", "toolbar=no, width="+szer+", height="+wys+", directories=no, status=no, scrollbars=no, resize=no, menubar=no, location=no");
 	nowe_okno.location.href = url;
 }

 function otworz_okno_scroll(url, szer, wys)
 {
 	var nowe_okno = null;
 	nowe_okno = window.open("", "", "toolbar=no, width="+szer+", height="+wys+", directories=no, status=no, scrollbars=yes, resize=no, menubar=no, location=no");
 	nowe_okno.location.href = url;
 }

 function otworz_okno_popup(url, szer, wys)
 {
 	var nowe_okno = null;
 	nowe_okno = window.open("", "", "toolbar=no, width="+szer+", height="+wys+", directories=no, status=no, scrollbars=yes, resize=no, menubar=no, location=no");
 	nowe_okno.location.href = url;
 }


function usun(u)
{
	fno=confirm(u);

	if(fno) {
		return true
	}
	else {
		return false
	}
}

function ukrywaj(nazwa_id)
{
	if(document.getElementById(nazwa_id).style.display == 'none') {
		document.getElementById(nazwa_id).style.display = 'block';
	}
	else {
		document.getElementById(nazwa_id).style.display = 'none';
	}
}

function ukrywajOdkryj(nazwa_id, akcja)
{
	if (akcja == 'odkryj') {
		document.getElementById(nazwa_id).style.display = 'block';
	}
	else if (akcja == 'ukryj') {
		document.getElementById(nazwa_id).style.display = 'none';
	}
}

function formularz_forum (nowy)
{
    if (window.document.dodaj_post.temat_postu.value == "" && nowy == "tak") {
        alert( "Musisz wpisać temat..." );
        window.document.dodaj_post.temat_postu.focus();
        return false ;
    }
    else if (window.document.dodaj_post.autor_postu.value == "") {
        alert( "Musisz się podpisać..." );
        window.document.dodaj_post.autor_postu.focus();
        return false ;
    }
    else if (window.document.dodaj_post.tresc_postu.value == "") {
        alert( "Zapomniałeś o treści postu..." );
        window.document.dodaj_post.tresc_postu.focus();
        return false ;
    }
	return true ;
}

function textareaRozmiar(nazwaTextarea, minimumWierszy) 
{
	var kolumny = document.getElementById(nazwaTextarea).getAttribute('cols');
	var wiersze = document.getElementById(nazwaTextarea).getAttribute('rows');
	var text = document.getElementById(nazwaTextarea).value;
	var dlugoscTextu = text.length;
	var widacZnakow = kolumny * wiersze;
	var tyleWierszy = Math.round(dlugoscTextu / kolumny + 3);

	if (tyleWierszy > minimumWierszy) {
		document.getElementById(nazwaTextarea).rows = tyleWierszy;
	}
}
  
function menuBackg(divId, kier) {
	var divEl = document.getElementById(divId);
		
	if (kier == 'top') {
		divEl.style.backgroundPosition = "top";
		return;
	}
	else if  (kier == 'bot') {
		divEl.style.backgroundPosition = "bottom";
		return;
	}
}
  
