//########################################################################
//***************************************
function outa(element)
{
		element.style.backgroundImage='';
}
//***************************************
function sprawdz_email(adres) {

	var re = new RegExp("[^@]{1,}[@]{1}[^@.]{1,}[.]{1}[^@]{1,}","gi")
	var wynik = re.test(adres)

	if (wynik == false) 
		{
			window.alert("Nieprawidłowy adres e-mail.")
			return false
		}
	else return true
}


//***************************************
function sprform(form) {
var waga=true;

if(form.login.value=="" || form.email.value=="" || form.haslo.value=="" || form.haslo1.value=="")
		{
		alert("Dane oznaczone * są obowiązkowe.")
		waga=false;
		}
else if (form.haslo.value != form.haslo1.value)
	{
		alert("Błędnie potwierdzone hasło.")
		waga=false;
	}
else if(form.zgoda.checked=="") 	
	{	
		alert("Zgoda na przetwarzanie danych osobowych jest konieczna.");			
		waga=false;		
	}

else waga=sprawdz_email(form.email.value);

return waga;
}

//***************************************
function sprform1(form) {
var waga=true;

if(form.tytul.value=="" || form.tresc.value=="")
		{
		alert("Podaj tytuł i treść swojej wiadomości.")
		waga=false;
		}

return waga;
}




//***************************************
function sprform2(form) {
var waga=true;
if(form.haslostare.value=="" || form.haslonowe.value=="" || form.haslonowe1.value=="")
	{
		alert("Wypełnij pola formularza.")
		waga=false;
	}

else if (form.haslonowe.value != form.haslonowe1.value)
	{
		alert("Błędnie potwierdzone hasło.")
		waga=false;
	}
return waga;
}

//***************************************
function sprformadmin1(form) {
var waga=true;

if(form.tytul.value=="")
		{
		alert("Podaj tytuł forum.")
		waga=false;
		}
return waga;
}

//***************************************
function sprformadmin2(form) {
var waga=true;

if(form.tytul.value=="" || form.opis.value=="" || form.id_forum.selectedIndex==0)
		{
		alert("Podaj tytuł, opis tematu i wybierz forum do którego będzie przypisany temat.")
		waga=false;
		}
return waga;
}


//*************************************
function selecturl(s) {
var gourl = s.options[s.selectedIndex].value;window.top.location.href = gourl;
}


//*********************************************************************
/*function pop_up(link){
reWin=window.open(link,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=300,top=100,left=100')
}*/
function pop_up(link){
reWin=window.open(link,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=790,height=600,top=50,left=100')
reWin.focus();
}

function epop_up(link){
reWin=window.open(link,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=790,height=600,top=50,left=100')
reWin.focus();
}

//*********************************************************************
function dopisz(form, parametr_p, parametr_k){


	form.tresc.value=form.tresc.value+parametr_p+parametr_k; 
}


//*********************************************************************
function taglink(){
	var a="<INPUT TYPE=\"button\" VALUE=\"LINK\" OnClick=\"wstaw_znacznik(this.form.tresc, '[LINK]', '[/LINK]')\">";
	a+=" <INPUT class=\"menub\" TYPE=\"button\" VALUE=\" B \" OnClick=\"wstaw_znacznik(this.form.tresc, '[B]', '[/B]')\">";
	a+=" <INPUT class=\"menui\" TYPE=\"button\" VALUE=\" I \" OnClick=\"wstaw_znacznik(this.form.tresc, '[I]', '[/I]')\">";
	a+=" <INPUT TYPE=\"button\" VALUE=\" U \" OnClick=\"wstaw_znacznik(this.form.tresc, '[U]', '[/U]')\">";
	a+=" <INPUT TYPE=\"button\" VALUE=\" player \" OnClick=\"wstaw_znacznik(this.form.tresc, '[PLAYER]', '[/PLAYER]')\">";
	a+="<br><br>";
	document.write(a);

}

function wstaw_znacznik(pole, przed, po) {
  if (document.selection) 
	{ // IE/Opera
		pole.focus();
	    obszar      = document.selection.createRange();
		obszar.text = przed+obszar.text+po;
	    obszar.select();
	} 
  else if (pole.selectionStart>-1) { // FireFox
		start = pole.selectionStart;
		 tekst = przed+pole.value.substring(start,pole.selectionEnd)+po;
		pole.value = pole.value.substring(0, start)
		+ tekst + pole.value.substring(pole.selectionEnd, pole.value.length);
		pole.selectionStart = start+tekst.length;
		pole.selectionEnd   = pole.selectionStart;
  }
}

//*************************************************************
function help(par, szer, wys)
{
	if(!szer) szer=350;
	if(!wys) wys=200;

	reWin=window.open('help.php?par='+par,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+szer+',height='+wys+',top=50,left=100')
	reWin.focus();
}

//#########################################################################################
//*************************
function ukryj_pokaz(dana, id) {

	div=document.getElementById(id);
	
	if(dana=="0") div.style.display="none";
	else		  div.style.display="block";
}




