
 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 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 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 + 1);

	if (tyleWierszy > minimumWierszy)
	{
		document.getElementById(nazwaTextarea).rows = tyleWierszy;
	}
}
