// form registery 
function test2(){
	if(document.form2.user.value.length > 0 && document.form2.passwdA.value == document.form2.passwdB.value && document.form2.passwdA.value.length > 5 && document.form2.email.value.indexOf("@") != -1 && document.form2.email.value.indexOf(".") != -1 && document.form2.gg.value.length > 0){
		document.form2.submit();
	} else {
		alert("pola są wypełnione nie prawidłowo\npopraw!");
	}
}


// form user_passwd
function test(){
	if(document.form1.inputuser.value.length > 0 && document.form1.inputpasswd.value.length > 0){
		document.form1.submit();
	} else {
		alert("pola są wypełnione nie prawidłowo\npopraw!");
	}
}

function zapomnialem(){
	if(document.form1.inputuser.value.length < 4){
		alert("by przypomnieć tobie hasło potrzebna jest twoja nazwa usera.");
	} else {
		document.form1.przypomnienie.value = "true";
		document.form1.submit();
	}
}



// dodanie kodu do posta z imgdb
function imgdbDodanie(){
	obraz = document.form1.imgWybrany.value;
	justowanie = document.form1.justowanie.value;
	typImg = document.form1.typImg.value;
		
	if(document.form1.typPliku.value == "image/gif" || document.form1.typPliku.value == "image/jpeg"){
		toReturn = "[_imgdb_]"+obraz+"[_/imgdb_]";
		if(typImg == "mini"){
			toReturn = "[_mini_]./imgdb/"+obraz+"[mini]"+toReturn+"[_/mini_]";
		}else if(typImg == "link"){
			toReturn = "[_link_]http://_wpisz_tutaj_adres_[link]"+toReturn+"[_/link_]";
		}
	} else{
		toReturn = "[_flashdb_]"+obraz+"[_/flashdb_]";
	}
	
	if(justowanie == "left"){
		toReturn = "[_justLewo_]"+toReturn+"[_/justLewo_]";
	} else {
		toReturn = "[_justPrawo_]"+toReturn+"[_/justPrawo_]";
	}
	
	//
	//obraz = document.form1.imgWybrany.value;
	toReturn = " "+toReturn+" ";
	self.opener.document.form1.tresc.value = toReturn + self.opener.document.form1.tresc.value ;
	//alert(toReturn);
}

// zapytanie do imgdb
function imgdbQueryDel(akcja, entryID){
	document.form1.akcja.value=akcja;
	document.form1.entryID.value=entryID;
	popUpWindowQuery('./obj/potwierdzenie_takNie.html', 500, 30);
}

// pop up window
var popUpWin=0;
function popUpWindow(URLStr, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  var left = Math.floor((screen.width/2)-(width/2));
  var top = Math.floor((screen.height/2)-(height/2));
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
// pop up window

// pop up window query
var popUpWinQuery=0;
function popUpWindowQuery(URLStr, width, height)
{
  if(popUpWinQuery)
  {
    if(!popUpWinQuery.closed) popUpWinQuery.close();
  }
  var left = Math.floor((screen.width/2)-(width/2));
  var top = Math.floor((screen.height/2)-(height/2));
  popUpWinQuery = open(URLStr, 'popUpWinQuery', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
// pop up window query

// pop up window imgdb
var popUpWinimgdb=0;
function popUpWindowimgdb(URLStr, width, height)
{
  if(popUpWinimgdb)
  {
    if(!popUpWinimgdb.closed) popUpWinimgdb.close();
  }
  var left = Math.floor((screen.width/2)-(width/2));
  var top = Math.floor((screen.height/2)-(height/2));
  popUpWinimgdb = open(URLStr, 'popUpWinimgdb', 'toolbar=no,location=no,directories=no,status=yes,menub ar=no,scrollbar=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
// pop up window imgdb

// dekodowanie emaili
function emailDekod(arg){
	arg = arg.replace("[malpa]", "@");
	arg = arg.replace("[kropka]", ".");
	arg = arg.replace("[peel]", "pl");
	arg = arg.replace("[malpa]", "@");
	arg = arg.replace("[kropka]", ".");
	arg = arg.replace("[peel]", "pl");
	window.location.replace("mailto:"+arg);
}
// dekodowanie emaili

// sprawdzenia dla panel post
function panelPost(){
	

}
// funkcje dla onclik dla panelu katalogow //
function panelKatalog(arg){
	if(arg == "hiper"){
		document.form1.tresc.value = 'http://';
	} else if(arg == "dir"){
		document.form1.tresc.value = '';
	}
}
// funkcje dla onclik dla panelu katalogow //