//----------------------------------------------------------------------------------////	Operacje na liscie wyboru SELECT////---------------------------------------------------------------------------------- //funkcja sprawdza czy na liscie SELECT przekazanej jako pierwszy argument wystepuje wartosc przekazana jako //drugi parametr wywolania funkcji. Zwraca true lub false  function SelectList_isOptionInsideList(Lista, dana) { 	 	 	for (var i=0; i<Lista.length; i++) 	{ 		 		 		if (Lista.options[i].text == dana) 			return true;  	} 		  	return false; }  //funkcja dodaje do listy SELECT przekazanej jako pierwszy argument wartosc przekazana jako //drugi parametr wywolania funkcji. Zwraca nowo utworzona pozycje OPTION  function SelectList_AddOption(Lista, dana) { 	 	 	var option=document.createElement("OPTION");	option.appendChild(document.createTextNode(dana));					Lista.appendChild(option);	return option; }  //funkcja usuwa z listy SELECT wszystkie pozycje ktore sa zaznaczone jako wnik zwraca ilosc usunietych pozycji function SelectList_DelSelectedOptions(Lista) { 	var ile = 0; 	for (var i = Lista.length - 1; i >= 0; i--) 		if (Lista.options[i].selected) 		{			Lista.remove(i);			ile++;		}		    	    return ile; }    //funkcja zaznacza na liscie SELECT pozycje o nazwie przekazanej w zmiennej dana  function SelectList_SelectOption(Lista, dana) { 	 	 		 		for (var i = 0; i < Lista.length; i++) 		if (Lista.options[i].text == dana) 		   Lista.options[i].selected = true;					 	  }  //funkcja zaznacza wszystkie pozycje na liscie function SelectList_SelectAll(Lista) {	alert('zaznaczam');  	for (var i=0; i<Lista.length; i++) 		Lista.options[i].selected = true; }  //funkcja usuwa wszystkie pozycje z listy List function SelectList_DelAll(List) { 	for (var i = Lista.length - 1; i >= 0; i--)  	     	    	Lista.remove(i);    		 }  //funkcja zwraca tablicę ze wszystkimi zaznaczonymi pozycjami function SelectList_GetAllSelectedOptions(Lista) { 	var res = new Array(); 	for (var i = Lista.length - 1; i >= 0; i--) 		if (Lista.options[i].selected)		 				res.push(Lista.options[i].text);		  	    return res; }   function SelectList_DelOption(Lista, wzor) { 	for (var i = 0; i < Lista.length; i++) 		if (Lista.options[i].text == wzor) 		   Lista.remove(i); 			 }//----------------------------------------------------------------------------------////	Funkcje Towrzące inputy dla dialogów////----------------------------------------------------------------------------------/** funkcja tworzy diva zawierającego w sobie opis pola input oraz samo pole input.  *  * @param {DOMNode} hParent - węzeł będęcy rodzice tworzonego panelu   * @param {int} left - odległość w pixelach od lewej krawędzi hParent * @param {int} top - odległość w pixelach od górnej krawędzi hParent * @param {int} width - długość panelu w pixelach * @param {int} height - wysokość panelu w pixelach * @param {string} nazwa - nazwa tworzonego pola input * @param {string} textowyOpis - tekstowy opis pola input wyświetlany nad nim * @return {DOMNode} nowo stworzony div */ function CreateInputField(hParent, left, top, width, height, nazwa, textowyOpis, value ){	value == undefined ? value = '' : false;	//odległość w pixelach pomiędzy opisem a polem input	var sep = 3;	 		//stwórz opis pola	var opis = document.createElement('div');	opis.type='div';	opis.name = 'InputText_Opis';	opis.value='';		opis.innerHTML = textowyOpis;    SetElemStyle(opis, "position:absolute; left:2px; top:0px;");	//oblicz rozmiar jaki zajmie opis pola na dialogu    hParent.appendChild(opis);	var opisHeight = getElemHeight(opis);				hParent.removeChild(opis); 		//stwórz element input	var input = document.createElement('input');	input.type  = 'text';	input.name = nazwa;		input.value = value;	    SetElemStyle(input,"position:absolute; background-color: white; " + 						GetCSSSize(0, opisHeight + sep, width, height)); 	//oblicz rozmiar jaki zajmie element input na dialogu             			hParent.appendChild(input);		var inputHeight = getElemHeight(input);	hParent.removeChild(input); 		var html = '<input type="text" name="' + nazwa + '" value="' + value + '" ' + 	           'style="position:absolute; background-color: white; ' + GetCSSSize(0, opisHeight + sep, width, height) + '" />';		//utwórzrz kontener magazynujący opis i input		var pudlo = document.createElement('div');	pudlo.type='div';		pudlo.name = 'InputText_Kontener';	pudlo.value='';		     SetElemStyle(pudlo, "position:absolute; " + 						GetCSSSize(left, top, width, opisHeight + sep + inputHeight) );    hParent.appendChild(pudlo);		      //przypisz stworzone elemnty do pudla    pudlo.innerHTML = html;		pudlo.appendChild(opis);		//pudlo.appendChild(input);			                       		return pudlo;}function CreatPassField(hParent, left, top, width, height, nazwa, textowyOpis ){	//odległość w pixelach pomiędzy opisem a polem input	var sep = 3;	 		//stwórz opis pola	var opis = document.createElement('div');		opis.innerHTML = textowyOpis;    SetElemStyle(opis, "position:absolute; left:2px; top:0px;");	//oblicz rozmiar jaki zajmie opis pola na dialogu    hParent.appendChild(opis);	var opisHeight = getElemHeight(opis);				hParent.removeChild(opis); 		//stwórz element input	var input = document.createElement('input');	input.type  = 'password';	input.name = nazwa;	      SetElemStyle(input,"position:absolute; background-color: white; " + 						GetCSSSize(0, opisHeight + sep, width, height)); 	//oblicz rozmiar ajki zajmie element input na dialogu             			hParent.appendChild(input);		var inputHeight = getElemHeight(input);	hParent.removeChild(input); 		//utwórzrz kontener magazynujący opis i input		var pudlo = document.createElement('div');			     SetElemStyle(pudlo, "position:absolute; " + 						GetCSSSize(left, top, width, opisHeight + sep + inputHeight) );    hParent.appendChild(pudlo);		      //przypisz stworzone elemnty do pudla	pudlo.appendChild(opis);	pudlo.appendChild(input);		                       		return pudlo;	}/** funkcja tworzy przycisk button *  * @param {DOMNode} hParent - węzeł będący rodzice tworzonego panelu   * @param {int} left - odległość w pixelach od lewej krawędzi hParent * @param {int} top - odległość w pixelach od górnej krawędzi hParent * @param {int} width - długość panelu w pixelach * @param {int} height - wysokość panelu w pixelach * @param {string} id - identyfikator przycisku * @param {string} value - wartosc napisana na przycisku * @return {DOMNode} nowo stworzony button  */function CreateButton(hParent, left,top, width, height, id, value){  var btn = document.createElement("input");  btn.id = id;  btn.type='button';  btn.name=value;  btn.value = value;    SetElemStyle(btn, "position: absolute;" + GetCSSSize (left, top, width, height) );    hParent.appendChild(btn);    return btn;}/** funkcja tworzy panel grupujacy kilka pól wraz z jego opisem *  * @param {DOMNode} hParent - węzeł będący rodzice tworzonego panelu   * @param {int} left - odległość w pixelach od lewej krawędzi hParent * @param {int} top - odległość w pixelach od górnej krawędzi hParent * @param {int} width - długość panelu w pixelach * @param {int} height - wysokość panelu w pixelach * @param {Object} text - tekstowy opis panelu * @return {DOMNode} - nowo stworzony div */function CreateGroupPanel(hParent, left, top, width, height, text ){	//stwórz pudło zawierajace w sobie zarówno obramowanie jak i opis	var pudlo = document.createElement("div"); 	pudlo.name = 'GroupPanel_Kontener'; 	      SetElemStyle(pudlo,"position:absolute;" + GetCSSSize(left, top, width, height) );					   	hParent.appendChild(pudlo);		//stworz opis panelu	var opis = document.createElement("div");	opis.name = 'GroupPanel_Opis';    opis.innerHTML = text;	    SetElemStyle(opis,"position:absolute; left:7px; top:0px; padding: 0px 3px;" + 					  " background-color: "+hParent.style.backgroundColor+";");           hParent.appendChild(opis);	var opisHeight = getElemHeight(opis);	hParent.removeChild(opis);			//stwórz obramowanie	var elem = document.createElement("div");  	elem.name = 'GroupPanel_Panel';	      SetElemStyle(elem,"position:absolute; border:solid black 1px; " + 					   GetCSSSize(0, (opisHeight/2), width, height - (opisHeight/2)) );					   	pudlo.appendChild(elem);	pudlo.appendChild(opis);	     hParent.appendChild(pudlo);  		return pudlo;	}/** funkcja zwraca całą sekcję head strony *  * @param {DOMNode} parent - uchyt rodzica na ktorym wyswietlona błdzie pozycja * @param {int} sep - separator pozycji wyrażony w px * @param {Object} top - odstęp w pikselach sekcji head od górnegop marginesu pozycji hParent * @param {Object} elemWidth - długość elementów wyrażona w pikselacha * @param {Object} elemHeight - szerokość elementów wyrażona w pikselacha * @return {DOMNode} - funkcja zwraca ostatni stworzony element w obrebie sekcji head */ function CreateHeadSection(parent, sep, top, elemWidth, elemHeight){	var elem;		elem = CreateInputField(parent, sep, top, elemWidth, elemHeight, "title", "[Meta] Tytuł Strony :");	elem = CreateInputField(parent, sep, getElemBottom(elem) + sep, elemWidth, elemHeight, "description", "[Meta] Opis Strony :");	elem = CreateInputField(parent, sep, getElemBottom(elem) + sep, elemWidth, elemHeight, "klucze", "[Meta] Słowa kluczowe :");	elem = CreateInputField(parent, sep, getElemBottom(elem) + sep, elemWidth, elemHeight, "adminMail", "[Meta] Adres e-mail administratora :");	return elem;		}/** funkcja tworzy pole input zawierające opis oraz właściwe pole *  * @param {DOMNode} hParent - węzeł będący rodzice tworzonego panelu   * @param {int} left - odległość w pixelach od lewej krawędzi hParent * @param {int} top - odległość w pixelach od górnej krawędzi hParent * @param {int} width - długość panelu w pixelach * @param {int} height - wysokość panelu w pixelach * @param {String} id - identyfikator pola Select * @param {String} opis - tekstowy opis panelu * @param {bool} multiselect - flag określajaca czy pole typu multiselect czy nie * @return {Object} - obiekt klasy SelectList Składający się z dwóch pól Kontener oraz Lista. Pierwszy jest uchwytem do DIVA * 					 */function CreateSelectList(hDlg, left, top, width, height, id, opis, multiselect){	var sep = 3;	var opisDiv = document.createElement('div');		opisDiv.innerHTML = opis;      SetElemStyle(opisDiv, "position:absolute; left:0px; top:0px;");    hDlg.appendChild(opisDiv);           	var myselect = null;		if ( isIE() )	{		if (multiselect == true)			myselect = document.createElement('<select name="' + id + '[]" multiple><\/select>');		else			myselect = document.createElement('<select name="' + id + '"><\/select>');					myselect.id = id;		SetElemStyle(myselect,"position: absolute; left:0px; top:" + (opisDiv.clientHeight + sep) + 							  "px; width:" + width + "px; height:" + height + "px;");		myselect.multiple = multiselect;		}	else	{				myselect = document.createElement("select");		if (multiselect == true)			myselect.setAttribute("name",id+"[]");		else			myselect.setAttribute("name",id);					myselect.setAttribute("id",id);		myselect.setAttribute("style","position: absolute; left:0px; top:" + (opisDiv.clientHeight + sep) +  							  "px; width:" + width + "px; height:" + height + "px;");							  		if (multiselect == true)					myselect.setAttribute("multiple","multiple");	}	hDlg.appendChild(myselect);		var pudlo = document.createElement('div');	    SetElemStyle(pudlo, "position:absolute;" + 						 GetCSSSize(left,top,width,getElemHeight(opisDiv) + sep + getElemHeight(myselect)));    hDlg.removeChild(opisDiv);	hDlg.removeChild(myselect);	pudlo.appendChild(opisDiv);	pudlo.appendChild(myselect);	hDlg.appendChild(pudlo);  				var Lista = new SelectList();	Lista.Kontener = pudlo;	Lista.Lista = myselect;	return Lista;}function CreateImg(hParent, left, top, width, height, id,  path){	var img = document.createElement("img");  	img.id = id;	img.type='image';	img.value=path;	img.src= path;  	    	SetElemStyle(img, "position: absolute; cursor:pointer; " + GetCSSSize (left, top, width, height) );    	hParent.appendChild(img);    	return img;}function CreateDiv(hParent, left, top, width, height, id){	var img = document.createElement("div");  	img.id = id;		  	 	SetElemStyle(img, "position: absolute; " + GetCSSSize (left, top, width, height) );  	hParent.appendChild(img);    	return img;}/** * funkcja sprawdza czy przekazny parametr jest unikalny w obróbie dokumentu *  * @param id - string - identyfikator do sprawdzenia lub null jesli nie chcemy sprawdzać * @param typ_elem - opis jakiego typu element był tworzony * @return - true jesli id jest unikalne w obróbie dokumentu false w przeciwnym wypadku */function checkID(id, typ_elem){	if (id == null)		return true;		var elem = document.getElementById(id);	if (elem != undefined)	{		alert('Zduplikowany unkalny identyfikator - "'+id+'". Tworzenie ' + typ_elem + ' nie błdzie kontynuowane. Skontaktuj się z autorem oprogramowania.');		return false;	} 		return true;}/** * Funkcja tworzenia  formularza *  * @param hParent * @param id - identyfikator formularza * @param action - akcja wywoływana przy wysyłaniu formularza * @param method - wybór metody wysyłania danych POST lub GET * @param enctype - typ kodownaia danych * @return nowo-stworzony formularz lub false w przypadku niepowodzenia */function CreateForm(hParent, id, action, method, enctype ){	if (checkID(id,'formularza') == false)		return false;		elem = document.createElement("FORM");	if (elem == undefined)	{		alert('Nie udalo się stworzyć formularza - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}			elem.action= action;	elem.method = method;	id != null ? elem.id = id : false;	elem.enctype = enctype;			hParent.appendChild(elem);	return elem;		}/** * funkcja tworząca element typu TABLE * @param hParent - DOMObject - rodzic Tworzonej tabeli * @param id - string - identyfikator tabeli jesli null tabela nie błdzie miała identyfikatora * @param style - string -  style wyświetlania tablei * @param showBorder - bool - znacznik ustalajacy czy wyświetlić granice tabeli * @return nowo-stworzona tabela lub false w przypadku niepowodzenia */function CreateTable(hParent, id, style, showBorder){		if (checkID(id,'tabeli') == false)		return false;		elem = document.createElement("table");	if (elem == undefined)	{				alert('Nie udalo się stworzyć tabeli - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		SetElemStyle(elem,style);	id != null ? elem.id = id : false;	showBorder == true ? elem.border = "1" : elem.border = "0";	elem.cellSpacing = 0;	elem.cellPadding = 0;			var tbody = document.createElement("tbody");	SetElemStyle(tbody,style);	tbody.cellSpacing = 0;	tbody.cellPadding = 0;	elem.appendChild(tbody);		hParent.appendChild(elem);	  return tbody;		}/** * funkcja tworzenia komórki tabeli <td> </td>  * @param hParent - DOMObject table - rodzicdla którego tworzona jest komórka   * @param id - string - identyfikator komórki * @param createRow - znacznik określający czy obudowac tworzoną komórkę wierszem <tr></tr> * @return - stworzona komórka lub false w przypadku niepowodzenia */function CreateTableCol(hParent,id,createRow, style){	var td, tr = null;				//sprawdź czy rodzic ma odpowiedni typ do utworzenia tabali		if (createRow == true && (hParent.nodeName != 'TABLE' && hParent.nodeName != 'TBODY'))	{		alert('Próba utworzenia komórki tabeli w obróbie rodzica nie będącego tabelę. Tworzenie komórki nie błdzie kontynuowane. Skontaktuj się z autorem oprogramowania');		return false;	}		if (createRow == false && hParent.nodeName != 'TR')	{		alert('Próba utworzenia komórki tabeli w obróbie rodzica nie będącego wierszem tabeli. Tworzenie komórki nie błdzie kontynuowane. Skontaktuj się z autorem oprogramowania');		return false;	}		//sprawdź unikalność identyfikatora komórki	if (checkID(id,'komórki tabeli') == false)		return false;			if (createRow == true)		{		tr = document.createElement('TR');		style != undefined ? SetElemStyle(tr,style) : false;			}		 		td = document.createElement('TD');	id != null ? td.id = id : false;	style != undefined ? SetElemStyle(td,style) : false;		if (createRow == true)	{		tr.appendChild(td);		hParent.appendChild(tr);	}	else	{		hParent.appendChild(td);	}		return td;	}function CreateTableRow(hParent, id, style){	var tr = null;	//sprawdź czy rodzic ma odpowiedni typ do utworzenia tabali		if (hParent.nodeName != 'TABLE' && hParent.nodeName != 'TBODY')	{		alert('Próba utworzenia komórki tabeli w obróbie rodzica nie będącego tabelę. Tworzenie komórki nie błdzie kontynuowane. Skontaktuj się z autorem oprogramowania');		return false;	}			//sprawdź unikalność identyfikatora komórki	if (checkID(id,'wiersza tabeli') == false)		return false;		tr = document.createElement('TR');		 	id != null ? tr.id = id : false;			hParent.appendChild(tr);		return tr;	} /** * funkcja tworzy pole wyboru pliku do uploadu *  * @param hParent - DOMObject - rodzic dla tworzonego elementu * @param id - string - identyfikator tworzonego elemntu * @param size - int - rozmiar pola w znakach * @param style - styl przypisany do elementu * @return */ function CreateInputFileField(hParent, id, size, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'pola wyboru pliku') == false)		return false;		var elem  = document.createElement('input');	if (elem == undefined)	{		alert('Nie udalo się stworzyć pola wyboru pliku - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		style != '' ? SetElemStyle(elem,style) : false;	id != null ? elem.id = id : false;	elem.size = size;	elem.type = "file";		hParent.appendChild(elem);	return elem;} function CreatePlainText(hParent,text,style){	var elem = document.createElement('div');	elem.className = 'cmsFont';	elem.appendChild(document.createTextNode(text));		style != "" ? SetElemStyle(elem,style) : false;		hParent.appendChild(elem);	return elem;	}function CreateTextArea (hParent, id, rows, cols, name, value, style){	var elem = document.createElement('textarea');	elem.rows = rows;	elem.cols = cols;		elem.name = name;	style != "" ? SetElemStyle(elem,style) : false;	id != null ? elem.id = id : false;		hParent.appendChild(elem);		value == undefined ? value = '' : false;	elem.innerHTML = value;		return elem;	}function CreateSelList(hParent,id,name,multiselect,style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'listy wyboru') == false)		return false;		var elem  = document.createElement('select');	if (elem == undefined)	{		alert('Nie udalo się stworzyć listy wyboru - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		elem.name = name;	style != "" ? SetElemStyle(elem,style) : false;	id != null ? elem.id = id : false;	multiselect == true ? elem.multiple="multiple" : false;		hParent.appendChild(elem);	return elem;}function CreateSelListOption(hParent, opis, select){		var elem = document.createElement('option');	if (elem == undefined)	{		alert('Nie udalo się stworzyć opcji dla listy wyboru - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}			var pom = document.createTextNode(opis);	elem.appendChild(pom);	elem.value = opis;	if (isIE())		elem.selected = select;	else if (select == true)		elem.setAttribute('selected',true);		hParent.appendChild(elem);			return elem;}function CreateEditField(hParent, id, name, value, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'pola edycyjnego') == false)		return false;		var elem  = document.createElement('input');	if (elem == undefined)	{		alert('Nie udalo się stworzyć listy wyboru - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}			elem.type='text';	elem.value = value;	elem.name = name;	style != "" ? SetElemStyle(elem,style) : false;	id != null ? elem.id = id : false;		hParent.appendChild(elem);	return elem;	}function CreateDivField(hParent, id, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'elementu div') == false)		return false;		var elem  = document.createElement('div');	if (elem == undefined)	{		alert('Nie udalo się stworzyć elemntu div - "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		style != "" ? SetElemStyle(elem,style) : null;	id != null ? elem.id = id : null;		hParent.appendChild(elem);	return elem;}function CreateInput(typ, hParent, id, nazwa, wartosc, style){		//sprawdź unikalność identyfikatora komórki	if (checkID(id,'elementu input '+typ) == false)		return false;			var elem  = document.createElement('input');	if (elem == undefined)	{		alert('Nie udalo się stworzyć elemntu input '+typ+' o identyfikatorze "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}			elem.type = typ;	style   != null ? SetElemStyle(elem,style) : null;	nazwa   != null ? elem.name = nazwa : null;		id      != null ? elem.id = id : null;	wartosc != null ? elem.value = wartosc : null; 			hParent.appendChild(elem);	return elem;}function CreateCheckBoxEx(hParent, id, nazwa, opis, checked, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'elementu checkbox') == false)		return false;			var elem  = document.createElement('input');	if (elem == undefined)	{		alert('Nie udalo się stworzyć elemntu checkbox o identyfikatorze "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		if (isIE())	{		var checkStr, idStr;		checked == true ? checkStr = "checked='checked'" : checkStr = '';		id != null ? idStr = 'id='+id : idStr = '';		var strInput = "<input type='checkbox' "+idStr+" name='"+nazwa+"' "+checkStr+" />";		elem = document.createElement(strInput);			}	else	{				elem.type = 'checkbox';		style   != null ? SetElemStyle(elem,style) : null;		nazwa   != null ? elem.name = nazwa : null;			id      != null ? elem.id = id : null;		elem.checked = checked;			}					elem.style.marginRight = '4px';		var Label = document.createElement("label");	if (Label == null)  		return false;  		Label.className = 'cmsFont';	style   != null ? SetElemStyle(Label,style) : null;  	  	Label.appendChild(elem);  	Label.appendChild(document.createTextNode(opis));	hParent.appendChild(Label);		return elem;}function CreateRadioEx(hParent, id, nazwa, opis, checked, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'elementu checkbox') == false)		return false;			var elem  = document.createElement('input');	if (elem == undefined)	{		alert('Nie udalo się stworzyć elemntu checkbox o identyfikatorze "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}		if (isIE())	{		var checkStr, idStr;		checked == true ? checkStr = "checked='checked'" : checkStr = '';		id != null ? idStr = 'id='+id : idStr = '';		var strInput = "<input type='radio' "+idStr+" value='"+opis+"'  name='"+nazwa+"' "+checkStr+" />";		elem = document.createElement(strInput);			}	else	{				elem.type = 'radio';		style   != null ? SetElemStyle(elem,style) : null;		nazwa   != null ? elem.name = nazwa : null;			opis   != null ? elem.value = opis : null;			id      != null ? elem.id = id : null;		elem.checked = checked;			}						elem.style.marginRight = '4px';		var Label = document.createElement("label");	if (Label == null)  		return false;  			style   != null ? SetElemStyle(Label,style) : null;  	 	Label.appendChild(elem);  	Label.appendChild(document.createTextNode(opis));	hParent.appendChild(Label);		return elem;}function CreateElem(typ, hParent, id, nazwa, wartosc, style){	//sprawdź unikalność identyfikatora komórki	if (checkID(id,'elementu div') == false)		return false;			var elem  = document.createElement(typ);	if (elem == undefined)	{		alert('Nie udalo się stworzyć elemntu '+typ+' o identyfikatorze "'+id+'". Skontaktuj się z autorem oprogramowania.');		return false;	}			style   != null ? SetElemStyle(elem,style) 	: null;	nazwa   != null ? elem.name = nazwa 		: null;		id      != null ? elem.id = id 				: null;	wartosc != null ? elem.innerHTML = wartosc 	: null; 			hParent.appendChild(elem);	return elem;	}//deklaracja obiektu Select List zawierajace dwa pola: Kontener (uchwyt na diva obejmującego listę i opis)//oraz Lista uchwyt na Liste Select function SelectList(){	  this.Kontener = null;  this.Lista = null;    }function CreateTabCtrlPage(hParent, opis, size){	//stwórz górny przycisk TabCtrl	var button = document.createElement('div');			PageCount == 0 ? button.className += 'przycisk select' : button.className += 'przycisk normal';		button.name = 'page' + PageCount;		button.id = 'page_button' + PageCount; 			button.innerHTML = opis;						var pomLeft = size['left'];	if (PageCount > 0) 	{				var prev = document.getElementById('page_button' + (PageCount-1));		pomLeft += parseInt(prev.style.left) + prev.clientWidth;			}			var style = 'z-index:2; position: absolute;' + 'left:' + pomLeft +'px; top:' + size['top'] + 'px;';	SetElemStyle(button, style);			hParent.appendChild(button);		//stwórz panel strony	var pomTop = size['top'] + button.clientHeight + 1;		var page = document.createElement('div');				var style = 'z-index:1; position: absolute; border: solid black 1px; background-color:#D4D0C8; ' + 'left:' + size['left'] + 				'px; top:'+ pomTop +'px; width:' + size['width'] +'px; height:' + size['height'] +'px; ';				 		page.className = 'page';	page.id = page.name = 'page' + PageCount;	 	SetElemStyle(page, style);	hParent.appendChild(page);			button.onclick = function() {return ShowPage(this.name); }	 		//zwiększ licznik stron dla kolejnej 	PageCount++;        return page;}function getChildByName(parent, wzor){		if (parent.name == wzor) 				return parent;					 		for (var i = 0; i < parent.childNodes.length; i++) 	{		res = getChildByName(parent.childNodes[i], wzor);		if (res != undefined)			return res;				}			return undefined;	}//----------------------------------------------------------------------------------////	Funkcje obslugujace dialog////----------------------------------------------------------------------------------  var hDlg = false;  var CheckCount = 0; var RadioCount = 0; var PageCount = 0;  		 //domyślny kolor tła dla dialogu var DlgBkColor = '#FBF6BD';  //funkcja usuwa DIV-a przekazanego przez zmienna globlana hDlgfunction CloseDialog(){		hDlg.parentNode.removeChild(hDlg);	hDlg = false;		//wyzeruj liczniki pozycji dialogu	CheckCount = RadioCount = PageCount = 0;		if (Shadow != false)	{		Shadow.parentNode.removeChild(Shadow);		Shadow = null;	}			}//funkcja znajduje wśród wszystkich dzieci dialogu pierwszy element o nazwie name lub null jesli go nie mafunction GetFirstDlgItemByName(hDlg, name){	var res = null;		if (hDlg.name == name)		return hDlg;	else if (hDlg.childNodes.length != 0)	{		for (var i = 0; i<hDlg.childNodes.length; i++)		{			res = GetFirstDlgItemByName(hDlg.childNodes[i],name);			if (res != null)				break;					}						 		return res;	}}function SetDlgItemAction(id, akcja, funkcja ){		var control = document.getElementById(id);	if (control != false)	{		if (akcja == 'onclick')							control.onclick = funkcja;				else if (akcja == 'ondblclick')			control.ondblclick = funkcja;		else 			alert("Akcja '" + akcja + "' nie jest zdefiniowana w programie. Skontaktuj się z autorem oprogramowania");	}}function getPos(obj){				/*var res = YAHOO.util.Dom.getXY(obj);	  	var lft = obj.offsetLeft;	var top = obj.offsetTop;	while(obj.offsetParent!=null)	{		var par = obj.offsetParent;		lft += par.offsetLeft;		top += par.offsetTop;		obj = par;	}*/								//alert('YAHOO.util.Dom.getXY(obj) = ' + res + '\n[lft,top] = ' + [lft,top]);		//return [lft,top];	return YAHOO.util.Dom.getXY(obj);}function PrintStructure ( obj, poziom ){	wynik = "";			if (obj.name != undefined || obj.type != undefined || obj.value != undefined) 	{		if (obj.name != 'InputText_Opis' && obj.name != 'InputText_Kontener')			wynik = poziom + obj.name + "[" + obj.type + "]" + " -> " + obj.value + '\n';	}	if (obj.childNodes.length > 0) 	{				for (var i = 0; i < obj.childNodes.length; i++) 		{			wynik += PrintStructure(obj.childNodes[i], poziom + "|    ");		}	}		return wynik;			}function getFormatedData(){	var d=new Date();	(d.getMonth() + 1) > 9 ? mies = (d.getMonth() + 1) : mies = "0" + (d.getMonth() + 1);	(d.getDate() + 1) > 9 ? dzien = d.getDate() : dzien = "0" + d.getDate();		d.getHours() > 9 ? godzina = d.getHours() : godzina = "0" + d.getHours();	d.getMinutes() > 9 ? minuta = d.getMinutes() : minuta = "0" + d.getMinutes(); 	d.getSeconds() > 9 ? sekunda = d.getSeconds() : sekunda = "0" + d.getSeconds();				return  '' + d.getFullYear() + '-' + mies + '-' + dzien + ' ' + godzina + ':' + minuta + ':' + sekunda;}function CreateDialogEx ( typ, inputParam, extraParam ){		var posID, dlgOpis, funkcja, formAction = null;		//jesli przekazano parametry zdekoduj je	if (inputParam != '')	{		inputParam = unserialize(base64_decode(inputParam));		dekodujRekurencyjnie(inputParam);	}			if (extraParam != '')	{		extraParam = unserialize(base64_decode(extraParam));		dekodujRekurencyjnie(extraParam);	}				//pobierz identyfikator pozycji dla której wywołano dialog	posID = getParamField(extraParam,'id');			//pobierz opis wyswietlany na belce panelu	extraParam != 0 && extraParam['opis'] != undefined ? dlgOpis = extraParam['opis'] : dlgOpis = "";		//pobierz akcję która ma zostać wywołana w momenci zatwierdzania panelu	extraParam != 0 && extraParam['formAction'] != undefined ? formAction = extraParam['formAction'] : false;		try	{		//przygotuj kod javascript dla tworzonego panleu (wygodne poszukiwanie funkcji odpowiedzialnej za tworzenie pozycji, 		//poniewaz ma ona taką nazwą jak parametr typ tworzonego dialogu )				funkcja = typ + '(posID, inputParam, extraParam);'				//wykonaj przygotowany kod					eval(funkcja);	}	catch (err)	{		//jesli coś poszło nie tak w trakcie tworzenia pozycji komunikat o błądzie i koniec		var message = 'W trakcie tworzenia panelu edycyjnego napotkano błędy. Tworzenie panelu nie będzie\n' + 						  'kontynuowane. Jeśli problem będzie się powtarzał, skontaktuj się z autorem oprogramowania.\n\n' + 						  'Czy wyswietlić szczegółowe informacje o błędzie?';				 						confirm(message) ? PrintObject(err,1,1,100,true) : false;					return false;	}}//#######################################################################################################################################//	FUNKCJE ODPOWIEDZIALNE ZA ZDEFINIOWANE DIALOGI EDYCYJNE CMS-a //#######################################################################################################################################//dialog dodawania i wyboru języka strony function Language(posID, inputParam, extraParam){	var tab, tr, td, pom, btn_add, btn_del, SelList1, SelList2, select;		//PrintObject(inputParam,1,1,10,true);	//PrintObject(extraParam,1,1,10,true);			//stwórz panel edycji języka	var panel = new EditPanel();	panel.setFormAction('index/selectlanguage');		panel.setFormCloseAction('index/refresh',0);	panel.init(null, null, 'center', 'center', 500, 320, 'Edycja języków', true);		//stwórz tabelę dla rozmieszczania elementów	tab = CreateTable(panel.form,null,"width:"+panel.clientWidth+"px;", false);		//stworz wiersz opisu select i skrotu	tr = CreateTableRow(tab,null,"");		//oblicz szerokosc selecta wyboru jezyka jako szer panelu - 75px (dla edits skrot) - 10px dla przerwy miedzy select a edit	pom = panel.clientWidth - 85;	td = CreateTableCol(tr,null,false,"width:"+pom+"px;");	//utwórzz opis select wyboru języka			CreatePlainText(td,'Aktualnie edytowany język:','');	td = CreateTableCol(tr,null,false,"width:10px;");	//utwórzz przerwę pomiędzy selectem a skrótem		td = CreateTableCol(tr,null,false,"width:75px;");	//utwórzz opis skrotu języka			CreatePlainText(td,'skrót języka:','');		//stworz wiersz select i skrotu	tr = CreateTableRow(tab,null,"");	td = CreateTableCol(tr,null,false,"width:"+pom+"px;");	//utwórzz opis select wyboru języka			SelList1 = CreateSelList(td,null,'nazwa','false',"width:"+pom+"px;");		td = CreateTableCol(tr,null,false,"width:10px;");	//utwórzz przerwę pomiędzy selectem a skrótem		td = CreateTableCol(tr,null,false,"width:75px;");	//utwórzz opis skrotu języka			SelList1.skrotEdit = CreateInput('text',td,null,'skrot','','width:75px;');	for (var i=0;i<inputParam['langCount']; i++)		if (inputParam['Lang'][i]['wybrany'] == 'true')			SelList1.skrotEdit.value = inputParam['Lang'][i]['skrot'];		SelList1.param = inputParam;		//dodaj do listy wszystki zdefiniowane języki	for (var i=0;i<inputParam['langCount']; i++)	{		inputParam['Lang'][i]['wybrany'] == 'true' ? select = true : select = false;		CreateSelListOption(SelList1,inputParam['Lang'][i]['nazwa'], select);	}		//stwórz wiersz opisu dostepnych języków	tr = CreateTableRow(tab,null,"");	td = CreateTableCol(tr,null,false,"width:"+pom+"px;");	//utwórzz opis select wyboru języka	CreatePlainText(td,'Dostępne języki:','padding-top:5px;');	td = CreateTableCol(tr,null,false,"width:10px;");	//utwórz przerwę pomiędzy selectem a skrótem	td = CreateTableCol(tr,null,false,"width:75px;");	//utwórz opis skrotu języka		//stwórz opisu dostepnych języków	tr = CreateTableRow(tab,null,"");	td = CreateTableCol(tr,null,false,"width:"+pom+"px;");	//utwórzz opis select wyboru języka			SelList2 = CreateSelList(td,null,'domyslne',true,"width:"+pom+"px; height:180px;");	//dodaj do listy wszystki zdefiniowane języki	for (var i=0;i<inputParam['langCount']; i++)		CreateSelListOption(SelList2,inputParam['Lang'][i]['nazwa'],false);		td = CreateTableCol(tr,null,false,"width:10px;");	//utwórzz przerwę pomiędzy selectem a skrótem		td = CreateTableCol(tr,null,false,"width:75px; vertical-align:top;");	//utwórz opis skrotu języka	var btn_add = CreateInput('button',td,null,'add','Dodaj','width:75px;');	var btn_del = CreateInput('button',td,null,'del','Usuń','width:75px; margin-top:5px;');		btn_add.disabled = btn_del.disabled = false;	btn_add.onclick = function()	{		var panelAdd = new EditPanel();		panelAdd.setPoziom(1);		panelAdd.init(this, null, 'center', 'center', 400, 165, 'Dodaj nowy język', true);						//stwórz tabelę dla rozmieszczania elementów		tab = CreateTable(panelAdd.hClientPanel,null,"width:"+(panelAdd.clientWidth)+"px;", false);		td = CreateTableCol(tab,null,true,"width:"+panelAdd.clientWidth+"px;");	//utwórzz opis select wyboru języka				CreatePlainText(td,'Nazwa języka:','');		td = CreateTableCol(tab,null,true,"width:"+panelAdd.clientWidth+"px;");	//utwórzz opis select wyboru języka				CreateInput('text',td,'LangAddNazwa','LangAddNazwa','',"width:"+(panelAdd.clientWidth-4)+"px; margin-top:2px;");				//stwórz pole skrót języka		td = CreateTableCol(tab,null,true,"width:"+panelAdd.clientWidth+"px;");	//utwórzz opis select wyboru języka				CreatePlainText(td,'skrót języka:','margin-top:5px;');		td = CreateTableCol(tab,null,true,"width:"+panelAdd.clientWidth+"px;");	//utwórzz opis select wyboru języka				CreateInput('text',td,'LangAddSkrot','LangAddSkrot','',"width:100px; margin-top:2px;");					insertSeparator(tab,panelAdd.clientWidth);				panelAdd.BTN_OK.panel = panelAdd;		panelAdd.BTN_OK.List1 = SelList1;		//zapamiętaj wskaźniki n alisty aby móc dodać lub usunąć język 		panelAdd.BTN_OK.List2 = SelList2;		panelAdd.BTN_OK.onclick = function()		{			var nazwa = document.getElementById('LangAddNazwa').value;			var skrot = document.getElementById('LangAddSkrot').value;						if (nazwa == '' || skrot == '')			{				alert('Wypełnij wszystkie pola!');				return false;			}						var responseHandler = 			{				okBtn: this,				panel: this.panel,				nazwa: nazwa,				skrot: skrot,											failure: function(response)				{					alert('W trakcie dodawania języka wystapił błąd. jeśli problem błdzie\n' + 							'się powtarzał skontaktuj się z autorem oprogramowania');					this.okBtn.disabled = false;					}, 								success: function(response) 				{ 					if (response.responseText == 'ok')					{						if (confirm('Język dodny pomyślnie. Czy chcesz przekopiować style, szablony\ni obrazki z domyślnego języka aplikacji?'))						{							var responseHandler1 = 							{								okBtn: this.okBtn,								panel: this.panel,								failure: function(response)								{									alert('W trakcie kopiowania danych dla języka wystapił błąd. jeśli problem błdzie\n' + 											'się powtarzał skontaktuj się z autorem oprogramowania');									this.okBtn.disabled = false;									}, 																success: function(response) 								{ 									if (response.responseText == 'ok')									{										alert('Pomyślnie przekopiowano wszystkie dane.');										//dodaj język do listy																CreateSelListOption(this.okBtn.List1,nazwa,false);										CreateSelListOption(this.okBtn.List2,nazwa,false);										//dodaj nowododaną pozycję do parametru aby umożliwić prawidłow wyświetlanie bez przeładowania										//panelu z językami										var ile = count(this.okBtn.List1.param['Lang']); //pobierz ilość zdefiniowanych języków										this.okBtn.List1.param['Lang'][ile] = new Array();										this.okBtn.List1.param['Lang'][ile]['skrot'] = skrot;										this.okBtn.List1.param['Lang'][ile]['nazwa'] = nazwa;										this.okBtn.List1.param['Lang'][ile]['wybrany'] = 'false';																				this.panel.destroy();										this.okBtn.disabled = false;									}									else 									{										alert('W trakcie dodawania jezyka wystąpił błąd. Dodawanie języka nie może\n' +										   	'być kontynuowane. Szczegółowy opis błądu: ' + response.responseText);																			}								}							}							YAHOO.util.Connect.asyncRequest('POST', 'index/asynclanguages', responseHandler1, 'action=copy&skrot='+skrot);						}						else						{							//dodaj język do listy													CreateSelListOption(this.okBtn.List1,nazwa,false);							CreateSelListOption(this.okBtn.List2,nazwa,false);							//dodaj nowododaną pozycję do parametru aby umożliwić prawidłow wyświetlanie bez przeładowania							//panelu z językami							var ile = count(this.okBtn.List1.param['Lang']); //pobierz ilość zdefiniowanych języków							this.okBtn.List1.param['Lang'][ile] = new Array();							this.okBtn.List1.param['Lang'][ile]['skrot'] = skrot;							this.okBtn.List1.param['Lang'][ile]['nazwa'] = nazwa;							this.okBtn.List1.param['Lang'][ile]['wybrany'] = 'false';														this.panel.destroy();							this.okBtn.disabled = false;													}											} 					else					{						alert('W trakcie dodawania jezyka wystąpił błąd. Dodawanie języka nie może\n' +								'być kontynuowane. Szczegółowy opis błądu: \n\n' + response.responseText);						//sprawdź czy to przypadkiem nie jest "nasz błąd"						 						/*if (response.responseText.substr(0,3) == 'err')						{								var error =	parseInt(response.responseText.substr(4));							if (error == 2)							{								alert('Podana nazwa jezyka wystepuje juz w systemie');							}							else if (error == 3)							{								alert('Podany skrót dla jezyka wystepuje juz w systemie');							}							else															alert('W trakcie dodawania jezyka wystąpił błąd. Dodawanie języka nie może\n' +								   	'być kontynuowane. Skotanktuj sie z autorem oprogramowania.\n\n' +								   	'Szczegółowy kod błądu: Languages-err: ' + error);						}						else						{							if (confirm('W trakcie dodawania języka wystąpił błąd. jeśli problem będzie\n' + 											'się powtarzał skontaktuj się z autorem oprogramowania\n\n' + 											'Czy chcesz wyświetlić szczegołowe informacje o błądzie?'))								PrintObject(response,1,1,20,true);						}*/											}						this.okBtn.disabled = false;				}							};				this.disabled = true;							YAHOO.util.Connect.asyncRequest('POST', 'index/asynclanguages', responseHandler, 'action=add&nazwa='+nazwa+'&skrot='+skrot);		} 	}		//obsługa przycisku usuwania	btn_del.panel = panel;	btn_del.List1 = SelList1;		//zapamiętaj wskaźniki na listy aby móc dodać lub usunąć język 	btn_del.List2 = SelList2;	btn_del.onclick = function()	{		//pobierz języki wskazane do usunięcia		var sel = SelectList_GetAllSelectedOptions(this.List2);		if (sel.length == 0)		{			alert('Nie zaznaczono żadnych języków do usunięcia.');			return;		}			//sprawdź czy nie chcemy usunąc wszystkich języków		if (sel.length == this.List2.length)		{			alert('Przynajmniej jeden jezyk musi pozostać zdefiniowany.');			return;		}				this.panel.BTN_OK.disabled = true;		if (confirm('UWAGA!!\nTa operacja jest nieodwracalna a spowoduje usunięcie języka oraz wszystkich\n'+						'zdefiniowanych w nim dokumentów. Czy na pewno chcesz usunąć wskazany język?\n') )		{																									var responseHandler = 			{					sender: this,											sel: sel,											failure: function(response)				{					alert('W trakcie usuwania języka wystapił błąd. jeśli problem błdzie\n' + 							'się powtarzał skontaktuj się z autorem oprogramowania');									}, 								success: function(response) 				{ 					if (response.responseText == 'ok')					{						//alert(this.sender.List1);						//usun język z obu list												for (var i=0; i < sel.length; i++)						{										SelectList_DelOption(this.sender.List1,sel[i]);							SelectList_DelOption(this.sender.List2,sel[i]);							//przywróć właściwą wartość pola skrót języka							this.sender.List1.skrotEdit.value = this.sender.List1.param['Lang'][this.sender.List1.selectedIndex]['skrot']; 						}					} 					else					{						//sprawdź czy to przypadkiem nie jest "nasz błąd"						 						if (response.responseText.substr(0,3) == 'err')						{								var error =	parseInt(response.responseText.substr(4));							if (error == 2)							{								alert('Podana nazwa jezyka wystepuje juz w systemie');							}							else if (error == 3)							{								alert('Podany skrót dla jezyka wystepuje juz w systemie');							}							else															alert('W trakcie usuwania jezyka wystąpił błąd. Dodawanie języka nie może\n' +								   	'być kontynuowane. Skotanktuj sie z autorem oprogramowania.\n\n' +								   	'Szczegółowy kod błądu: Languages-err: ' + error);						}						else						{							if (confirm('W trakcie usuwania języka wystąpił błąd. jeśli problem będzie\n' + 											'się powtarzał skontaktuj się z autorem oprogramowania\n\n' + 											'Czy chcesz wyświetlić szczegołowe informacje o błądzie?'))								PrintObject(response,1,1,20,true);						}											}										}							};										//przygotuj parametr post do wysłania z prośbą o usunięcie języka do IndexControllera  			var postParam = 'action=del&ile=' + sel.length;			for (var i=0;i<sel.length; i++)				postParam += '&nazwa' + i + '=' + sel[i];									YAHOO.util.Connect.asyncRequest('POST', 'index/asynclanguages', responseHandler, postParam);		}		this.panel.BTN_OK.disabled = false;	};			SelList1.onchange = function()	{		var ile = count(this.param['Lang']); //pobierz ilość zdefiniowanych języków		for (var i=0; i<ile; i++)					if (this.param['Lang'][i]['nazwa'] == this.options[this.selectedIndex].value)			{								this.skrotEdit.value = this.param['Lang'][i]['skrot']; 			}		  		//alert(this.options[this.selectedIndex].value);	}		}function EmailConf(posID, inputParam, extraParam){	var panel = new EditPanel();	panel.setFormAction('index/emailsett');		panel.setFormCloseAction('index/refresh',0);	panel.init(null, null, 'center', 'center', 500, 330, 'Ustawienia skrzynki e-mail', true);			table = CreateTable(panel.form, null, 'width:'+panel.clientWidth+'px;', false);	td = CreateTableCol(table,null,true);	CreatePlainText(td,'Adres e-mail :','margin-top:5px;');	td = CreateTableCol(table,null,true);	pom = CreateInput('text',td,null,'adres',getParamField(inputParam,'adres'),'width:'+(panel.clientWidth-4)+'px; margin-top:2px;');		td = CreateTableCol(table,null,true);	CreatePlainText(td,'Podpis :','margin-top:5px;');	td = CreateTableCol(table,null,true);	pom = CreateInput('text',td,null,'podpis',getParamField(inputParam,'podpis'),'width:'+(panel.clientWidth-4)+'px; margin-top:2px;');		td = CreateTableCol(table,null,true);	var tabpom = CreateTable(td,null,'width:'+panel.clientWidth+'px;',false);	tr = CreateTableRow(tabpom,null,'');		td = CreateTableCol(tr,null,false);	CreatePlainText(td,'Serwer POP3 :','margin-top:5px;');	pom = CreateInput('text',td,null,'pop3',getParamField(inputParam,'pop3'),'width:355px; margin-top:2px;');	td = CreateTableCol(tr,null,false);	CreatePlainText(td,'Port POP3 :','margin-top:5px;');	pom = CreateInput('text',td,null,'pop3port',getParamField(inputParam,'pop3port'),'width:100px; margin-top:2px;');		td = CreateTableCol(table,null,true);	var tabpom = CreateTable(td,null,'width:'+panel.clientWidth+'px;',false);	tr = CreateTableRow(tabpom,null,'');		td = CreateTableCol(tr,null,false);	CreatePlainText(td,'Serwer SMTP :','margin-top:5px;');	pom = CreateInput('text',td,null,'smtp',getParamField(inputParam,'smtp'),'width:360px; margin-top:2px;');	td = CreateTableCol(tr,null,false);	CreatePlainText(td,'Port SMTP :','margin-top:5px;');	pom = CreateInput('text',td,null,'smtpport',getParamField(inputParam,'smtpport'),'width:100px; margin-top:2px;');		td = CreateTableCol(table,null,true);	CreatePlainText(td,'Użytkownik :','margin-top:5px;');	td = CreateTableCol(table,null,true);	pom = CreateInput('text',td,null,'user',getParamField(inputParam,'user'),'width:'+(panel.clientWidth-4)+'px; margin-top:2px;');		td = CreateTableCol(table,null,true);	CreatePlainText(td,'Hasło :','margin-top:5px;');	td = CreateTableCol(table,null,true);	pom = CreateInput('password',td,null,'pass',getParamField(inputParam,'pass'),'width:'+(panel.clientWidth-4)+'px; margin-top:2px;');					}//dialog definiowania ustawień pozycji]function Settings(posID, inputParam, extraParam){	var page1, page2, table, tr, td, pom;		//alert(posID);	//PrintObject(inputParam,1,1,20,true);			var panel = new EditPanel();	panel.setFormAction('index/pozycjesettings');		panel.setFormCloseAction('index/refresh',0);										switch (extraParam['typ'])	{		case 'domena' :			var select;									if ((inputParam['baseHref'] == '' || inputParam['baseHref'] == undefined) && 				 (inputParam['pageDir'] == '' || inputParam['pageDir'] == undefined) )				panel.init(null, null, 'center', 'center', 600, 255, 'Ustawienia wyświetlania - ' + inputParam['nazwa'], true);			else				panel.init(null, null, 'center', 'center', 600, 240, 'Ustawienia wyświetlania - ' + inputParam['nazwa'], true);			CreatePlainText(panel.form, 'Nazwa domeny :', 'margin:3px 0;');			CreateInput('text',panel.form, null,'nazwa',inputParam['nazwa'], 'width:'+(panel.clientWidth-4)+'px;');			CreatePlainText(panel.form, 'Adres bazowy dla domeny :', 'margin:3px 0;');			var baseHref = CreateInput('text',panel.form, null,'baseHref',inputParam['baseHref'], 'width:'+(panel.clientWidth-4)+'px;');			CreatePlainText(panel.form, 'Katalog magazynujący domeny :', 'margin:3px 0;');						var pageDir = CreateInput('text',panel.form, null,'pageDir',inputParam['pageDir'], 'width:'+(panel.clientWidth-4)+'px;');						inputParam['szablonyDirCheck'] == 'on' ? select = true : select = false;			var szablonyDirCheck = CreateCheckBoxEx(panel.form, null, 'szablonyDirCheck', 'Osobny katalog szablonów', select, 'margin-left:0px;');			szablonyDirCheck.onclick = function () 			{ 				szablonyDir.disabled = !this.checked;				if (!szablonyDir.disabled && inputParam['szablonyDir']=='' || inputParam['szablonyDir'] == undefined )				{					szablonyDir.value = extraParam['pageDir'] + 'Admin/public/szablony/pages/' + inputParam['nazwa'];				} 			}			var szablonyDir = CreateInput('text', panel.form, null, 'szablonyDir', inputParam['szablonyDir'], 'width:'+(panel.clientWidth-4)+'px;');			szablonyDir.disabled = !szablonyDirCheck.checked;									if ((inputParam['baseHref'] == '' || inputParam['baseHref'] == undefined) && 				 (inputParam['pageDir'] == '' || inputParam['pageDir'] == undefined) )			{				var help = CreatePlainText(panel.form, 'Uzupełnij domyślnie pozycje Adres bazowy oraz Katalog magazynujący ', 'margin:3px 0; color: #318be8; cursor: pointer');				help.onclick=function ()				{					if (confirm('UWAGA!!\nUstawienia wygenerowane automatycznie mogą nie być prawidłowe. Czy na pewno chcesz kontynuować?'))					{												var url = "" + window.location;						baseHref.value = url.substring(0,url.search('Admin/'));						pageDir.value = extraParam['pageDir'];						 					}				}			}						CreateInput('hidden', panel.form, null, 'id', posID, '');			 						break;			case 'news_pozycja' :		case 'katalog' :		case 'artykul' :      panel.init(null, null, 'center', 'center', 500, 320, 'Ustawienia wyświetlania - ' + inputParam['nazwa'], true);      panel.initTabCtrl();			page1 = panel.createTabCtrlPage('Ustawienia ogólne');			table = CreateTable(page1, null, 'width:'+panel.clientWidth+'px;', false);			td = CreateTableCol(table,null,true);			CreatePlainText(td,'Nazwa strony :','margin-top:5px;');			td = CreateTableCol(table,null,true);			pom = CreateInput('text',td,null,'nazwa',getParamField(inputParam,'nazwa'),'width:'+(page1.pageWidth-4)+'px; margin-top:2px;');			getParamField(inputParam,'nazwa') == 'index' ? pom.disabled = true : false;			td = CreateTableCol(table,null,true);			getParamField(inputParam,'PrintMainMenu') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'PrintMainMenu',"Drukuj pozycję w głównym menu serwisu", select, 'margin-top:8px;');			td = CreateTableCol(table,null,true);			getParamField(inputParam,'PrintSubMenu') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'PrintSubMenu',"Drukuj pozycję w bocznym menu serwisu", select, 'margin-top:8px;');			//stwórz sekcję head			page2 = panel.createTabCtrlPage('Sekcja head');								CreateHeadSectionEx(page2, inputParam, panel.clientWidth, page2.pageWidth-4, extraParam['lang']);			CreateInput('hidden', page2, null, 'id', posID,''); 			break;					case 'news' :				      panel.init(null, null, 'center', 'center', 500, 320, 'Ustawienia wyświetlania - ' + inputParam['nazwa'], true);      panel.initTabCtrl();			page1 = panel.createTabCtrlPage('Ustawienia ogólne');			var table = CreateTable(page1, null, 'width:'+panel.clientWidth+'px;', false);			var td = CreateTableCol(table,null,true);			CreatePlainText(td,'Nazwa strony :','margin-top:5px;');			td = CreateTableCol(table,null,true);			CreateInput('text',td,null,'nazwa',getParamField(inputParam,'nazwa'),'width:'+(page1.pageWidth-4)+'px; margin-top:2px;');			td = CreateTableCol(table,null,true);						var tabpom = CreateTable(td,null,'width:'+page1.pageWidth+'px; margin-top:5px;',false);			var tr = CreateTableRow(tabpom,null,'');			var pomwidth = parseInt(panel.clientWidth/4);			td = CreateTableCol(tr,null,false,'width:'+pomwidth+'px;');			CreatePlainText(td,'Ile pozycji wyświetlić :','');			CreateInput('text',td,null,'IleWyswietlic','','margin-right:10px; width:'+(pomwidth-14)+'px;');			td = CreateTableCol(tr,null,false,'width:'+pomwidth+'px;');			CreatePlainText(td,'Ile pozycji na stronie :','');			CreateInput('text',td,null,'IleNaStronie','','margin-right:10px; width:'+(pomwidth-14)+'px;');			td = CreateTableCol(tr,null,false,'width:'+pomwidth+'px;');			CreatePlainText(td,'Sortuj wg:','');			var sel = CreateSelList(td,null,'SortKlucz',false,'margin-right:10px; width:'+(pomwidth-10)+'px;');			var select;						 			CreateSelListOption(sel,'Daty dodania',inputParam['SortKlucz'] == 'Daty dodania');			CreateSelListOption(sel,'Hierarchi w panelu',inputParam['SortKlucz'] == 'Hierarchi w panelu');			CreateSelListOption(sel,'Nazwy',inputParam['SortKlucz'] == 'Nazwy');											td = CreateTableCol(tr,null,false,'width:'+pomwidth+'px;');			CreatePlainText(td,'Sortuj:','');			var sel = CreateSelList(td,null,'SortKierunek',false,'margin-right:10px; width:'+(pomwidth-10)+'px;');			CreateSelListOption(sel,'Rosnąco',inputParam['SortKierunek'] == 'Rosnąco');			CreateSelListOption(sel,'Malejąco',inputParam['SortKierunek'] == 'Malejąco');			CreateSelListOption(sel,'Losowo',inputParam['SortKierunek'] == 'Losowo');						td = CreateTableCol(table,null,true);			getParamField(inputParam,'LinkTyt') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'LinkTyt',"Tytuł newsa jako link do strony", select, 'margin-top:8px;');								td = CreateTableCol(table,null,true);			getParamField(inputParam,'LinkTresc') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'LinkTresc',"Treść newsa jako link do strony", select, 'margin-top:8px;');								td = CreateTableCol(table,null,true);			getParamField(inputParam,'wiecej') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'wiecej',"Drukuj na końcu frazę więcej", select, 'margin-top:8px;');								td = CreateTableCol(table,null,true);			getParamField(inputParam,'PrintMainMenu') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'PrintMainMenu',"Drukuj pozycję w głównym menu serwisu", select, 'margin-top:8px;');								td = CreateTableCol(table,null,true);			getParamField(inputParam,'PrintSubMenu') == '' ? select = false : select = true;			CreateCheckBoxEx(td,null,'PrintSubMenu',"Drukuj pozycję w bocznym menu serwisu", select, 'margin-top:8px;');						page2 = panel.createTabCtrlPage('Sekcja head');								CreateHeadSectionEx(page2, inputParam, panel.clientWidth, page2.pageWidth-4, extraParam['lang']);			CreateInput('hidden', page2, null, 'id', posID,'');			break;					case 'kontener':      panel.init(null, null, 'center', 'center', 500, 320, 'Ustawienia wyświetlania - ' + inputParam['nazwa'], true);      panel.initTabCtrl();			page1 = panel.createTabCtrlPage('Ustawienia ogólne');			var table = CreateTable(page1, null, 'width:'+panel.clientWidth+'px;', false);			var td = CreateTableCol(table,null,true);			CreatePlainText(td,'Nazwa strony :','margin-top:5px;');			td = CreateTableCol(table,null,true);			CreateInput('text',td,null,'nazwa',getParamField(inputParam,'nazwa'),'width:'+(page1.pageWidth-4)+'px; margin-top:2px;');			td = CreateTableCol(table,null,true);			break;							default: 			alert('Niezdefiniowany typ pozycji - ' + extraParam['typ'])			panel.destroy();			break;  	}}function Newsletter_v1(posID){	//var panel = new EditPanel();	//panel.setFormAction('index/emailsett');		//panel.setFormCloseAction('index/refresh',0);	//panel.init(null, null, 'center', 'center', 800, 800, 'Onefuture Newsletter', true);			//var newsletter = new Newsletter(panel.form);	//newsletter.create(inputParam);			//PrintObject(inputParam,1,1,70,true);	//PrintObject(extraParam,1,1,70,true);			var newsletter = new Newsletter_New();	}function deleteFromArray(tab, index){	if (tab == undefined || tab == false || tab == null)		return tab;			delete tab[index];			var tabpom = new Array();			for ( var i = 0; i<tab.length; i++ )						if (tab[i] != undefined)			tabpom.push(tab[i]);															//odtwórz tablicę punkty z pomocniczej tablicy 												delete tab;									tab = new Array();	for ( var i = 0; i<tabpom.length; i++ )		tab.push(tabpom[i]);				return tab;}function CreateHeadSectionEx (hParent, inputParam, panelWidth, sectionWidth, lang){		table = CreateTable(hParent, null, 'width:'+panelWidth+'px;', false);										td = CreateTableCol(table,null,true);	CreatePlainText(td,'[Meta] - Tytuł strony :','margin-top:5px;');						td = CreateTableCol(table,null,true);	CreateInput('text',td,null,'title',getParamField(inputParam,'title'),'width:'+sectionWidth+'px; margin-top:2px;');						td = CreateTableCol(table,null,true);	CreatePlainText(td,'[Meta] - Opis strony :','margin-top:5px;');						td = CreateTableCol(table,null,true);	CreateInput('text',td,null,'description',getParamField(inputParam,'description'),'width:'+sectionWidth+'px; margin-top:2px;');						td = CreateTableCol(table,null,true);	CreatePlainText(td,'[Meta] - Słowa kluczowe :','margin-top:5px;');						td = CreateTableCol(table,null,true);	CreateInput('text',td,null,'klucze',getParamField(inputParam,'klucze'),'width:'+sectionWidth+'px; margin-top:2px;');						td = CreateTableCol(table,null,true);	CreatePlainText(td,'[Meta] - Admin e-mail :','margin-top:5px;');						td = CreateTableCol(table,null,true);	CreateInput('text',td,null,'adminMail',getParamField(inputParam,'adminMail'),'width:'+sectionWidth+'px; margin-top:2px;');}//funkcja tworzy diva wyszarzającego całą stronę uniemożliwiając klikniecie //niczego co jest pod divem function CreateShadow(){		if (Shadow != null)		document.body.appendChild(Shadow);					Shadow = document.createElement('div');	Shadow.style.top = "0px";  		   		       		 	Shadow.style.left = "0px";	Shadow.style.opacity= '0.7';	Shadow.style.filter="Alpha(Opacity=70)";	Shadow.style.display = 'block';	Shadow.style.position = "absolute";	Shadow.style.backgroundColor= "black";				Shadow.style.height = getElemHeight(document.getElementById('top')) + 'px';	Shadow.style.width = document.body.clientWidth + 'px';		 		 			document.body.appendChild(Shadow);			return Shadow;}function CreateDialog(parent, id, size, opis, formAction) {  if (hDlg != false)  	 return hDlg;	            //jeśli przeglądarka IE omiń problem pozycjinowania SELECTÓW ponad wszystkim innym  if ( isIE() )  {  	var ie = document.createElement('iframe');  	ie.id = "poprawka";  	ie.frameborder = "none";	  	SetElemStyle(ie,"display:block; position:absolute; z-index:-1; background-color:"+DlgBkColor+ 					"width:"+size['width'] + "px; height: "+ size['height'] + "px; border:none;");  	ie.style.backgroundColor = DlgBkColor;  }   var div = document.createElement('div');  div.id = id;        if ( size['left'] == 'center')  	 size['left'] = (document.body.clientWidth / 2) - (size['width'] / 2);  if ( size['top'] == 'center')  	 size['top'] = ((document.documentElement||document.body).clientHeight / 2) - size['height']/2;					   if (size['width'] == 'max')   {  	size['width'] = parseInt(document.body.clientWidth) - 6;	size['left'] = 3;	  }  if (size['height'] == 'max')     {  	size['height'] = (document.documentElement || document.body).scrollTop +  					 ((document.documentElement || document.body).clientHeight) - 2;	size['top'] = 1;  }  size['left'] = parseInt(size['left']);    size['top'] = parseInt(size['top']);  size['width'] = parseInt(size['width']);  size['height'] = parseInt(size['height']);  					    SetElemStyle(div,"font-size:12px; position:fixed; top:" + size['top'] + "px; left:" + size['left'] + "px; width:"+               size['width'] + "px; height: "+ size['height'] + "px; border: solid black 1px;" + 			   " border-left: solid #0054e3 1px; border-right:  solid #0054e3 1px; border-bottom:  solid #0054e3 1px; "+			   " border-top: none;");  div.style.backgroundColor = DlgBkColor;    if ( isIE() )  	div.appendChild(ie);    	  if (formAction != null)  {  	 var form = document.createElement('form');	 form.id = "formID";	 form.name = "formID";	 form.type = 'form';	 form.method = "POST";	 form.enctype = "multipart/form-data";	 form.action = formAction;	 form.style.backgroundColor = DlgBkColor;	 	 div.appendChild(form);   }     //stworz belke panelu  var belka = document.createElement('div');  belka.className = 'belka';      SetElemStyle(belka,'position:absolute; width:' + size['width'] + 'px; height:25px; top:0px; margin-top:0px;');    var divpom = document.createElement('div');  SetElemStyle(divpom,"color:white; display:inline; float:left; text-align:left; height:23px; line-height: 23px; margin-left:3px; font-weight:bold; font-size:14px;");  divpom.appendChild(document.createTextNode(opis));  belka.appendChild(divpom);      div.appendChild(belka);	//dodaj belke do panelu          if ( !isIE() && !isOpera() )  {  	//uczyn ja przesuwalna  	//dragContainerInit(belka);  }    //stworz przycisk zamykajacy panel  var item = document.createElement("img");  item.src= "public/images/cms/exit.gif";    SetElemStyle(item,"width:20px; height:23px; display:inline; float:right; cursor:pointer;");   item.onclick = CloseDialog;     belka.appendChild(item);	//dodaj belke do panelu    //stworz, spozycjonuj i dodaj przycisk OK   var btn_ok = document.createElement("button");    SetElemStyle(btn_ok,"position: absolute; top: " + (size['height'] - 29) + "px; left: " + (size['width'] - 135) +"px; width:60px; height:22px;");  btn_ok.setAttribute("id","BTN_OK");  btn_ok.appendChild(document.createTextNode("OK"));  div.appendChild(btn_ok);     //stwórz, spozycjonuj i dodaj przycisk Cancel  var btn_anuluj = document.createElement("button");  SetElemStyle(btn_anuluj,"position: absolute; top: " + (size['height'] - 29) + "px; left: " + (size['width'] - 67) +"px; width:60px; height:22px;");  btn_anuluj.setAttribute("id","BTN_CANCEL");  btn_anuluj.appendChild(document.createTextNode("Anuluj"));  btn_anuluj.onclick = CloseDialog;  div.appendChild(btn_anuluj);    if (parent != null)    	parent.appendChild( div );  else  	document.body.appendChild( div );    return div;}//----------------------------------------------------------------------------------////	Pomocnicze funkcje ułatwiające operacje na dialogach////----------------------------------------------------------------------------------/** funkcja tworzy na podstawie czterech intów tablicę asocjacyjną postaci tab['left'] = left itd. *  * @param {int} left - wspołrzędna x lewego górnego rogu * @param {int} top - wspołrzędna y lewego górnego rogu * @param {int} width - długość pola * @param {int} height - szerokosc polo * @return {Object} - tablica asocjacyjna  */function GetSize(left, top, width, height){	var tab = { 'left' : left, 'top' : top, 'width' : width, 'height' : height };		return tab; }/** funkcja zwraca długość elementu wyrażoną w pixelach *  * @param {DOMElem} elem  - elent którego długość chcemy poznać * @return {int} - długość elementu */function getElemWidth(elem){		var width = elem.offsetWidth || elem.style.pixelWidth;	if (width == undefined)	{		for (var j=0; j<document.styleSheets.length; j++)				for (var i=0; i<document.styleSheets[j]['cssRules'].length; i++)				if (document.styleSheets[j]['cssRules'][i]['selectorText'] == '.'+elem.className)													width = parseInt(document.styleSheets[j]['cssRules'][i]['style'].width);						}			if (width == undefined)			width = 0;					return width;	}/** funkcja zwraca wysokość elementu wyrażoną w pixelach *  * @param {DOMElem} elem  - elent którego wysokość chcemy poznać * @return {int} - długość elementu */function getElemHeight(elem){			var height = elem.offsetHeight || elem.style.pixelHeight;	if (height == undefined && elem.className != '')	{		for (var j=0; j<document.styleSheets.length; j++)		{							      	PrintObject(document.styleSheets[j],1,1,70,true);			for (var i=0; i<document.styleSheets[j]['cssRules'].length; i++)				if (document.styleSheets[j]['cssRules'][i]['selectorText'] == '.'+elem.className)													height = parseInt(document.styleSheets[j]['cssRules'][i]['style'].height);					    	}	}		if (height == undefined)			height = 0;			return height;	}function getElemLeft(elem){		var left = elem.offsetLeft || elem.style.left;		if (left == undefined)		left = 0;		 			return  left;	}function getElemRight(elem){				return getElemLeft(elem) + getElemWidth(elem)	}function getElemTop(elem){	var top = elem.offsetTop || elem.style.top;		if (top == undefined)		top = 0;		 	return  top;}function getElemBottom(elem){	return  getElemTop(elem) + getElemHeight(elem);			}//funckja na podstawie tablicy asocjacyjnej param, wyszukuje w dialogu hDlg elementy //o nazwach odpowiadających indeksom tablicy a następnie przypisuje im wartość będącą //wartościa tablicy o danym indekcie.function SetDlgItemValues(hDlg, param){		//jeśli nie przekazano wartosci żadnych pól formularza nic nie rób 	if (param == 0)		return true;			var brak = "Nie znalazłem następujących pól formularza\n";		for (klucz in param)                {		   	//znajdz element o nazwie klucz i wpisz dla niego wartosc dane[klucz]   	//var elem = GetFirstDlgItemByName(hDlg, klucz);   		//if (elem == null)	//jesli nie znalazłeś eleementu wprost poszukaj z [] w celu znlezienia pola selct   			//elem = GetFirstDlgItemByName(hDlg, klucz+"[]");		var elem = getChildByName(hDlg,klucz);		if (elem == null)	//jesli nie znalazłeś eleementu wprost poszukaj z [] w celu znlezienia pola selct			elem = getChildByName(hDlg, klucz+"[]");   		   		if (elem != undefined)   		{ 			   			//zastosuj odpowiednią funkcję wpisująca w zależności od typu pola   			if (elem.type == 'text' || elem.type == 'password' || elem.type == 'textarea' ||			    elem.type == 'hidden') 			{				elem.value = param[klucz];			}			else if (elem.type == 'select-multiple') 			{				for (var i = 0; i < param[klucz].length; i++) 					if (!SelectList_isOptionInsideList(elem, param[klucz][i])) 						SelectList_AddOption(elem, param[klucz][i]);			}			else if (elem.type == 'select-one') 			{								SelectList_SelectOption(elem, param[klucz]);			}   			else if (elem.type == 'checkbox')			{				elem.checked = true;			}  			   		}   		else   			brak += "\n" +klucz;   			  		   		     	    }      }function CreateHideField(hDlg, nazwa, wartosc){	elem  = document.createElement('input');	elem.name = nazwa;	elem.type = 'hidden';	elem.value = wartosc;	elem.innerHTML = '<input type="hidden" name="' + name + '" value="'+wartosc+'" >';	hDlg.appendChild(elem); 	return elem;	}function GetCSSSize(left, top, width, height){	return "left:" + left + "px; top:" + top + "px; " + "width:" + width + "px; height:" + height + "px; ";}function CreateRadio(hDlg, left, top, width, height, id, value, opis, checked ){  	var uniqID = "radio" + id + RadioCount;	var Label = document.createElement("label");	if (Label == null)  		return;   	var check;  	checked == true ? check = 'checked="checked"' : check = '';  	Label.innerHTML = "<input type='radio' name='"+id+"' id='" + uniqID + "' value='" + opis + "' " + check + " >";  	Label.htmlFor = uniqID;  	Label.appendChild(document.createTextNode(opis));    	SetElemStyle(Label,"position:absolute; left:" + left + "px; top:" + top + "px; width:" + width +                       "px; height:" + height + "px;");    	hDlg.appendChild(Label);		  	RadioCount++; 	  	return Label; }function CreateCheckBox(hDlg, left, top, width, height, id, opis, checked){	var uniqID = "check" + id + CheckCount;	var Label = document.createElement("label");	if (Label == null)  		return;   	  	var check;  	checked == true ? check = 'checked="checked"' : check = '';  	Label.innerHTML = "<input type='checkbox' name='"+id+"' id='" + uniqID + "' value='" + opis + "' " + check + " >";  	Label.htmlFor = uniqID;  	Label.appendChild(document.createTextNode(opis));    	SetElemStyle(Label,"position:absolute; left:" + left + "px; top:" + top + "px; width:" + width +                       "px; height:" + height + "px;");    	hDlg.appendChild(Label);		  	CheckCount++;   	  	return Label;}  
