function okienko(url,width,height,sb){ 
	 window.open(url,'okienko','align=center,toolbar=0,status=1,location=0,directories=0,resizable=yes,scrollbars='+sb+',width='+width+',height='+height+',menubar=no')
} 

function showPic (p) {
	window.open('pic.php?pic='+p,'pic','align=center,toolbar=0,status=0,location=0,directories=0,resizable=no,scrollbars=no,width=420,height=300,menubar=no')
}

function sprFormKontakt() {
	with(document.kontakt) {
		if(
			!temat.value
			|| !tresc.value
			|| !od.value
			|| !mail.value
		) 
			alert('Musisz wypełnić wszystkie pola.')
		else 
			submit()
	}
}

function addComment (par) {
	window.open('forumPopUp.php'+par,'forum','align=center,toolbar=0,status=1,location=0,directories=0,resizable=yes,scrollbars=yes,width=420,height=320,menubar=no')
}

function logowanie () {
	var cookieAll = document.cookie.split("; ");
	var notLogin = true;
	for (var i=0; i < cookieAll.length; i++) {
		var cookieVal = cookieAll[i].split("=");
		if (cookieVal[0] == "ISTLogin") {
			document.write('<a class=mp>user: '+unescape(cookieVal[1])+'&nbsp;</a><a class=mp href="logout.php">&nbsp;-&nbsp;<u>Wyloguj się</u></a>');
			notLogin = false;
		}
	}
	if (notLogin) { 
		document.write('<a href="login.php" class=mp>Zaloguj się</a>');
	}
}