

var win_popups = new Array();

function window_open(adres, nazwa, par) {
	if(nazwa in win_popups && !win_popups[nazwa].closed) {
		win_popups[nazwa].location.href=adres;
		win_popups[nazwa].focus();
	} else {
		var win=window.open(adres, nazwa, par);
		win_popups[nazwa] = new Object(win);
	}
}


function load_data_ifarea(id) {
	document.getElementById(id+'_area').contentWindow.document.body.innerHTML=document.getElementById(id).value;
}


function delete_tresc(id) {
	if(confirm("Czy napewno usunąć ?")) {
		document.location.href="index.php?d="+id;
	}
}

function odczyt(id_form, id_to) {
	//alert('xxx');
	document.getElementById(id_to).value=opener.document.getElementById(id_from).value
}

function forum_validate() {
	var msg = new String();
	document.getElementById('wyslij').disabled=true;
	var watek=document.forms['watek'];
	
	
	if(watek['temat'].value.replace(/\s/, '')=='') {
		msg+="Wpisz temat !\n";
	}
	if(watek['tresc'].value.replace(/\s/, '')=='') {
		msg+="Wpisz treść !\n";
	}
		
	if(watek['podpis'].value.replace(/\s/, '')=='') {
		msg+="Daj jakiś podpis ( imie, nick ) !\n";
	}
	
	if(msg!='') {
		alert(msg);
		document.getElementById('wyslij').disabled=false;
		return false;
	} else {
		return true;
	}
}


