//var CMS_AdminHref = 'http://localhost:81/ZSO/Admin/';var CMS_AdminHref = 'http://lo1-kochanowski.pl/Admin/';function YUIerr(opis){			var YUIDialogError = document.getElementById('YUIDialogError');	if (YUIDialogError != null)				document.body.removeChild('YUIDialogError');		YUIDialogError = document.createElement('div');	YUIDialogError.id = 'YUIDialogError';	document.body.appendChild(YUIDialogError);			//stwórz panel edycji użytkownika	this.YUIpanelError = new YAHOO.widget.Dialog ( YUIDialogError, { visible : true, modal:true, close: true, fixedcenter:true } );				this.YUIpanelError.setHeader("Błąd");	this.YUIpanelError.setBody('' +							'	<table border="0" style="margin:5px;">' +			'		<tr><td style="vertical-align:top;"><div class="errormark"></div></td>' +			'		<td style="vertical-align:top;">' + 						opis +							'		</td></tr>' +			'		<tr><td colspan="2" style="text-align:center;">' + 						'<input id="submitBtnError" class="newsletterBtn" type="button" value="OK" />' + 							'		</td></tr>' +			'		<tr><td colspan="2">'+							'		</td></tr>'	+			'	</table>');				this.YUIpanelError.render();			function CloseDialogError(e) 	{ 					//zniszcz cały panel dodawania usera		this.YUIpanelError.destroy();		this.YUIpanelError = false;				//zniszcz diva zawierającego panel dodawania usera		var panelDiv = document.getElementById('YUIDialogError')		if (panelDiv != null)			document.body.removeChild(panelDiv);						return true;	};	function handleSubmitError(e, panel) 	{ 			panel.hide();		 	};	this.handleSubmitError = handleSubmitError;				//przechwyć zdarzenie zamyknia panelu newslettera	this.YUIpanelError.hideEvent.subscribe( CloseDialogError, this.YUIpanelError, this, true );						//pobierz przyciski zatwierdzania formularza			YAHOO.util.Event.addListener('submitBtnError', "click", this.handleSubmitError, this.YUIpanelError);							}function YUIinfo(opis){			var YUIDialogInfo = document.getElementById('YUIDialogInfo');	if (YUIDialogInfo != null)				document.body.removeChild('YUIDialogInfo');		YUIDialogInfo = document.createElement('div');	YUIDialogInfo.id = 'YUIDialogInfo';	document.body.appendChild(YUIDialogInfo);			//stwórz panel edycji użytkownika	this.YUIpanelInfo = new YAHOO.widget.SimpleDialog ( YUIDialogInfo, { visible : true, modal:true, close: true, fixedcenter:true } );				this.YUIpanelInfo.setHeader("Informacja");	this.YUIpanelInfo.setBody('' +							'	<table border="0" style="margin:5px;">' +			'		<tr><td style="vertical-align:top;"><div class="infomark"></div></td>' +			'		<td style="vertical-align:top;">' + 						opis +							'		</td></tr>' +			'		<tr><td colspan="2" style="text-align:center;">' + 						'<input id="submitBtnInfo" class="newsletterBtn" type="button" value="OK" />' + 							'		</td></tr>' +			'		<tr><td colspan="2">'+							'		</td></tr>'	+			'	</table>');				this.YUIpanelInfo.render();			function CloseDialogInfo(e) 	{ 					//zniszcz cały panel dodawania usera		this.YUIpanelInfo.destroy();		this.YUIpanelInfo = false;				//zniszcz diva zawierającego panel dodawania usera		var panelDiv = document.getElementById('YUIDialogInfo')		if (panelDiv != null)			document.body.removeChild(panelDiv);						return true;	};	function handleSubmitInfo(e, panel) 	{ 			panel.hide();		 	};	this.handleSubmitInfo = handleSubmitInfo;				//przechwyć zdarzenie zamyknia panelu newslettera	this.YUIpanelInfo.hideEvent.subscribe( CloseDialogInfo, this.YUIpanelInfo, this, true );						//pobierz przyciski zatwierdzania formularza			YAHOO.util.Event.addListener('submitBtnInfo', "click", this.handleSubmitInfo, this.YUIpanelInfo);							}document.getElementsByClassName = function(cl) {	var retnode = [];		var myclass = new RegExp('\\b'+cl+'\\b');	var elem = document.getElementsByTagName('*');	for (var i = 0; i < elem.length; i++) 	{		var classes = elem[i].className;		if (myclass.test(classes)) 			retnode.push(elem[i]);	}	return retnode;};function EmbdedFlash(){	return "<script type=\"text/javascript\"> if (AC_FL_RunContent == 0) { alert(\"This page requires AC_RunActiveContent.js.\"); } else{AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '100','height', '100','base','public/flash/','src', 'public/flash/loader','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true','loop', 'true','wmode', 'transparent','devicefont', 'false','id', 'loader_wf','menu', 'true','bgcolor', '#ffffff','name', 'loader','allowFullScreen', 'false','movie', 'public/flash/loader','salign', '');}</script><noscript>Trwa zapisywanie. Proszę czekać....</noscript>"; }function CreateEditPanel(sender, left, top, minwidth, minheight, minmax){	//pobierz identyfikator rodzica wysyłanego elementu			var parent = sender.parent;	var width, height;			if (minmax == 'min') 	{		width = parseInt(parent.clientWidth - 2);		if (width < minwidth) 			width = minwidth;				height = parseInt(parent.clientHeight - 2);		if (height < minheight) 			height = minheight;	}	else if (minmax == 'max')	{		width = parseInt(parent.clientWidth - 2);		if (width > minwidth) 			width = minwidth;				height = parseInt(parent.clientHeight - 2);		if (height > minheight) 			height = minheight;	}	else	{		width = minwidth;		height = minheight;	}						//ukryj wszystkie przyciski klasy startEditButton	var edity = document.getElementsByClassName('startEditButton');		for (var i=0; i<edity.length; i++)		edity[i].style.display = 'none';				var belka =  document.createElement('div');	belka.className = 'menu_panel';	belka.id='editbelka';					var btn_Close = document.createElement('div');	btn_Close.className = 'menu_panel_button close';		belka.appendChild(btn_Close);		var btn_Ok = document.createElement('div');	btn_Ok.className = 'menu_panel_button ok';	belka.appendChild(btn_Ok);			var panel =  document.createElement('div');		SetElemStyle(panel, GetCSSSize(0, 25, width, height) );		 				//określ maxymalne położenie w pionie aby zmieścić na ekranie	maxtop = (document.documentElement||document.body).scrollTop + 			 ((document.documentElement||document.body).clientHeight - height - 20);		if (top > maxtop) 			top = maxtop - 5;	if (top < 0)		top = 0;				//określ maxymalne położenie w pionie aby zmieścić na ekranie	maxleft = (document.documentElement||document.body).scrollLeft + 			  ((document.documentElement||document.body).clientWidth - width - 5);		if (left > maxleft) 			left = maxleft - 5;	if (left < 0)		left = 0;											 	var div = document.createElement('div');			SetElemStyle(div,"position:absolute; background-color:"+ DlgBkColor+"; border: solid black 1px; z-index:3;" + 					 GetCSSSize(left, top, width, height + belka.style.height) );					 		div.appendChild(belka);	div.appendChild(panel);					btn_Close.onclick = function() 	{ 		sender.parent.style.display = 'block'; 		document.body.removeChild(div);		//pokaż wszystkie przyciski klasy startEditButton		var edity = document.getElementsByClassName('startEditButton');				for (var i=0; i<edity.length; i++)		   edity[i].style.display = 'block'; 	 				PageCount = 0;			};		btn_Ok.onclick = function()	{			document.getElementById('sendZmiany').submit();					document.body.removeChild(div);		//pokaż wszystkie przyciski klasy startEditButton		var edity = document.getElementsByClassName('startEditButton');				for (var i=0; i<edity.length; i++)		   edity[i].style.display = 'block'; 		   		sender.parent.style.display = 'block';				PageCount = 0;   }				var pudlo = new Pudlo();	pudlo.kontener = div;	pudlo.panel = panel;	pudlo.btnClose = btn_Close;	pudlo.btnOk = btn_Ok;			return pudlo;}//deklaracja obiektu Select List zawierajace dwa pola: Kontener (uchwyt na diva obejmującego listę i opis)//oraz Lista uchwyt na Liste Select function Pudlo(){	  this.kontener = null;  this.panel = null;  this.btnOk = null;  this.form = null;  this.btnClose = null;    }function getParam(id){	var param = document.getElementById('param' + id);				//var lang = document.getElementById('selectedLanguage').value;		if (param && param.value != '') 	{				//dekodujParam('');		//alert(param.value);		//alert(Base64.decode(param.value));		//alert(unserialize(Base64.decode(param.value)));				param = unserialize(base64_decode(param.value));		dekodujRekurencyjnie(param);						//param[lang] != undefined ?  param = param[lang] : param = false; 				if (param) 							return param;			}	return false;}function dekodujRekurencyjnie(param){	//PrintObject(param,1,1,20,true);	for (prop in param)	{				if (typeof(param[prop]) == 'string')			param[prop] = utf8_decode(param[prop]);		else	if ((typeof(param[prop]) != 'number'))			{			//alert("prop = " + prop + "\ntyp = " + typeof(param[prop]));			dekodujRekurencyjnie(param[prop]);		}	}} function CreateFckInstance(nazwa, width, height, init){	var fck = new FCKeditor(nazwa, width+ "px", height+"px", 'dg', init);	fck.BasePath = CMS_AdminHref + "public/scripts/fckeditor/";	return fck;}//funkcja twory panel wyboru daty jako pierwszy parametr przekazujemy opis panelu, jako drugi unikalny identyfiaktor//pozwalająścy rozrożnić daty jeśli jest ich więcej niż jedna na jednym panelufunction getDynamicDataPanel(opis, uniqID, dzien, miesiac, rok){		var miesiace = ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj','Czerwiec',				    'Lipiec','Sierpień', 'Wrzesień','Październik','Listopad','Grudzień'];								var res = opis + '<br />';	res += '<select name="dzien'+uniqID+'" style="width:60px;" id="dzien'+uniqID+'" >';							for (var i=1; i<32; i++)					i == dzien ? res += '<option  selected="selected" >' + i + '</option>' :								 res += '<option>' + i + '</option>'; 				res += '</select>&nbsp;&nbsp;' +							   '<select name="miesiac'+uniqID+'" style="width:100px;" id="miesiac'+uniqID+'" >';				for (var i=0; i<12; i++)					miesiace[i] == miesiac ? res += '<option  selected="selected" >' + miesiace[i] + '</option>' :								 res += '<option>' + miesiace[i] + '</option>'; 			res += '</select>&nbsp;&nbsp;'+		   '<select name="rok'+uniqID+'" style="width:80px;" id="rok'+uniqID+'" >';		   		for (var i=2007; i<2026; i++)					i == rok ? res += '<option  selected="selected" >' + i + '</option>' :							   res += '<option>' + i + '</option>'; 			res += '</select>';							   	return res;			}function clearElem(sender,defValue){		if (sender.value == defValue)		sender.value = '';	}function restoreElem(sender, defValue){	if (sender.value == '')		sender.value = defValue;}function confirmFormularz(){	elem = document.getElementById('nazwisko_form');		if (elem.value == 'Imię i nazwisko')	{		alert('Wypełnij wszystkie pola oznaczone gwiazdką');		return false;	}		elem = document.getElementById('mail_form');		if (elem.value == 'E-mail')	{		alert('Wypełnij wszystkie pola oznaczone gwiazdką');				return false;	}			return true;}function confirmFormularzPolec(){	elem = document.getElementById('mail_znajomego');	if (elem.value == 'E-mail znajomego')	{		alert('Wypełnij wszystkie pola oznaczone gwiazdką');		return false;	}		elem = document.getElementById('mail_form');	if (elem.value == 'Twój e-mail')	{		alert('Wypełnij wszystkie pola oznaczone gwiazdką');				return false;	}			return true;}function GetEditButton (parent){    	poz = getPos(parent);		var div = document.createElement('div');		div.title = parent.id;	div.parent = parent;	 	div.className = 'startEditButton';	SetElemStyle(div, GetCSSSize(poz[0], poz[1], 10, 10));	document.body.appendChild(div);	return div;} function Print(obj){	PrintObject(obj,1,1,70,true);}function RozmiescEdity(id, page){	page == undefined ? page = '' : false;	var return2Panel = document.createElement('div');	return2Panel.className = 'mainCMSButton';		return2Panel.onclick = function() { location=page + 'Admin/index.php' }; 	document.body.appendChild(return2Panel);			var pozycje = document.getElementsByClassName('olowek')	for (i = 0; i < pozycje.length; i++) 	{				elem = GetNewEditButton(pozycje[i]);				elem.onclick = function(e) { CreateAutoEditField (this, id); };	}	} function CreateAutoEditField (sender, posID) {	var panel, opis, pageCount, parent;	var edytowane = new Array();					//tablica przechowująca wszystkie edytowane pozycje znajdujące się w obrębie panelu	var tab = new Array();							//tablica przechowująca elementy TABLE dla każdej z tworzonych stron kontrolki TabCtrl 															//indeksowana od 1 nie od 0 !! 												  		//pobierz parametry wywołania panelu z atrybutu class	var classParams = getAllOlowekClassParams(sender.parent.className,posID);		//PrintObject(classParams,1,1,70,true);			/*this.parent = document.createElement('div');	this.parent.id = 'panelDiv';	document.body.appendChild(this.parent);	*/	var elem = document.createElement('div');	elem.id = 'panelDiv';	document.body.appendChild(elem);				//spraw aby panel mieścił się na stronie (nie "wyjeżdżał" za ekran)	var x,y;		(parseInt(sender.offsetLeft) + parseInt(classParams.w)) > YAHOO.util.Dom.getClientWidth() ? 			x = parseInt(YAHOO.util.Dom.getClientWidth()) - parseInt(classParams.w) - 20 : x = sender.offsetLeft;				(parseInt(sender.offsetTop) + parseInt(classParams.h)) > YAHOO.util.Dom.getClientHeight() + YAHOO.util.Dom.getDocumentScrollTop() ? 			y = parseInt(YAHOO.util.Dom.getClientHeight() + YAHOO.util.Dom.getDocumentScrollTop()) - parseInt(classParams.h) - 20 : 			y = sender.offsetTop;						this.panel = new YAHOO.widget.Panel('panelDiv', { width: classParams.w+'px', height: classParams.h+'px',												 	  xy: [x, y], visible:false, modal: true,												 	  effect: { effect:YAHOO.widget.ContainerEffect.FADE, duration:0.6 } } );			classParams.desc != undefined && classParams.desc != '' ? opis = classParams.desc : opis='Panel edycyjny'; 		this.panel.setHeader(opis);	this.panel.setBody("");	this.panel.body.id = 'panelBody';	this.panel.setFooter(''+			'<div style="text-align:right; padding-bottom:5px;">'+				'<input id="panelBtnOk" class="newsletterBtn" style="margin-top:0px; cursor:pointer;" type="button" value="Ok">'+				'<input id="panelBtnCancel" class="newsletterBtn" style="margin-top:0px; cursor:pointer; margin-right:5px;" type="button" value="Anuluj">'+			'</div>');	this.panel.body.id = 'panelBody';			this.panel.render();		//akcja uruchamiana w momencie zamykania panelu Edycyjnego	function ClosePanel(e) 	{ 					//zniszcz cały panel newsleetera		this.panel.destroy();		this.panel = false;				//zniszcz diva zawierającego panel 		var div = document.getElementById('panelDiv');		if (div != null)			document.body.removeChild(div);						return true;	};			//funkcja odpalana w momencie kliknięcia przycisku ok 	function handleOkClick(e, panel) 	{		//odświerz fck edytora aby przkazał prawidłową zmienną do panelu					if (typeof(FCKeditorAPI) != 'undefined')		{						for (i in FCKeditorAPI.Instances)			{				//TODO fix this, it doesn't work.				if (FCKeditorAPI.Instances[i].IsDirty())					FCKeditorAPI.Instances[i].UpdateLinkedField();			}			delete i;		}		var form = document.getElementById('YUIForm');		form.submit();		};	//funckja odpala w momencie kliknięcia przycisku Anuluj	function handleCancelClick(e, panel) 	{						panel.hide();			};		//przechwyć zdarzenie zamyknia panelu edycujnego	this.panel.hideEvent.subscribe( ClosePanel, this.panel, this, true );		//przechwyć kliknięcia w przyciski	YAHOO.util.Event.addListener('panelBtnOk', "click", handleOkClick, this.panel);	YAHOO.util.Event.addListener('panelBtnCancel', "click", handleCancelClick, this.panel);			//stwórz wszystkie strony przypisane do danego panelu   	if (classParams['pageCount'] != 0)	{					//stwórz kontrolkę tabView		this.tabView = new YAHOO.widget.TabView();		//stwórz wszystkie strony kontrolki TabView		for (var i=1; i<=classParams['pageCount']; i++)		{			var contentPage = document.createElement('div');			this.parent.appendChild(contentPage);												var contentTable = document.createElement('table');						contentTable.id = 'panelTab' + i;			contentPage.appendChild(contentTable);						this.parent.appendChild(contentPage);			contentPage.style.height = parseInt(this.panel.body.clientHeight-45) + "px";			this.tabView.addTab( new YAHOO.widget.Tab({ label: classParams['page'+i], contentEl: contentPage, active: false }));		}				//przypisz tabelę do panelu		this.tabView.appendTo('panelBody');		this.tabView.selectTab(0);				}	else	{				var contentPage = document.createElement('div');		this.panel.body.appendChild(contentPage);		var contentForm = document.createElement('form');		contentForm.id = 'YUIForm';		var editID = document.createElement('input');		editID.type = 'hidden';		editID.name = 'id';		editID.value = posID;		contentForm.appendChild(editID);		contentForm.method = 'POST';		contentForm.action = 'Admin/index/upload';		contentPage.appendChild(contentForm);				var contentTable = document.createElement('table');				contentForm.appendChild(contentTable);		contentTable.id = 'panelTab0';							}					function getAllEditClassParams(className, parentID)	{		//rozbij nazwę klasy na poszczegolne pola		var tab = explode(' ',className);		//PrintObject(tab,1,1,70,true);				var res = new Array();				//ustaw wartosci domyślne dla wszystkich parametrów		res['type'] = 'error';		res['w'] = 0;		res['h'] = this.panel.body.clientHeight - 44;		res['unique'] = 'error';			res['desc'] = '';		res['posID'] = parentID;		res['clear'] = false;		res['sep'] = false;		res['page'] = false;		res['selCount'] = 0;		res['disable'] = false;		res['defaultValue'] = false;		res['available'] = false;		res['parents'] = false;				res['jsfunc'] = false;				for (var i=0; i<tab.length; i++)		{			tab[i].search('type_') > -1 ? res['type'] = tab[i].substr(5) : false;			tab[i].search('w_') > -1 ? res['w'] = tab[i].substr(2) : false;		 								tab[i].search('h_') > -1 ? res['h'] = tab[i].substr(2) : false;			tab[i].search('unique_') > -1 ? res['unique'] = tab[i].substr(7) : false;			tab[i].search('desc_') > -1 ? res['desc'] = str_replace('_',' ',tab[i].substr(5)) : false;			tab[i].search('posID_') > -1 ? res['posID'] = tab[i].substr(6) : false;			tab[i].search('clear_') > -1 ? res['clear'] = tab[i].substr(2) : false;			tab[i].search('sep_') > -1 ? res['sep'] = true : false;			tab[i].search('page_') > -1 ? res['page'] = tab[i].substr(5) : false;			tab[i].search('selCount_') > -1 ? res['selCount'] = tab[i].substr(9) : false;			tab[i].search('disable_') > -1 ? res['disable'] = explode(';',tab[i].substr(8)) : false;			tab[i].search('defaultValue_') > -1 ? res['defaultValue'] = explode(';',str_replace('~',' ',tab[i].substr(13))) : false;			tab[i].search('available_') > -1 ? res['available'] = explode(';',str_replace('~',' ',tab[i].substr(10))) : false;			tab[i].search('parents_') > -1 ? res['parents'] = explode(';',tab[i].substr(8)) : false;									tab[i].search('jsfunc_') > -1 ? res['jsfunc'] = tab[i].substr(7) : false;		}						res['available'][res['available'].length-1] == '' ? res['available'].length-- : false;					//jeśli zdefiniowano parametr selCount pobierz opisy wszystkich pozycji kontrolki select list		if (res['selCount']> 0 )			{			res['pos'] = new Array();			res['pos']['name'] = new Array();			res['pos']['select'] = new Array();			for (var i=0; i<tab.length; i++)						if (tab[i].search('pos::') > -1)				{					var pom = explode(':',tab[i].substr(5));					res['pos']['name'].push(str_replace('~',' ',pom[0]));					res['pos']['select'].push(pom[1]);								} 						}				//pobierz domyślne wartości z parametru defaultValue 		var ile = res['defaultValue'].length-1;		var pomTab = res['defaultValue'];		delete (res['defaultValue']);		res['defaultValue'] = new Array();		for (var i=0; i<ile; i++)		{			var pom = explode('=',pomTab[i]);			res['defaultValue'][pom[0]] =  str_replace('~',' ',pom[1]);					}								return res;	}	this.getAllEditClassParams = getAllEditClassParams;		getAllChildrenByClassName(sender.parent,'edit',edytowane);			//podziel wszystkie edity na odpowiednie strony tabView	function podzielNaStrony()	{		var editParamGroup = new Array;		for (var i = 0; i < edytowane.length; i++)		{						var editParam = this.getAllEditClassParams(edytowane[i].className, posID);						if (editParam['type'] == 'error' || editParam['unique'] == 'error')			{				this.panel.hide();				alert('Nie zdefiniowano typu i/lub unikalnego identyfikatora tworzonej pozycji. Skontaktuj się z autorem oprogramowania.');							return false;			}									if (editParam.page != undefined)			{								//jesli nie ma kontrolki tabView				if (editParam.page == false)				{										if ( editParamGroup[0] == undefined)						editParamGroup[0] = new Array;										editParamGroup[0].push(editParam);																		}				else				{									if ( editParamGroup[editParam.page] == undefined)														editParamGroup[editParam.page] = new Array;										editParamGroup[editParam.page].push(editParam);				}			}					}		return editParamGroup;	}	this.podzielNaStrony = podzielNaStrony;	editParamGroup = this.podzielNaStrony();			function getAsyncWartosci(param, successHandler, pomParentsID)	{					//pobierz położenie panelu nadżędnego aby wyśrodkować loader		var region = YAHOO.util.Dom.getRegion(param.panel.body);			var x = region.x + parseInt(region.width/2) - 120;		var y = region.y + parseInt(region.height/2) - 50;				//stwórz i wyświetl loader		this.Loader = new YAHOO.widget.Panel("wait", {width:"240px", close:false, modal:true, draggable:true, xy:[x,y] });			this.Loader.setBody('<img src="'+CMS_AdminHref+'public/scripts/js/YUI/images/rel_interstitial_loading.gif" />');		this.Loader.setHeader('Pobieram dane. Proszę czekać...');		this.Loader.render(document.body);		this.Loader.show();								//uchwyt na dane odsyłane przez serwer		var Handler = 		{			wsk: this,			param: param,			successHandler: successHandler,			success: function(response) 			{ 												this.wsk.Loader.hide();				if (response.responseText.substring(0,3) != 'err')				{											var wartosci;					if (response.responseText.substring(3).length != 0)					{												wartosci = unserialize(base64_decode(response.responseText.substring(3)));												dekodujRekurencyjnie(wartosci);											}					else						wartosci = '';																									for (index in wartosci)					{						//alert(wartosci[index]);						if (wartosci[index] != '' && wartosci[index] != null)						{							pom = unserialize(base64_decode(wartosci[index]));							dekodujRekurencyjnie(pom);														wartosci[index] = pom;						}					}					successHandler(param, wartosci);																} 				else				{										YUIerr(response.responseText.substring(4));					return false;				}			},			failure: function(response) 			{ 								this.wsk.Loader.hide();				YUIerr(response.responseText);				return false;			}					}		var cObj = YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/async', Handler, "fun=getDane&positionsID=" + implode(',',pomParentsID));	}	this.getAsyncWartosci = getAsyncWartosci;				for (var i=0; i<editParamGroup.length; i++)	{		try		{			/*przygotuj kod javascript dla tworzonej pozycji (wygodne poszukiwanie funkcji odpowiedzialnej za tworzenie pozycji, 			//poniewaz ma ona taką nazwę jak parametr typ tworzonej pozycji )						//var func = editParam['type'] + ' ( editParam, this.panel );';						//wykonaj przygotowany kod						//eval(func);*/			function func(event, param, e) 			{									for (var j=0; j<param.editParam.length; j++)				{					try					{						var func = param.editParam[j]['type'] + ' ( param.editParam[j], param.panel );';																	eval(func);					}					catch (err)					{												YUIerr(err);					}				}			};			/* funkcja odpalana w momencie kiedy panel nie ma zakładek event  handler przesyła param w trzecim 			 * parasmetrze a nie w drugim jak dla tabView  */			function func2(event, notUse, param) 			{				//pobierz wszytskie występujące na panelu identyfikatory pozycji				var parentsID = new Array();				for (var j=0; j<param.editParam.length; j++)									parentsID.push(param.editParam[j].posID); 								var pomParentsID = parentsID.unique();																	function mamDane(param, wartosci)				{					for (var j=0; j<param.editParam.length; j++)					{						try						{							var func = param.editParam[j]['type'] + ' ( param.editParam[j], param.panel, wartosci );';							//alert(func);							eval(func);						}						catch (err)						{							Print(err);							//YUIerr(err);						}					}				}													getAsyncWartosci(param, mamDane, pomParentsID);																												/*for (var j=0; j<param.editParam.length; j++)				{					var func = param.editParam[j]['type'] + ' ( param.editParam[j], param.panel, wartosci );';																						eval(func);				}*/			};						if (this.tabView != undefined && this.tabView != false)			{				var tab = this.tabView.getTab(i);				if (tab != undefined)									tab.addListener('click', func, {editParam:editParamGroup[i+1], panel: this.panel});			}			else			{												this.panel.showEvent.subscribe(func2, {editParam:editParamGroup[0], panel: this.panel} );			}					}		catch (err)		{			//jesli coś poszlo nie tak w trakcie tworzenia pozycji komunikat o błądzie i koniec			this.panel.hide();			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 wyświetlić szczegłowe informacje o błędzie?';				 							confirm(message) ? PrintObject(err,1,1,100,true) : false;						return false;		}	}					this.panel.show();}function textarea(posID, classParam, hParent){			var td;		//pobierz dane opisujące tworzona pozycję 	var param = getParam(classParam['posID']);			//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];						td = CreateTableCol( hParent, null, true );	CreatePlainText(td,classParam['desc'], "margin-top:5px;" );	td = CreateTableCol (hParent,null,true);						CreateTextArea (td, null, 5, 20, name, param[classParam['unique']], 'width:'+(classParam['w']-4)+'px; height:'+classParam['h']+'px; margin-top:2px;')		classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false; }function edit(posID, classParam, hParent){	var td;	var param = getParam(classParam['posID']);		//PrintObject(param,1,1,20,true);		//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin-top:5px;");	td = CreateTableCol(hParent,null,true);						CreateInput('text',td,null, name, param[classParam['unique']], 'width:'+(classParam['w']-4)+'px; margin-top:2px;');		classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;}function fck(posID, classParam, hParent){	var td;	var param = getParam(classParam['posID']);			//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin-top:5px; margin-bottom:2px;");	td = CreateTableCol(hParent,null,true);				td.innerHTML = CreateFckInstance(name, classParam['w'], classParam['h'], param[classParam['unique']]).CreateHtml();			classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;}function img(posID, classParam, hParent){	var td, tr, tabPom, btn, select, tabSett, tabPom1, roundCheck, scaleCheck, pom, uniq;	var param = getParam(classParam['posID']);				//wyślij do serwerta prośbę o usunięcie tymczasowych plików z serwera które mogły zostać po wczśniejszych wywołaniach panelu 	//zamykanych przez krzyżyk lub Anuluj	var clearHandler = 	{					success: function(response) 		{ 			if (response.responseText == 'err')			{				alert('Nie udało się usunąć tymczasowych plików z serwera. Zaleca się zamknięcie\n' + '' +						'panelu edycyjnego przyciskiem Anuluj. jeśli problem będzie się powtarzał\n' + 						'skontaktuj się z autorem oprogramowania');			} 		},		failure: function(response) { alert('1111'); PrintObject(response,1,1,10,true); }				};				//YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asynccleartempimg', clearHandler, 'id='+posID+'&klucz='+classParam['unique']);							//stwórz wiersz opisu pozycji	td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin-top:3px;");		//stwórz wiersz z tablicę przycisków upload, wyślij i usuń 				td = CreateTableCol(hParent,null,true);			tabPom = CreateTable(td,null,'',false);	 	//stworz klucz kontrolny informujący o wystąpienieu obrazka	CreateInput('hidden',td,null,'control_' + classParam['posID'] + '_' + classParam['unique'],'img');					//wiersz przycisków	tr = CreateTableRow(tabPom,null,'');			//komórka selektora plików 							td = CreateTableCol(tr,null,false,' height:22px; width:202px;');		td.colSpan = 2;				CreateInput('file',td,null,'file_' + classParam['unique'],null,'width:242px; height:20px;');		//komórka przycisku upload 													td = CreateTableCol(tr,null,false,'width:70px; height:22px;');		if (isIE())			btn = CreateInput('button', td, null, '', 'wyślij', 'width:70px; height:22px;');		else			btn = CreateInput('button', td, null, '', 'wyślij', 'width:70px; height:22px; margin-left:5px;');		btn.viewDiv = classParam['unique'] + 'image_view';		//zapamiataj unikalny identyfikator diva w ktorym wyswietlimy obraz po załadowaniu			btn.onclick = function()		{									var uploadHandler = 			{					viewDiv: this.viewDiv,				upload: function(response) 				{														responseText = unserialize(Base64.decode(response.responseText));								responseText.ok.length = count(responseText.ok);					responseText.err.length = count(responseText.err);								var err = '';					for (var j=0; j<responseText.err.length; j++)						err +=  (j+1) + " - " + responseText.err[j] + "\r\n";									err != '' ? alert('W trakcie uploadu plików wystąpił(-y) następujące błędy :' + "\r\n" + err + " ") : false; 								if (responseText.ok.length > 0)					{																		var elem = document.getElementById(this.viewDiv);						elem.innerHTML = '<img src="'+responseText.ok[0]+'" style="width:40px; height:40px;" alt="" />';															}				}						};						YAHOO.util.Connect.setForm('formID_upload',true);										YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncuploadfile', uploadHandler, 'sender=simpleImage&unique='+classParam['unique']+'&id='+classParam['posID']);					};		//przycisk USUń					td = CreateTableCol(tr,null,false,'width:70px; height:22px;');		btn = CreateInput('button',td,null,'','Usuń','width:70px;  height:22px; margin-left:5px;');		btn.viewDiv = classParam['unique'] + 'image_view';		//zapamiataj unikalny identyfikator diva w ktorym wyswietlimy obraz po załadowaniu		btn.onclick = function()		{			var deleteHandler = 			{					viewDiv: this.viewDiv,						success: function(response) 				{ 					if (response.responseText == 'err')					{						alert('Nie udało się usunąć wybranych plików z serwera. Zaleca się zamknięcie\n' + '' +								'panelu edycyjnego przyciskiem Anuluj. jeśli problem będzie się powtarzał\n' + 								'skontaktuj się z autorem oprogramowania');					} 					else					{						var elem = document.getElementById(this.viewDiv);						elem.innerHTML = '<img src="" style="width:40px; height:40px;" alt="" />';					}					},				failure: function(response) { alert('2222'); PrintObject(response,1,1,10,true); }						};				if (confirm('Czy na pewno chcesz usunąć plik obrazu z serwera?'))					YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncdelimg', deleteHandler, 'id='+posID+'&klucz='+classParam['unique']);		}		//wiersz odstępu pomiędzy trzema przyciskami a obrazkiem 	td = CreateTableCol(tabPom,null,true,'height:7px;');	td.colSpan = 4;		//wiersz ustawień szczegółowych	td = CreateTableCol(tabPom,null,true,'height:42px;');	td.colSpan = 4;	//tabela zawierająca ustawienia szczegłowe	tabSett = CreateTable(td,null,'height:42px;',false);	tr = CreateTableRow(tabSett,null,' height:42px;');		//komórka podglądu wrzuconego zdjęcia		td = CreateTableCol(tr,null,false,'background-color:white; height:42px; width:42px;');		pom = CreateDivField(td,classParam['unique']+'image_view','width:40px; height:40px; border: solid black 1px;');		pom.innerHTML = '<img src="'+getParamField(param,classParam['unique'])+'" style="width:40px; height:40px;" alt="" />';								//komórka skalowania	 	td = CreateTableCol(tr,null,false,'height:42px; width:195px; padding-left:5px;');	 		var tabPom1 = CreateTable(td, null, 'height:42px;', false);	 			 		td = CreateTableCol(tabPom1,null,true,'height:21px; width:200px; margin:0px; padding:0px;');	 			 		//checkbox Skalowania	 					uniq = classParam['unique']+'Scale';									//stwórz unikalny identyfikator dla checkbxu skalowania 			 		param[uniq] == 'on' ? select = true : select = false;	 		//sprawdź czy kliknięty czy nie	 			 		name = preparePostParam('value',classParam['posID'],uniq);		//stworz klucz dla tablicy POST 			 		scaleCheck = CreateCheckBoxEx(td, null, name, 'Skaluj rozmiar obrazu [szer x wys]:', select, '');	 		if (in_array('Scale',classParam['disable']))	 			scaleCheck.disabled = true;		 						 			 			 		 		//rozmiarX po skalowaniu 				 			 			 		 		td = CreateTableCol(tabPom1,null,true,'height:21px; width:200px; margin:0px; padding:0px;');	 		uniq = classParam['unique']+'SizeX';										//stwórz unikalny identyfikator dla RozmiaruX Skalowanego obrazu			name = preparePostParam('value',classParam['posID'],uniq);		//stworz klucz dla tablicy POST	 		pom = CreateInput('text', td, null, name, getParamField(param,uniq), 'width: 30px; display: inline;');	 			 		scaleCheck.input1 = pom;													//zapamiętaj pole powiązane z checkboxem scale	 		select == true ? pom.disabled = false : pom.disabled = true; 	 		CreatePlainText(td,'x','display:inline; margin: 0px 7px; line-height: 20px; height: 20px;');	 		if (in_array('SizeX',classParam['disable']))	 			pom.disabled = true;	 			 		//rozmiarY po skalowaniu	 		 	 		uniq = classParam['unique']+'SizeY';										//stwórz unikalny identyfikator dla RozmiaruY Skalowanego obrazu			name = preparePostParam('value',classParam['posID'],uniq);		//stworz klucz dla tablicy POST	 		pom = CreateInput('text', td, null, name, getParamField(param,uniq), 'width: 30px; display: inline;');	 		scaleCheck.input2 = pom;	 		select == true ? pom.disabled = false : pom.disabled = true;	 		scaleCheck.onclick = function() { this.input1.disabled = this.input2.disabled = !this.checked; }	 		if (in_array('SizeY',classParam['disable']))	 			pom.disabled = true;	 			 			 			 	//komórka zaokrąglania rogów	 	td = CreateTableCol(tr,null,false,'height:42px; width:150px;');		 		var tabPom1 = CreateTable(td, null, 'height:42px;', false);	 		 				 		td = CreateTableCol(tabPom1,null,true,'height:21px; width:150px; margin:0px; padding:0px;');	 			 		//checkbox zaokraglania rogów	 		uniq = classParam['unique']+'RoundCorners';									//stwórz unikalny identyfikator dla checkbxu zaokrąglania	 		param[uniq] == 'on' ? select = true : select = false;					//sprawdź czy kliknięty czy nie		 		name = preparePostParam('value',classParam['posID'],uniq);				//stworz klucz dla tablicy POST 	 		roundCheck = CreateCheckBoxEx(td, null, name, 'Zaokrąglaj rogi [promień]:', select, '');	 		 		td = CreateTableCol(tabPom1,null,true,'height:21px; width:150px; margin:0px; padding:0px;');		 		if (in_array('RoundCorners',classParam['disable']))	 			roundCheck.disabled = true;	 			 		//promień zaokrąglenia 			 		uniq = classParam['unique']+'Promien';										//stwórz unikalny identyfikator dla RozmiaruY Skalowanego obrazu			name = preparePostParam('value', classParam['posID'], uniq);		//stworz klucz dla tablicy POST	 		pom = CreateInput('text', td, null, name, getParamField(param,uniq), 'width:30px;');	 		roundCheck.input1 = pom;	 		select == true ? pom.disabled = false : pom.disabled = true;	 		if (in_array('Promien',classParam['disable']))	 			pom.disabled = true; 			 		roundCheck.onclick = function() { this.input1.disabled = !this.checked; }					//wiersz opisu obrazka 	td = CreateTableCol(hParent,null,true);	CreatePlainText(td,'Opis obrazka :',"margin-top:5px;");			td = CreateTableCol(hParent,null,true);		//stwórz unikalny identyfikator dla opisu obrazka jako sumę unikalnego opisu obrazka oraz słowa ImgDesc	var uniq = classParam['unique']+'ImgDesc';	var name = preparePostParam('value', classParam['posID'], uniq);	//stworz klucz dla tablicy POST	CreateInput('text', td, null, name, getParamField(param,uniq), 'width:'+(classParam['w']-6)+'px; margin-top:2px;');			//wstaw belkę separatora jesli jest ustawiona			classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;}function select(posID, classParam, hParent){		var td, selected;		var param = getParam(classParam['posID']);		//PrintObject(classParam,1,1,70,true);	//PrintObject(classParam,1,71,140,true);		//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"");	td = CreateTableCol(hParent,null,true);				var sel = CreateSelList(td,null,name,false,'width:'+classParam['w']+'px; margin-top:2px;');		//dodaj pozycje do kontrolki select	var res = '', tab = explode(' ',classParam);				for (var i=0; i<classParam['selCount']; i++)																				{																					classParam['pos']['select'][i] == 'true' ? selected = true : selected = false;		CreateSelListOption(sel, classParam['pos']['name'][i],selected);	}}function data(posID, classParam, hParent){	var tr, width, tab, dzien, miesiac, rok;		var miesiace = ['Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj','Czerwiec',				    	 'Lipiec','Sierpień', 'Wrzesień','Październik','Listopad','Grudzień'];					    	var param = getParam(classParam['posID']);		//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			tab = CreateTable(hParent,null,'',false);		tr = CreateTableRow(tab,null,'');	td = CreateTableCol(tr,null,false,'height:20px; width:45px;');	CreatePlainText(td,'Dzień:','');	td = CreateTableCol(tr,null,false,'height:20px; width:75px; padding-left:10px;');	CreatePlainText(td,'Miesiąc:','');	td = CreateTableCol(tr,null,false,'height:20px; width:60px; padding-left:10px;');	CreatePlainText(td,'Rok:','');		tr = CreateTableRow(tab,null,'');	td = CreateTableCol(tr,null,false,'height:20px; width:45px;');	dzien = CreateSelList(td,null, name+'Dzien', param[classParam['unique']+'Dzien'],false,'width:70px;');	td = CreateTableCol(tr,null,false,'height:20px; width:75px; padding-left:10px;');	miesiac = CreateSelList(td,null,name+'Miesiac', param[classParam['unique']+'Miesiac'],false,'width:150px;');	td = CreateTableCol(tr,null,false,'height:20px; width:60px; padding-left:10px;');	rok = CreateSelList(td,null,name+'Rok', param[classParam['unique']+'Rok'],false,'width:100px;');		//załaduj dane na wszystkie listy	for (var i=1; i<32; i++)		i == param[classParam['unique']+'Dzien'] ? CreateSelListOption(dzien,i,true) : CreateSelListOption(dzien,i,false);	for (var i=0; i<12; i++)		miesiace[i] == param[classParam['unique']+'Miesiac'] ? CreateSelListOption(miesiac,miesiace[i],true) : 				CreateSelListOption(miesiac,miesiace[i],false); 	for (var i=2007; i<2026; i++)		i == param[classParam['unique']+'Rok'] ? CreateSelListOption(rok,i,true) : CreateSelListOption(rok,i,false);	}function movie(posID, classParam, hParent){	var tr, td, tabPom, select, uniq, name;		//pobierz dane zawarte w bazie danych (tutaj nie odwołujemy się do bazy dane przygotowane wcześniej) dla danej pozycji	var param = getParam(classParam['posID']);		//przygotuj format klucza	name = 'value_' + classParam['posID'] + '_' + classParam['unique'];		td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin-top:5px; margin-bottom:2px;");	td = CreateTableCol(hParent,null,true);		//stworz klucz kontrolny informujący o wystąpienieu filmu	CreateInput('hidden',td,null,'control_' + classParam['posID'] + '_' + classParam['unique'], 'video');		tabPom = CreateTable(td,null,'',false);	//wiersz przycisków	tr = CreateTableRow(tabPom,null,'');		//komórka selektora plików 					td = CreateTableCol(tr,null,false,' height:22px;');		td.colSpan = 2;		CreateInput('file',td,null,'file_' + classParam['unique'],null,'width:242px; height:20px;');		//komórka przycisku upload 													td = CreateTableCol(tr,null,false,'width:70px; height:22px;');		btn = CreateInput('button', td, null, '', 'wyślij', 'width:70px; height:22px; margin-left:5px;');			btn.viewDiv = classParam['unique'] + 'opis';		//zapamiataj unikalny identyfikator diva w ktorym wyswietlimy obraz po załadowaniu			btn.onclick = function()		{								alert('Start uplaod');				var uploadHandler = 			{					viewDiv: this.viewDiv,				upload: function(response) 				{														responseText = unserialize(Base64.decode(response.responseText));								responseText.ok.length = count(responseText.ok);					responseText.err.length = count(responseText.err);								var err = '';					for (var j=0; j<responseText.err.length; j++)						err +=  (j+1) + " - " + responseText.err[j] + "\r\n";									err != '' ? alert('W trakcie uploadu plików wystąpił(-y) następujące błędy :' + "\r\n" + err + " ") : false; 								if (responseText.ok.length > 0)					{																													var elem = document.getElementById(this.viewDiv);						pom = explode('/',responseText.ok[0]);						elem.innerHTML = 'Aktualnie wybrany film : ' + pom[pom.length-1];											}				}						};						YAHOO.util.Connect.setForm('formID_upload',true);										YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncuploadfile', uploadHandler, 'sender=simpleVideo&unique='+classParam['unique']);					};		//przycisk USUń					td = CreateTableCol(tr,null,false,'width:70px; height:22px;');		btn = CreateInput('button',td,null,'','Usuń','width:70px;  height:22px; margin-left:5px;');		btn.viewDiv = classParam['unique'] + 'opis';		//zapamiataj unikalny identyfikator diva w ktorym wyswietlimy obraz po załadowaniu		btn.onclick = function()		{			var deleteHandler = 			{					viewDiv: this.viewDiv,						success: function(response) 				{ 					if (response.responseText == 'err')					{						alert('Nie udało się usunąć wybranych plików z serwera. Zaleca się zamknięcie\n' + '' +								'panelu edycyjnego przyciskiem Anuluj. jeśli problem będzie się powtarzał\n' + 								'skontaktuj się z autorem oprogramowania');					} 					else					{						var elem = document.getElementById(this.viewDiv);						pom = explode()						elem.value = 'Aktualnie wybrany film : brak';					}					},				failure: function(response) { alert('3333'); PrintObject(response,1,1,10,true); }						};				if (confirm('Czy na pewno chcesz usunąć plik obrazu z serwera?'))					YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncdelimg', deleteHandler, 'id='+posID+'&klucz='+classParam['unique']);		}		//wiersz odstępu pomiędzy trzema przyciskami a obrazkiem 	td = CreateTableCol(tabPom,null,true,'height:3px;');	td.colSpan = 4;	td = CreateTableCol(tabPom,null,true,'');	td.colSpan = 4;	pom = explode('/',param[classParam['unique']]);		if(pom != null)			pom = CreatePlainText(td,'Aktualnie wybrany film : ' + pom[pom.length-1],'margin-left:3px; color:#999999;');	else		pom = CreatePlainText(td,'Aktualnie wybrany film : brak' ,'margin-left:3px; color:#999999;');			pom.id = classParam['unique'] + 'opis';		td = CreateTableCol(tabPom,null,true,'');	td.colSpan = 4;	uniq = classParam['unique']+'AutoPlay';	param[uniq] == 'on' ? select = true : select = false;	 		//sprawdź czy kliknięty czy nie	name = preparePostParam('value', classParam['posID'], uniq);	//stworz klucz dla tablicy POST	CreateCheckBoxEx(td, null, name, 'Rozpocznij wyświetlanie bezpośrednio po załadowaniu strony', select, '');		td = CreateTableCol(tabPom,null,true,'');	td.colSpan = 4;	uniq = classParam['unique']+'Rewind';	param[uniq] == 'on' ? select = true : select = false;	 		//sprawdź czy kliknięty czy nie	 	name = preparePostParam('value', classParam['posID'], uniq);	//stworz klucz dla tablicy POST	CreateCheckBoxEx(td,null,name,'Rozpocznij odtwarzanie od początku po zakończenu filmu', select,'');											//wstaw belkę separatora jesli jest ustawiona			classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;		//alert(hParent.parentNode.parentNode.parentNode.innerHTML);	}function podpozycje(posID, classParam, hParent){	var td, rodzaj, sort, ile, klucz, wszystkie;		//pobierz parametr wywołania panelu	var param = getParam(classParam['posID']);	//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			function allPosClick()	{		ile.readOnly = this.checked;		this.checked ? ile.style.backgroundColor = '#ebebe4' : ile.style.backgroundColor = 'white'; 		this.checked ? ile.style.color = 'gray' : ile.style.color = 'black';	}		//przygotuj klucz kontrolny informujący o 	CreateInput('hidden',hParent,null,'control_' + classParam['posID'] + '_' + classParam['unique'],'podpozycje');		//PrintObject(param,1,1,70,false);		/*td = CreateTableCol(hParent,null,true,'height:10px; text-align:left;');	CreatePlainText(td,classParam['desc'],'color: #318be8; display:inline; float:left; text-decoration:underline; margin-bottom:3px;');		td = CreateTableCol(hParent,null,true,'');	CreatePlainText(td,'Wybierz sposób wyświetlania podpozycji','margin-top:3px; margin-bottom:2px;');	name = preparePostParam('value',classParam['posID'],classParam['unique']+'tryb');	rodzaj = CreateSelList(td,null,name,false,'width:'+classParam['w']+'px; ');	CreateSelListOption(rodzaj,'Małe panele', param[classParam['unique']+'tryb'] == 'Małe panele');	CreateSelListOption(rodzaj,'Średnie panele', param[classParam['unique']+'tryb'] == 'Średnie panele');	CreateSelListOption(rodzaj,'Duże panele', param[classParam['unique']+'tryb'] == 'Duże panele');*/				td = CreateTableCol(hParent,null,true,'');	CreatePlainText(td,'Wybierz klucz sortowania','margin-top:3px; margin-bottom:2px;');	name = preparePostParam('value',classParam['posID'],classParam['unique']+'klucz');	klucz = CreateSelList(td,null,name,false,'width:'+classParam['w']+'px; ');	CreateSelListOption(klucz,'Wg kolejności w panelu', param[classParam['unique']+'klucz'] == 'Wg kolejności w panelu');	CreateSelListOption(klucz,'Wg daty dodania', param[classParam['unique']+'klucz'] == 'Wg daty dodania');	CreateSelListOption(klucz,'Wg nazwy', param[classParam['unique']+'klucz'] == 'Wg nazwy');		param[classParam['unique']+''] == ''		td = CreateTableCol(hParent,null,true,'');	CreatePlainText(td,'Wybierz kierunek sortowania','margin-top:3px; margin-bottom:2px;');	name = preparePostParam('value',classParam['posID'],classParam['unique']+'sort');	sort = CreateSelList(td,null,name,false,'width:'+classParam['w']+'px; ');		CreateSelListOption(sort,'Rosnąco', param[classParam['unique']+'sort'] == 'Rosnąco');	CreateSelListOption(sort,'Malejąco', param[classParam['unique']+'sort'] == 'Malejąco');	CreateSelListOption(sort,'Losowo', param[classParam['unique']+'sort'] == 'Losowo');		td = CreateTableCol(hParent,null,true,'');	CreatePlainText(td,'Ile pozycji chcesz wyświetlić','margin-top:3px; margin-bottom:2px;');	name = preparePostParam('value',classParam['posID'],classParam['unique']+'ile');				param[classParam['unique']+'allPos'] != undefined && param[classParam['unique']+'allPos'] == 'on' ? wszystkie = true : wszystkie = false;		param[classParam['unique']+'ile'] != undefined ? value = param[classParam['unique']+'ile'] : value = '';	ile = CreateInput('text',td,null,name,value,'width:100px;');	ile.disabled = wszystkie;		td = CreateTableCol(hParent,null,true,'');	name = preparePostParam('value',classParam['posID'],classParam['unique']+'allPos');				allPos = CreateCheckBoxEx(td,null, name,'Wyświetl wszystkie',wszystkie,'margin-top:2px;');	allPos.onclick = allPosClick;			}function galeria(posID, classParam, hParent){	//pomocnicze narzedzie do wyłączania i włączania elementów	var enable = 	{			on: function(tab) 		{			for (var i=0; i<tab.length; i++)			{				tab[i].nodeName != 'DIV' ? tab[i].style.backgroundColor = 'white' : false;				tab[i].style.color = 'black';				tab[i].readOnly = false;			}		},		off: function(tab)		{						for (var i=0; i<tab.length; i++)			{				tab[i].nodeName != 'DIV' ? tab[i].style.backgroundColor = '#ebebe4' : false;				tab[i].style.color = 'gray';				tab[i].readOnly = true;			}		}	};	//funkcja przywraca domyślne ustawienia obrazka	var restoreDefault = function()	{		//przewróć domyślne ustawienia dla wszystkich pozycji		classParam['defaultValue']['opis'] != undefined ? opis.value = classParam['defaultValue']['opis'] : opis.value = '';		classParam['defaultValue']['adres'] != undefined ? adres.value = classParam['defaultValue']['adres'] : adres.value = '';						classParam['defaultValue']['orgX'] != undefined ? orgX.value = classParam['defaultValue']['orgX'] : orgX.value = '';		classParam['defaultValue']['orgY'] != undefined ? orgY.value = classParam['defaultValue']['orgY'] : orgY.value = '';		classParam['defaultValue']['orgR'] != undefined ? orgR.value = classParam['defaultValue']['orgR'] : orgR.value = '';		classParam['defaultValue']['minX'] != undefined ? minX.value = classParam['defaultValue']['minX'] : minX.value = '';		classParam['defaultValue']['minY'] != undefined ? minY.value = classParam['defaultValue']['minY'] : minY.value = '';		classParam['defaultValue']['minR'] != undefined ? minR.value = classParam['defaultValue']['minR'] : minR.value = '';		if (classParam['defaultValue']['tryb'] != undefined)		{			tryb1.checked = (classParam['defaultValue']['tryb'] == tryb1.value);			tryb2.checked = (classParam['defaultValue']['tryb'] == tryb2.value);			tryb3.checked = (classParam['defaultValue']['tryb'] == tryb3.value);			tryb4.checked = (classParam['defaultValue']['tryb'] == tryb4.value);			tryb5.checked = (classParam['defaultValue']['tryb'] == tryb5.value);			tryb6.checked = (classParam['defaultValue']['tryb'] == tryb6.value);		}		orgScale.checked = (classParam['defaultValue']['orgScale'] == 'checked');		orgScale.checked == true && orgScale.readOnly == false ? enable.on( Array(orgX, orgY, orgRazy, orgJM) ) : enable.off( Array(orgX, orgY, orgRazy, orgJM));		minScale.checked = (classParam['defaultValue']['minScale'] == 'checked');		minScale.checked == true && minScale.readOnly == false  ? enable.on( Array(minX, minY, minRazy, minJM) ) : enable.off( Array(minX, minY, minRazy, minJM));		orgRound.checked = (classParam['defaultValue']['orgRound'] == 'checked');		orgRound.checked == true && orgRound.readOnly == false  ? enable.on( Array(orgR, orgRJM) ) : enable.off( Array(orgR,orgRJM));		minRound.checked = (classParam['defaultValue']['minRound'] == 'checked');		minRound.checked == true && minRound.readOnly == false  ? enable.on( Array(minR, minRJM) ) : enable.off( Array(minR, minRJM));	}	var tr, td, pom, btn, file, orgX, orgY, orgR, minX, minY, minR, minJM, minRazy, minRJM, orgScale, orgRazy, orgJM, orgRJM;	var btnSend, name, value, imgField, style, value ,btnDelete, btnZmien;	var param = getParam(classParam['posID']);		//PrintObject(classParam,1,1,20,true);	//stworz klucz kontrolny informujący o wystąpienieu obrazka		//blok wysylania i usuwania plikow	pom = CreateTableCol(hParent,null,true); 	var tab1 = CreateTable(pom, null, 'width:100%;', false);	tr = CreateTableRow(tab1,null,'');	td = CreateTableCol(tr,null,false,'height:10px;');	td.align='right';	td.colSpan = 2;	var tab2 = CreateTable(td, null, 'text-align:right; width:100%;', false);	tr = CreateTableRow(tab2,null,'');	td = CreateTableCol(tr,null,false,'height:10px; text-align:left;');	CreatePlainText(td,"Wybierz i wyślij obrazek",'color: #318be8; display:inline; float:left; text-decoration:underline; margin-bottom:3px;');	//stwórz klucz kontrolny informujący o wystąpieniu galerii	CreateInput('hidden',td,null,'control_' + classParam['posID'] + '_' + classParam['unique'],'galeria');	td = CreateTableCol(tr,null,false,'height:10px; text-align:right;');	in_array('enable',classParam['disable']) ? style="color:#aaaaaa;" : style="color:black;";	CreatePlainText(td,'Włącz moduł galerii',style);	td = CreateTableCol(tr,null,false,'height:10px; width:13px; text-align:right;');		//name = preparePostParam('value',classParam['posID'],unique);	//var enableCheck = CreateCheckBoxEx(td,null,name+'enable','',false,'margin-left:3px;');		name = preparePostParam('value',classParam['posID'],classParam['unique']+'enable');	if (classParam[name] != undefined)									classParam['defaultValue']['enable'] != undefined && classParam['defaultValue']['enable'] == 'checked' ? value = true : value = false;	else		param[classParam['unique']+'enable'] == 'on' ? value = true : value = false;	var enableCheck = CreateCheckBoxEx(td, null, name, '', value, 'margin-left:3px;');	if (in_array('enable',classParam['disable']))				enableCheck.readOnly = true;	enableCheck.onclick = function()	{		if (this.readOnly )			return false;	}			enableCheck.style.marginRight = '0px';	td = CreateTableCol(tab1,null,true,'height:10px; height:3px;');				tr = CreateTableRow(tab1,null,'');	td = CreateTableCol(tr,null,false,'width:180px;');	file = CreateInput('file',td,null,'file_' + classParam['unique'],'','height:22px;');	file.size="55";		td = CreateTableCol(tr,null,false,'');	btnSend = CreateInput('button',td,null,"send",'Wyślij','width:70px; margin-left:5px;');	btnSend.disabled = true;		file.btnSend = btnSend;	//przekaz przycisk wysyłnia do wnętrza funkcji onchange	file.onchange = function () 	{		//sprawdź poprawnosć rozszerzweia wybranego pliku		var pom = explode('.',this.value);		var ext = pom[pom.length-1];		if (ext != 'jpg' && ext != 'jpeg' && ext != 'gif' && ext != 'png' && ext != 'bmp')		{			alert('Nieprawidłowe rozszerzenie wybranego pliku.\nDopuszczalne rozszerzenia to: jpg, jpeg, bmp, png lub gif.');			this.value = '';			this.btnSend.disabled = true;			return false;		}				//włącz przycisk wysyłania obrazka		this.btnSend.disabled = false;	};								insertSeparator(hParent,classParam['w']);				pom = CreateTableCol(hParent,null,true); 	var tab2 = CreateTable(pom, null, 'width:'+classParam['w']+'px; margin-top:5px; height:70px;', false);	tr = CreateTableRow(tab2,null,'');		//blok powiekszania obrazow	td = CreateTableCol(tr,null,false,'vertical-align:top; width:180px;');		var tab = CreateTable(td, null, 'padding:0px; margin:0px;', false);		td = CreateTableCol(tab,null,true,'padding:0px; margin:0px;');		CreatePlainText(td,"Tryb powiększania miniatury:",'color: #318be8; text-decoration:underline;');			td = CreateTableCol(tab,null,true,'');		var unique = classParam['unique']+'tryb';				//stwórz unikalny identyfikator dla radiobuttonów trybu powiekszania				name = preparePostParam('value',classParam['posID'],unique);		in_array('tryb',classParam['disable']) ? style="color:gray; " : style = "color:black";		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'Light Box' ? value = true : value = false;		var tryb1 = CreateRadioEx(td, null, name, "Light Box", value, 'margin-left:7px; margin-top:3px;' + style);		td = CreateTableCol(tab,null,true);		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'Gray Box' ? value = true : value = false;		var tryb2 = CreateRadioEx(td, null, name, "Gray Box", value, 'margin-left:7px;' + style);		td = CreateTableCol(tab,null,true);		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'okno przeglądarki (to samo)' ? value = true : value = false;		var tryb3 = CreateRadioEx(td, null, name, "okno przeglądarki (to samo)", value, 'margin-left:7px;' + style);		td = CreateTableCol(tab,null,true,'height:10px;');		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'okno przeglądarki (nowe)' ? value = true : value = false;		var tryb4 = CreateRadioEx(td, null, name, "okno przeglądarki (nowe)", false, 'margin-left:7px;' + style);		td = CreateTableCol(tab,null,true);		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'nie powiększaj' ? value = true : value = false;		var tryb5 = CreateRadioEx(td, null, name, "nie powiększaj", value, 'margin-left:7px;' + style);				td = CreateTableCol(tab,null,true);		classParam['defaultValue']['tryb'] != undefined && classParam['defaultValue']['tryb'] == 'zewnętrzny link' ? value = true : value = false;		var tryb6 = CreateRadioEx(td, null, name, "zewnętrzny link", value, 'margin-left:7px;' + style);				if (in_array('tryb',classParam['disable']))			tryb6.disabled = tryb1.disabled = tryb2.disabled = tryb3.disabled = tryb4.disabled = tryb5.disabled = true;				//blok skalowania o zaokrąglania dużych rozmiarow	td = CreateTableCol(tr,null,false,'vertical-align:top; width:180px;');		var tab = CreateTable(td, null, 'padding:0px; margin:0px;', false);		td = CreateTableCol(tab,null,true,'padding:0px; margin:0px;');		CreatePlainText(td,' Ustawienia obrazka ','color: #318be8; text-decoration:underline; margin-bottom:3px;');						td = CreateTableCol(tab,null,true,'padding:0px; margin:0px; height:20px;');				name = preparePostParam('value',classParam['posID'],classParam['unique']+'orgScale');								in_array('orgScale',classParam['disable']) ? style="color:#aaaaaa;" : style="color:black;";		classParam['defaultValue']['orgScale'] != undefined && classParam['defaultValue']['orgScale'] == 'checked' ? value = true : value = false;		orgScale = CreateCheckBoxEx(td, null, name, 'Skaluj rozmiar [szer x wys]:', value, style);		if (in_array('orgScale',classParam['disable']))			 		orgScale.readOnly = true;	 		 										td = CreateTableCol(tab,null,true,'height:20px;');					name = preparePostParam('value',classParam['posID'],classParam['unique']+'orgX');			classParam['defaultValue']['orgX'] != undefined ? value = classParam['defaultValue']['orgX'] : value = '';					orgX = CreateInput('text', td, null, name, value, 'width:40px; border: solid 1px #7f9db9');					orgRazy = CreatePlainText(td,'x','margin:0px 5px; text-align: center; display:inline;');			name = preparePostParam('value',classParam['posID'],classParam['unique']+'orgY');			classParam['defaultValue']['orgY'] != undefined ? value = classParam['defaultValue']['orgY'] : value = '';				orgY = CreateInput('text', td, null, name, value, 'width:40px; display:inline; border: solid 1px #7f9db9');							orgJM = CreatePlainText(td,'[pixele]','display:inline; margin-left:5px;');							orgScale.checked == true && orgScale.readOnly == false ? enable.on( Array(orgX, orgY, orgRazy, orgJM) ) : enable.off( Array(orgX, orgY, orgRazy, orgJM));		orgScale.onclick = function()		{			if (this.readOnly )				return false;			this.checked == true ? enable.on( Array(orgX, orgY, orgRazy, orgJM) ) : enable.off( Array(orgX, orgY, orgRazy, orgJM));					}						td = CreateTableCol(tab,null,true,'height:20px; ');		name = preparePostParam('value',classParam['posID'],classParam['unique']+'orgRound');		in_array('orgScale',classParam['disable']) ? style="color:#aaaaaa;" : style="color:black;";			orgRound = CreateCheckBoxEx(td, null, name, 'Zaokraglaj rogi [promien]:', false, style);		if (in_array('orgRound',classParam['disable']))			 		orgRound.readOnly = true;			td = CreateTableCol(tab,null,true,'');				name = preparePostParam('value',classParam['posID'],classParam['unique']+'orgR');		classParam['defaultValue']['orgR'] != undefined ? value = classParam['defaultValue']['orgR'] : value = '';				orgR = CreateInput('text', td, null, name, value, 'width:40px; display:inline; border: solid 1px #7f9db9;');		orgRJM = CreatePlainText(td,'[pixele]','display:inline; margin-left:5px;');				orgRound.checked == true  && orgRound.readOnly == false ? enable.on( Array(orgR, orgRJM) ) : enable.off( Array(orgR, orgRJM));		orgRound.onclick = function()		{			if (this.readOnly )				return false;			this.checked == true ? enable.on( Array(orgR, orgRJM) ) : enable.off( Array(orgR, orgRJM));					}									//blok skalowania miniatur	td = CreateTableCol(tr,null,false,'vertical-align:top; width:180px;');		var tab = CreateTable(td, null, 'padding:0px; margin:0px;', false);		td = CreateTableCol(tab,null,true,'padding:0px; margin:0px;');		CreatePlainText(td,' Ustawienia miniatury ','color: #318be8; text-decoration:underline; margin-bottom:3px;');		td = CreateTableCol(tab,null,true,'padding:0px; margin:0px; height:20px;');						name = preparePostParam('value',classParam['posID'],classParam['unique']+'minScale');			in_array('minScale',classParam['disable']) ? style="color:#aaaaaa;" : style="color:black;";		classParam['defaultValue']['minScale'] != undefined && classParam['defaultValue']['minScale'] == 'checked' ? value = true : value = false;		minScale = CreateCheckBoxEx(td, null, name, 'Skaluj rozmiar [szer x wys]:', value, style);		if (in_array('minScale',classParam['disable']))					minScale.readOnly = true;					td = CreateTableCol(tab,null,true,'height:20px;');					name = preparePostParam('value',classParam['posID'],classParam['unique']+'minX');			classParam['defaultValue']['minX'] != undefined ? value = classParam['defaultValue']['minX'] : value = '';						minX = CreateInput('text', td, null, name, value, 'width:40px; border: solid 1px #7f9db9');			minRazy = CreatePlainText(td,'x','margin:0px 5px; text-align: center; display:inline;');			name = preparePostParam('value',classParam['posID'],classParam['unique']+'minY');			classParam['defaultValue']['minY'] != undefined ? value = classParam['defaultValue']['minY'] : value = '';			minY = CreateInput('text', td, null, name, value, 'width:40px; display:inline; border: solid 1px #7f9db9');			minJM = CreatePlainText(td,'[pixele]','display:inline; margin-left:5px;');						minScale.chcecked == true && minScale.readOnly == false ? enable.on( Array(minX, minY, minRazy, minJM) ) : enable.off( Array(minX, minY, minRazy, minJM)); 		minScale.onclick = function()		{			if (this.readOnly )				return false;			this.checked == true ? enable.on( Array(minX, minY, minRazy, minJM) ) : enable.off( Array(minX, minY, minRazy, minJM));					}				td = CreateTableCol(tab,null,true,'height:20px;');			name = preparePostParam('value',classParam['posID'],classParam['unique']+'minRound');			in_array('minRound',classParam['disable']) ? style="color:#aaaaaa;" : style="color:black;";			minRound = CreateCheckBoxEx(td, null, name, 'Zaokraglaj rogi [promien]:', false, style);			if (in_array('minRound',classParam['disable']))			 			minRound.readOnly = true;				td = CreateTableCol(tab,null,true,'');			name = preparePostParam('value',classParam['posID'],classParam['unique']+'minR');				classParam['defaultValue']['minR'] != undefined ? value = classParam['defaultValue']['minR'] : value = '';				minR = CreateInput('text', td, null, name, value, 'width:40px; display:inline; border: solid 1px #7f9db9;');			minRJM = CreatePlainText(td,'[pixele]','display:inline; margin-left:5px;');							minRound.checked == true ? enable.on( Array(minR, minRJM) ) : enable.off( Array(minR, minRJM));		minRound.onclick = function()		{			if (this.readOnly )				return false;			this.checked == true ? enable.on( Array(minR, minRJM) ) : enable.off( Array(minR, minRJM));					}						//blok opisu obrazka	pom = CreateTableCol(hParent,null,true); 	var tab = CreateTable(pom, null, 'width:'+classParam['w']+'px; margin-top:5px; ', false);	td = CreateTableCol(tab,null,true,'vertical-align:top;');		CreatePlainText(td,"Opis obrazka",'color: #318be8; text-decoration:underline;');	td = CreateTableCol(tab,null,true,'');		name = preparePostParam('value',classParam['posID'],classParam['unique']+'opis');	classParam['defaultValue']['opis'] != undefined ? value = classParam['defaultValue']['opis'] : value = '';	var opis = CreateInput('text', td, null, name, value, 'width:98%; margin-top:3px;');	in_array('opis',classParam['disable']) ? opis.disabled = true : opis.disabled = false;			//blok adresu docelowego obrazka	pom = CreateTableCol(hParent,null,true); 	var tab = CreateTable(pom, null, 'width:'+classParam['w']+'px; margin-top:5px; ', false);	td = CreateTableCol(tab,null,true,'vertical-align:top;');		CreatePlainText(td,"Adres docelowy",'color: #318be8; text-decoration:underline;');	td = CreateTableCol(tab,null,true,'');		name = preparePostParam('value',classParam['posID'],classParam['unique']+'adres');	classParam['defaultValue']['adres'] != undefined ? value = classParam['defaultValue']['adres'] : value = '';	var adres = CreateInput('text', td, null, name, value, 'width:98%; margin-top:3px;');	in_array('adres',classParam['disable']) ? adres.disabled = true : adres.disabled = false;				insertSeparator(hParent,classParam['w']);		pom = CreateTableCol(hParent,null,true); 	var tab = CreateTable(pom, null, ' margin-top:5px;', false);	tr = CreateTableRow(tab,null,'');	td = CreateTableCol(tr,null,false,'vertical-align:bottom; width:170px;');	CreatePlainText(td,'Podgląd załadowanych obrazków.','color: #318be8; text-decoration: underline;');	td = CreateTableCol(tr,null,false,'vertical-align:top; width:75px;');	btnDelete = CreateInput('button',td,null,"send",'Usuń','width:70px; margin-left:5px; height:22px;');	btnDelete.disabled = true;	td = CreateTableCol(tr,null,false,'vertical-align:top;');	btnZmien = CreateInput('button',td,null,"send",'Zmień','width:70px; margin-left:5px; height:22px;');	btnZmien.disabled = true;		btnDelete.onclick = function()	{		if (!confirm('Czy na pewno chcesz usunąć wskazany obrazek?'))			return false;								var uploadHandler = 		{				idWybranego: this.idWybranego,			upload: function(response) 			{										if (response.responseText == 'ok')				{					var elem = document.getElementById(classParam['unique']+'img'+this.idWybranego);					var parent = elem.parentNode; 					elem.parentNode.removeChild(elem);										//przepisz obrazki wystepujące za usuniętym o jendą pozycję w prawo aby wypełnić luke po usunietym 					for (var i=parseInt(this.idWybranego)+1; i<parent.ile; i++)						{											document.getElementById(classParam['unique']+'img'+i).id = classParam['unique'] + 'img' + (i - 1);									param[classParam['unique']]['img'][i-1] = param[classParam['unique']]['img'][i];					}									parent.ile--;										 		 					btnDelete.disabled = btnZmien.disabled = true;					restoreDefault();				}				else				{					alert('Wystąpił błąd. Szczegółowy opis błędu:\n\n' + response.responseText)				}			}					}		YAHOO.util.Connect.setForm('formID_upload',true);											YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncgaleriadelete', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']+'&deletePos='+this.idWybranego);	}		btnZmien.onclick = function()	{		if (!confirm('Czy na pewno chcesz dokonać zmian wskazanego obrazka?'))			return false;								var uploadHandler = 		{				idWybranego: this.idWybranego,						upload: function(response) 			{										if (response.responseText == 'ok')				{					//dokonaj zmian w obrazku 									param[classParam['unique']]['img'][this.idWybranego]['orgScale'] = orgScale.checked;														param[classParam['unique']]['img'][this.idWybranego]['orgRound'] = orgRound.checked;					param[classParam['unique']]['img'][this.idWybranego]['minScale'] = minScale.checked;					param[classParam['unique']]['img'][this.idWybranego]['minRound'] = minRound.checked;					param[classParam['unique']]['img'][this.idWybranego]['orgX'] = orgX.value;					param[classParam['unique']]['img'][this.idWybranego]['orgY'] = orgY.value;					param[classParam['unique']]['img'][this.idWybranego]['orgR'] = orgR.value;					param[classParam['unique']]['img'][this.idWybranego]['minX'] = minX.value;					param[classParam['unique']]['img'][this.idWybranego]['minY'] = minY.value;					param[classParam['unique']]['img'][this.idWybranego]['minR'] = minR.value;					tryb1.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb1.value : false;					tryb2.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb2.value : false;					tryb3.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb3.value : false;					tryb4.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb4.value : false;					tryb5.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb5.value : false;					tryb6.checked ? param[classParam['unique']]['img'][this.idWybranego]['tryb'] = tryb6.value : false;																	param[classParam['unique']]['img'][this.idWybranego]['opis'] = opis.value;					param[classParam['unique']]['img'][this.idWybranego]['adres'] = adres.value;									}				else				{					alert('Wystąpił błąd. Szczegółowy opis błędu:\n\n' + response.responseText)				}			}					}		YAHOO.util.Connect.setForm('formID_upload',true);											YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncgaleriachange', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']+'&deletePos='+this.idWybranego);	}			td = CreateTableCol(hParent,null,true,'padding-top:0px; height:163px; vertical-align:top;');		imgField = CreateDivField(td,null,'margin-top:4px; padding-top:3px; height:160px; overflow:auto;');	imgField.klik = true;	imgField.ile = 0;		imgField.onclick = function()	{		if (this.klik == true)		{						for (var i=0; i<this.ile; i++)				setOpacity(document.getElementById(classParam['unique'] + 'img'+i),'1');						btnZmien.disabled = btnDelete.disabled = true;											}		//odblokuj propagację kliknięcia do okna rodzica		this.klik = true;		}						if (param[classParam['unique']] != undefined && param[classParam['unique']].count != undefined)	{		var ile = param[classParam['unique']]['count'];		for (var i=0; i<ile; i++)		{						//pobierz opis kolejnego obrazka			var pos = param[classParam['unique']]['img'][i];							var img = CreateDivField(imgField,classParam['unique'] + 'img'+i,'display:inline; float:left; border: solid black 1px; background-color:white; width:95px; height:67px; margin: 5px 5px;');			img.innerHTML = '<img src="'+pos["orgSrc"]+'" style="margin:1px 1px; width: 93px; height:65px;" alt=""/>';						img.onclick = function()			{								for (var i=0; i<this.parentNode.ile; i++)					setOpacity(document.getElementById(classParam['unique'] + 'img'+i),'1');				setOpacity(this,'0.5');				var id = this.id.substr(classParam['unique'].length + 3);												//odtwórz ustawienia obrazka						//PrintObject(param[classParam['unique']],1,1,50,true);										minScale.checked = param[classParam['unique']]['img'][id]['minScale'];				minScale.checked == true && minScale.readOnly == false ? enable.on( Array(minX, minY, minRazy, minJM) ) : enable.off( Array(minX, minY, minRazy, minJM));				minRound.checked = param[classParam['unique']]['img'][id]['minRound'];				minRound.checked == true && minRound.readOnly == false ? enable.on( Array(minR, minRJM) ) : enable.off( Array(minR, minRJM));																orgScale.checked = param[classParam['unique']]['img'][id]['orgScale'];				orgScale.checked == true && orgScale.readOnly == false ? enable.on( Array(orgX, orgY, orgRazy, orgJM) ) : enable.off( Array(orgX, orgY, orgRazy, orgJM));										orgRound.checked = param[classParam['unique']]['img'][id]['orgRound'];				orgRound.checked == true && orgRound.readOnly == false ? enable.on( Array(orgR, orgRJM) ) : enable.off( Array(orgR, orgRJM));								orgX.value = param[classParam['unique']]['img'][id]['orgX'];				orgY.value = param[classParam['unique']]['img'][id]['orgY'];				orgR.value = param[classParam['unique']]['img'][id]['orgR'];				minX.value = param[classParam['unique']]['img'][id]['minX'];				minY.value = param[classParam['unique']]['img'][id]['minY'];				minR.value = param[classParam['unique']]['img'][id]['minR'];						opis.value = param[classParam['unique']]['img'][id]['opis'];				adres.value = param[classParam['unique']]['img'][id]['adres'];				tryb1.checked = (tryb1.value == param[classParam['unique']]['img'][id]['tryb']);					tryb2.checked = (tryb2.value == param[classParam['unique']]['img'][id]['tryb']);				tryb3.checked = (tryb3.value == param[classParam['unique']]['img'][id]['tryb']);				tryb4.checked = (tryb4.value == param[classParam['unique']]['img'][id]['tryb']);				tryb5.checked = (tryb5.value == param[classParam['unique']]['img'][id]['tryb']);				tryb6.checked = (tryb6.value == param[classParam['unique']]['img'][id]['tryb']);								btnDelete.idWybranego = id;				btnDelete.disabled = false;				btnZmien.disabled = false;				btnZmien.idWybranego = id;												this.parentNode.klik = false;				}					}		imgField.ile = ile;			}			btnSend.onclick = function()	{		var uploadHandler = 		{								upload: function(response) 			{																				responseText = unserialize(Base64.decode(response.responseText));							responseText.ok.length = count(responseText.ok);				responseText.err.length = count(responseText.err);							var err = '';				for (var j=0; j<responseText.err.length; j++)					err +=  (j+1) + " - " + responseText.err[j] + "\r\n";								err != '' ? alert('W trakcie uploadu plików wystąpił(-y) następujące błędy :' + "\r\n" + err + " ") : false; 						if (responseText.ok.length > 0)				{																										var img = CreateDivField(imgField,classParam['unique']+'img'+imgField.ile,'display:inline; float:left; border: solid black 1px; background-color:white; width:95px; height:67px; margin: 5px 5px;');					img.innerHTML = '<img src="'+responseText.ok[0]+'" style="margin:1px 1px; width: 93px; height:65px;" alt=""/>';					//alert(img.innerHTML);										//dodaj opis obrazka do parametru param					var imgTab = new Array();					imgTab['id'] = imgField.ile;					imgTab['orgSrc'] = responseText.ok[0];					imgTab['minSrc'] = responseText.ok[0];					imgTab['orgScale'] = orgScale.checked;					imgTab['orgRound'] = orgRound.checked;					imgTab['minScale'] = minScale.checked;					imgTab['minRound'] = minRound.checked;					imgTab['orgX'] = orgX.value;					imgTab['orgY'] = orgY.value;					imgTab['orgR'] = orgR.value;					imgTab['minX'] = minX.value;					imgTab['minY'] = minY.value;					imgTab['minR'] = minR.value;					tryb1.checked ? imgTab['tryb'] = tryb1.value : false;					tryb2.checked ? imgTab['tryb'] = tryb2.value : false;					tryb3.checked ? imgTab['tryb'] = tryb3.value : false;					tryb4.checked ? imgTab['tryb'] = tryb4.value : false;					tryb5.checked ? imgTab['tryb'] = tryb5.value : false;					tryb6.checked ? imgTab['tryb'] = tryb6.value : false;					imgTab['opis'] = opis.value;					imgTab['adres'] = adres.value;					//dodaj utworzoną pozycję do listy wszystkich obrazków						if (imgField.ile == 0)					{						param[classParam['unique']] = new Array();						param[classParam['unique']]['count'] = 0;						param[classParam['unique']]['img'] = new Array();					}					param[classParam['unique']]['img'][imgField.ile] = imgTab;										 					imgField.ile++;					img.onclick= function()					{						for (var i=0; i<this.parentNode.ile; i++)							setOpacity(document.getElementById(classParam['unique']+'img'+i),'1');					setOpacity(this,'0.5');						var id = this.id.substr(classParam['unique'].length + 3);																		//odtwórz ustawienia obrazka						minScale.checked = param[classParam['unique']]['img'][id]['minScale'];						minScale.checked == true && minScale.readOnly == false ? enable.on( Array(minX, minY, minRazy, minJM) ) : enable.off( Array(minX, minY, minRazy, minJM));						minRound.checked = param[classParam['unique']]['img'][id]['minRound'];						minRound.checked == true && minRound.readOnly == false ? enable.on( Array(minR, minRJM) ) : enable.off( Array(minR, minRJM));						orgScale.checked = param[classParam['unique']]['img'][id]['orgScale'];						orgScale.checked == true && orgScale.readOnly == false ? enable.on( Array(orgX, orgY, orgRazy, orgJM) ) : enable.off( Array(orgX, orgY, orgRazy, orgJM));						orgRound.checked = param[classParam['unique']]['img'][id]['orgRound'];						orgRound.checked == true && orgRound.readOnly == false ? enable.on( Array(orgR, orgRJM) ) : enable.off( Array(orgR, orgRJM));						orgX.value = param[classParam['unique']]['img'][id]['orgX'];						orgY.value = param[classParam['unique']]['img'][id]['orgY'];						orgR.value = param[classParam['unique']]['img'][id]['orgR'];						minX.value = param[classParam['unique']]['img'][id]['minX'];						minY.value = param[classParam['unique']]['img'][id]['minY'];						minR.value = param[classParam['unique']]['img'][id]['minR'];						opis.value = param[classParam['unique']]['img'][id]['opis'];						adres.value = param[classParam['unique']]['img'][id]['adres'];						tryb1.checked = (tryb1.value == param[classParam['unique']]['img'][id]['tryb']);						tryb2.checked = (tryb2.value == param[classParam['unique']]['img'][id]['tryb']);						tryb3.checked = (tryb3.value == param[classParam['unique']]['img'][id]['tryb']);						tryb4.checked = (tryb4.value == param[classParam['unique']]['img'][id]['tryb']);						tryb5.checked = (tryb5.value == param[classParam['unique']]['img'][id]['tryb']);						tryb6.checked = (tryb6.value == param[classParam['unique']]['img'][id]['tryb']);												btnDelete.idWybranego = id;						btnDelete.disabled = false;						btnZmien.disabled = false;						btnZmien.idWybranego = id;						//zablokuj propagację kliknięcia do okna rodzica						this.parentNode.klik = false;					}				}			}		};		YAHOO.util.Connect.setForm('formID_upload',true);											YAHOO.util.Connect.asyncRequest('POST',CMS_AdminHref + 'index/asyncgaleriaupload', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']);			}	}function moduly(posID, classParam, hParent){	//PrintObject(classParam,1,1,20,true);	var td, selected, available, selected, tab, tr, leftBtn, rightBtn;		var param = getParam(classParam['posID']);		//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin:3px 0px; text-decoration:underline; color: #318be8;");	td = CreateTableCol(hParent,null,true);		tab = CreateTable(td,null,'width:'+classParam['w']+'px; ',false);		tr = CreateTableRow(tab,null,'');	//oblicz szerokość selectów	width = parseInt((classParam['w'] - 50) / 2) ;		td = CreateTableCol(tr,null,false,'vertical-align:top;');		CreatePlainText(td,'Wybrane:',"");					selected = CreateSelList(td,null,name,true,'width:'+width+'px; height:'+classParam['h']+'px; margin-top:2px; display:inline; float:left;');			var wybrane = explode(';',param[classParam['unique']+'Wybrane']);	if (wybrane)			wybrane[wybrane.length-1] == '' ? wybrane.length-- : false;				td = CreateTableCol(tr,null,false,'width:50px;');	leftBtn = CreateInput('button',td,null,"send",'<<','width:40px; display:block; margin:auto;');		rightBtn = CreateInput('button',td,null,"send",'>>','width:40px; display:block; margin:auto;');	leftBtn.disabled = rightBtn.disabled = true;		td = CreateTableCol(tr,null,false,'vertical-align:top;');	CreatePlainText(td,'Dostępne:','');		available = CreateSelList(td,null,name,true,'width:'+width+'px; height:'+classParam['h']+'px; margin-top:2px;');		CreateInput('hidden',td,name+'Wybrane',name+'Wybrane',param[classParam['unique']+'Wybrane'],'');		for (var i=0; i<classParam['available'].length; i++)			if (wybrane)		{			if (!in_array(classParam['available'][i],wybrane))				CreateSelListOption(available,classParam['available'][i],false);		}		else		{			CreateSelListOption(available,classParam['available'][i],false);				}		if (wybrane)				for (var i=0; i<wybrane.length; i++)			CreateSelListOption(selected,wybrane[i],false);			available.onchange = function()	{			this.selectedIndex == -1 ? leftBtn.disabled = true : leftBtn.disabled = false;				}	selected.onchange = function()	{			this.selectedIndex == -1 ? rightBtn.disabled = true : rightBtn.disabled = false;				}			leftBtn.onclick = function()	{		var elem = document.getElementById(name+'Wybrane');				while (available.selectedIndex != -1)		{			CreateSelListOption(selected,available.options[available.selectedIndex].text,false);			elem.value += available.options[available.selectedIndex].text + ';'			available.remove(available.selectedIndex);					}		available.selectedIndex == -1 ? leftBtn.disabled = true : leftBtn.disabled = false;		selected.selectedIndex == -1  ? rightBtn.disabled = true : rightBtn.disabled = false;				 	}			rightBtn.onclick = function()	{		var elem = document.getElementById(name+'Wybrane');		while (selected.selectedIndex != -1)		{			CreateSelListOption(available,selected.options[selected.selectedIndex].text,false);			elem.value = str_replace(selected.options[selected.selectedIndex].text + ';','',elem.value);			selected.remove(selected.selectedIndex);					}		available.selectedIndex == -1 ? leftBtn.disabled = true : leftBtn.disabled = false;		selected.selectedIndex == -1  ? rightBtn.disabled = true : rightBtn.disabled = false;	}				//wstaw belkę separatora jesli jest ustawiona			classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;}function Teleadresowe(posID, classParam, hParent){	var table, tr, td, width;	var param = getParam(classParam['posID']);		//przygotuj format klucza	var name = 'value_' + classParam['posID'] + '_' + classParam['unique'];			td = CreateTableCol(hParent,null,true);	CreatePlainText(td,classParam['desc'],"margin:3px 0px; text-decoration:underline; color: #318be8;");		table = CreateTable(hParent,null,'width:'+classParam['w']+'px;',false);		tr = CreateTableRow(table,null,'');	width = parseInt((classParam['w']*3/5)-1);	td = CreateTableCol(tr,null,false,'width:' + width + 'px;');	CreatePlainText(td,'Imię i nazwisko','');	CreateInput('text',td,null,name+'Nazwisko',param[classParam['unique']+'Nazwisko'],'width:'+ (width - 15) + 'px');		td = CreateTableCol(tr,null,false,'width:' + (classParam['w'] - width) + 'px;');	CreatePlainText(td,'Adres e-mail','');	CreateInput('text',td,null,name+'Adres',param[classParam['unique']+'Adres'],'width:' + ((classParam['w'] - width) - 15) + 'px;');		table = CreateTable(hParent,null,'width:'+classParam['w']+'px;',false);		tr = CreateTableRow(table,null,'');	width = parseInt((classParam['w']*1/3)-1);	td = CreateTableCol(tr,null,false,'width:' + width + 'px;');	CreatePlainText(td,'Telefon 1','');	CreateInput('text',td,null,name+'Tel1',param[classParam['unique']+'Tel1'],'width:'+ (width - 15) + 'px');	td = CreateTableCol(tr,null,false,'width:' + width + 'px;');	CreatePlainText(td,'Telefon 2','');	CreateInput('text',td,null,name+'Tel2',param[classParam['unique']+'Tel2'],'width:'+ (width - 15) + 'px');	td = CreateTableCol(tr,null,false,'width:' + width + 'px;');	CreatePlainText(td,'Telefon 3','');	CreateInput('text',td,null,name+'Tel3',param[classParam['unique']+'Tel3'],'width:'+ (width - 15) + 'px');			classParam['sep'] == true ?  insertSeparator(hParent,classParam['w']) : false;}function Linki(posID,classParam, hParent){	var table, tr, td, width, nazwa, cel, linkiSel, addBtn, delBtn, hiddenElem;				var param = getParam(classParam['posID']);			var Linki = new Array();		function delBtnClick()	{		if (linkiSel.selectedIndex == -1)		{			alert('Wskaz pozycję którą chcesz usunąć.');			return false;		}				Linki = deleteFromArray(Linki,linkiSel.selectedIndex);		linkiSel.remove(linkiSel.selectedIndex);				addBtn.value = 'Dodaj';		nazwa.value = cel.value = '';					var name = 'value_' + classParam['posID'] + '_' + classParam['unique']+'SerializeLinki';			var elem = document.getElementById(name);				elem.value = Base64.encode(serialize(Linki));	}	function addBtnClick()	{		if (nazwa.value == '' || cel.value == '')		{				alert('Nie podano nazwy lub adresu. Oba pola są wymagane.');			return false;		}				if (addBtn.value == 'Dodaj')		{			var link = new Object();			link.nazwa = Base64.encode(nazwa.value);			link.cel = cel.value;						Linki.push(link);					CreateSelListOption(linkiSel,nazwa.value,false);			nazwa.value = cel.value = '';		}		else		{			Linki[linkiSel.selectedIndex].nazwa = Base64.encode(nazwa.value);			Linki[linkiSel.selectedIndex].cel = cel.value;			linkiSel.options[linkiSel.selectedIndex].text = nazwa.value;			addBtn.value = 'Dodaj';			nazwa.value = cel.value = '';						for (var i=0; i<linkiSel.options.length; i++)				linkiSel.options[i].selected = false;					}					var name = 'value_' + classParam['posID'] + '_' + classParam['unique']+'SerializeLinki';			var elem = document.getElementById(name);								elem.value = Base64.encode(serialize(Linki));		}		function linkSelClick()	{		if (linkiSel.selectedIndex == -1)		{			addBtn.value = 'Dodaj';			nazwa.value = cel.value = '';		}		else		{			addBtn.value = 'Zmień';			nazwa.value = Base64.decode(Linki[linkiSel.selectedIndex].nazwa);			cel.value = Linki[linkiSel.selectedIndex].cel;		}	}		//przygotuj format klucza	td = CreateTableCol(hParent,null,true);		var name = 'control_' + classParam['posID'] + '_' + classParam['unique'];		CreateInput('hidden', td, null, name, 'Linki', '');			name = 'value_' + classParam['posID'] + '_' + classParam['unique'];	CreateInput('hidden', td, name+'SerializeLinki', name+'SerializeLinki', param[classParam['unique']+'SerializeLinki'], '');		if (param[classParam['unique']+'SerializeLinki'] != undefined)	   	var pom = Base64.decode(param[classParam['unique']+'SerializeLinki']);   		   else   	var pom = '';   	   //pom = '';   if (pom != '' && pom != false)      {    	   	var pomArray = unserialize(pom);   	pomArray.length = count(pomArray)-1;   }   else      {      	      	pomArray = new Array();   	   }      for (var i=0; i<pomArray.length; i++)   {   	var link = new Object();   	link.nazwa = pomArray[i].nazwa;    	link.cel = pomArray[i].cel;   	Linki.push(link);   }         	CreatePlainText(td,classParam['desc'],"margin:3px 0px; text-decoration:underline; color: #318be8;");		table = CreateTable(hParent,null,'width:'+classParam['w']+'px;',false);		tr = CreateTableRow(table,null,'');	width = 100;	td = CreateTableCol(tr,null,false,'width:' + width + 'px;');	CreatePlainText(td,'Ile kolumn','');	CreateInput('text',td,null,name+'IleKolumn',param[classParam['unique']+'IleKolumn'],'width:'+ (width - 15) + 'px');		td = CreateTableCol(tr,null,false,'width:' + (classParam['w'] - width) + 'px;');		td =  CreateTableCol(hParent,null,true,'width:' + classParam['w'] + 'px;');	CreatePlainText(td,'Zdefiniowane linki',' margin-top:3px;');	td =  CreateTableCol(hParent,null,true,'width:' + classParam['w'] + 'px;');	linkiSel = CreateSelList(td,null,name+'ZdefiniowaneLinki',true,'width:'+ classParam['w'] +'px; height:' + classParam['h'] + 'px;');	td =  CreateTableCol(hParent,null,true,'width:' + classParam['w'] + 'px;');	linkiSel.onclick = linkSelClick;	btnDel = CreateInput('button',td,null,name+'Delete','Usuń','margin-top:3px; margin-bottom:7px;  width:60px;');		btnDel.onclick = delBtnClick; 	td =  CreateTableCol(hParent,null,true,'width:' + classParam['w']+ 'px;');	CreatePlainText(td,'Opis linka','');	nazwa = CreateInput('text',td,null,name+'Nazwa','', 'width:' + (classParam['w']-4) + 'px;');		td =  CreateTableCol(hParent,null,true,'width:' + classParam['w'] + 'px;');	CreatePlainText(td,'Adres docelowy','');	cel = CreateInput('text',td,null,name+'Cel','', 'width:' + (classParam['w'] - 4) + 'px;');	td =  CreateTableCol(hParent,null,true,'width:' + classParam['w'] + 'px;');	addBtn = CreateInput('button',td,null,name+'Add','Dodaj','margin-top:3px; margin-bottom:7px; width:60px;');		addBtn.onclick = addBtnClick; 		for (var i=0; i< Linki.length; i++)		CreateSelListOption(linkiSel,Base64.decode(Linki[i].nazwa),false);		}function download(posID, classParam, hParent){	var btnSend, btnDel, filesList, file, tab, param, name, showSize, opis;		var param = getParam(classParam['posID']);			function listClick()	{			if (this.selectedIndex != -1)		{				param[classParam['unique']]['files'][this.selectedIndex]['showSize'] ? showSize.checked = true : showSize.checked = false;						opis.value = param[classParam['unique']]['files'][this.selectedIndex]['opis']; 			btnDel.disabled = btnSend.disabled = false;			btnSend.value = 'Zmień';		}		else		{			showSize.checked = true;			opis.value = ''; 			btnSend.disabled = true;			btnSend.value = 'Wyślij';		}  	}		function sendClick()	{		if (this.value == 'Wyślij')		{					var uploadHandler = 			{									upload: function(response) 				{																					responseText = unserialize(Base64.decode(response.responseText));								responseText.ok.length = count(responseText.ok);									responseText.err.length = count(responseText.err);																		var err = '';					for (var j=0; j<responseText.err.length; j++)						err +=  (j+1) + " - " + responseText.err[j] + "\r\n";									err != '' ? alert('W trakcie uploadu plików wystąpił(-y) następujące błędy :' + "\r\n" + err + " ") : false; 								if (responseText.ok.length > 0)					{																																					//dodaj opis obrazka do parametru param											var filesTab = new Array();						filesTab['id'] = filesList.options.length;						filesTab['src'] = responseText.ok[0];											filesTab['showSize'] = showSize.checked;															filesTab['opis'] = opis.value;												//dodaj utworzoną pozycję do listy wszystkich obrazków							if (filesList.options.length == 0)						{							param[classParam['unique']] = new Array();							param[classParam['unique']]['count'] = 0;							param[classParam['unique']]['files'] = new Array();												}										param[classParam['unique']]['files'][filesList.options.length] = filesTab;												CreateSelListOption(filesList, opis.value, false);					}				}						};							YAHOO.util.Connect.setForm('formID_upload',true);												YAHOO.util.Connect.asyncRequest('POST',CMS_AdminHref + 'index/asyncfileupload', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']);		}				if (this.value == 'Zmień')		{			if (!confirm('Czy na pewno chcesz dokonać zmian we wskazanym pliku?'))				return false;									var uploadHandler = 			{				idWybranego: filesList.selectedIndex,									upload: function(response) 				{											if (response.responseText == 'ok')					{						//dokonaj zmian w pliku 																param[classParam['unique']]['files'][this.idWybranego]['showSize'] = showSize.checked;												param[classParam['unique']]['files'][this.idWybranego]['opis'] = opis.value;							filesList.options[this.idWybranego].text = opis.value;															}					else					{						alert('Wystąpił błąd. Szczegółowy opis błędu:\n\n' + response.responseText)					}				}							}			YAHOO.util.Connect.setForm('formID_upload',true);												YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncfilechange', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']+'&changePos='+filesList.selectedIndex);		}					}		function deleteClick()	{				if (!confirm('Czy na pewno chcesz usunąć wskazany obrazek?'))			return false;								var uploadHandler = 		{				idWybranego: filesList.selectedIndex,			upload: function(response) 			{										if (response.responseText == 'ok')				{										filesList.remove(this.idWybranego);										//przepisz obrazki wystepujące za usuniętym o jendą pozycję w prawo aby wypełnić luke po usunietym 					for (var i=parseInt(this.idWybranego)+1; i<param[classParam['unique']]['count']; i++)																										param[classParam['unique']]['files'][i-1] = param[classParam['unique']]['files'][i];					param[classParam['unique']]['count']--;																								btnDel.disabled = btnSend.disabled = true;					btnSend.value='Wyślij';									}				else				{					alert('Wystąpił błąd. Szczegółowy opis błędu:\n\n' + response.responseText)				}			}					}		YAHOO.util.Connect.setForm('formID_upload',true);											YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncfiledelete', uploadHandler, 'unique='+classParam['unique']+'&id='+classParam['posID']+'&deletePos='+filesList.selectedIndex);	}		name = 'value_' + classParam['posID'] + '_' + classParam['unique'];		//stworz klucz kontrolny informujący o wystąpienieu obrazka	CreateInput('hidden',hParent,null,'control_' + classParam['posID'] + '_' + classParam['unique'],'download');		td = CreateTableCol(hParent,null,true,'height:10px; text-align:left;');	CreatePlainText(td,"Wybierz i wyślij plik na serwer",'color: #318be8; display:inline; float:left; text-decoration:underline; margin-bottom:3px;');		td = CreateTableCol(hParent,null,true,'');	tab = CreateTable(td,null,'',false);	tr = CreateTableRow(tab,null,'');	td = CreateTableCol(tr,null,false,'width:180px;');	file = CreateInput('file',td,null,"file_" +  classParam['unique'],'','height:22px;');	file.size="55";	file.onchange = function () { btnSend.disabled = (this.value == ''); }		td = CreateTableCol(tr,null,false,'');	btnSend = CreateInput('button',td,null,name + "send",'Wyślij','width:70px; margin-left:5px; height:23px;');	btnSend.disabled = true;	btnSend.onclick = sendClick;	td = CreateTableCol(hParent,null,true,'');   CreatePlainText(td,"Opis pliku :",'color: #318be8; display:inline; float:left; margin-bottom:3px; ');     td = CreateTableCol(hParent,null,true,'');	opis = CreateInput('text',td,null, name + 'opis' , '', 'width:'+(classParam['w']-4)+'px; margin-bottom:5px;');		td = CreateTableCol(hParent,null,true,'');	showSize = CreateCheckBoxEx(td,null,name+'showSize','Wyświetl rozmiar pliku na serwerze', true, '');			td = CreateTableCol(hParent,null,true,'');   CreatePlainText(td,"Lista załadowanych plików: :",'color: #318be8; display:inline; float:left; margin:3px 0px; ');	td = CreateTableCol(hParent,null,true,'');	filesList = CreateSelList(td,null,name + 'lista',true,'width:'+(classParam['w']-4)+'px; height:120px;');		filesList.onclick = listClick;		td = CreateTableCol(hParent,null,true,'');	btnDel = CreateInput('button',td,null,name + "delete",'Usuń wskazane pliki','width:140px; height:23px; margin-top:5px;');	btnDel.disabled = true;	btnDel.onclick = deleteClick;		insertSeparator(hParent,classParam['w']);		if (param[classParam['unique']] != undefined ) 		for (var i=0; i<param[classParam['unique']]['count']; i++)			CreateSelListOption(filesList, param[classParam['unique']]['files'][i]['opis'], false);		} /** * funkcja przygotowuje klucz dla tablicy POST do przekazania parametru wywołania panelu edycyjnego */function preparePostParam(type, posID, unique, extraparam){	//sprawdź prawidłowość typu tworzonej pozycji	if (type != 'value' && type != 'control')	{		alert('Niedozwololny typ klucza dla indeksu POST');		return '';	}		//sprawdź czy w parametr unique nie zawiera niedozwolonych znaków '_'		if (unique.search('_') > -1)	{		alert('Niedozwolony symbol \'_\' w  zmiennej unique. Skontaktuj się z autorem oprogramowania.');		return '';	}		//przygotuj początkowy fragment (bez extrapartam) parametru	var res = type + '_' + posID + '_' + unique;			//sprawdź czy podano extrapram		if (extraparam != undefined && extraparam != '' && extraparam != null)	{		//sprawdź czy extraparam nie zawiera niedozwolonych znaków '_'		if (extraparam.search('_') > -1)		{			alert('Niedozwolony symbol \'_\' w zmiennej extraparam. Skontaktuj się z autorem oprogramowania.'); 			return '';		}		//dodaj extraparam do parametru		res += '_' + extraparam;	}			return res;  }/** *  funkcja wstawia element separatora pomiędzy tworzonymi polami edycyjnymi */function insertSeparator(hParent, width){	var td = CreateTableCol(hParent,null,true,'width:' + width + 'px; height:10px;');	td = CreateTableCol(hParent,null,true,'width:' + width + 'px; height:2px; border-top:solid #dddddd 1px; border-bottom: solid #f0f0f0 1px; ');				CreateDivField(td,null,'width:' + width + 'px; height:0px; border-top:solid #cecece 1px; border-bottom: solid white 1px; overflow:auto;');}/**  * funkcja przygotowuje z parametru className tablicę asocjacyjną zawierającą wszystkie dane opisujące tworzony panel  *   */function getAllOlowekClassParams(className, posID){	var tab = explode(' ',className);	var res = new Array();		//ustaw wartości domyślne dla wszystkich parametrów	res['w'] = 400;	res['h'] = 300;	res['posID'] = posID;	res['desc'] = 'Edycja ustawień';	res['pageCount'] = 0;		//przeszukaj parametr classw poszukiwaniu dostepnych wartości	for (var i=0; i<tab.length; i++)	{				tab[i].search('w_') > -1 ? res['w'] = tab[i].substr(2) : false;		 							tab[i].search('h_') > -1 ? res['h'] = tab[i].substr(2) : false;				tab[i].search('desc_') > -1 ? res['desc'] = str_replace('_',' ',tab[i].substr(5)) : false;		tab[i].search('posID_') > -1 ? res['posID'] = tab[i].substr(6) : false;				tab[i].search('pageCount_') > -1 ? res['pageCount'] = tab[i].substr(10) : false;	}		//jeśli zdefiniowano parametr pageCount pobierz opisy wszystkich stron	for (var j=0; j<res['pageCount']; j++)			for (var i=0; i<tab.length; i++)		{					var serchStr = 'page' + ( j+1 ) + '_'; 			tab[i].search(serchStr) > -1 ? res['page'+(j+1)] = str_replace('~',' ',tab[i].substr(serchStr.length)) : false;		}		return res;	} /**  * funkcja przygotowuje z parametru className tablicę asocjacyjną zawierającą wszystkie dane opisujące tworzoną pozycję  *   */function getAllEditClassParams(className, hParent, parentID){			//rozbij nazwę klasy na poszczegolne pola	var tab = explode(' ',className);	var res = new Array();		//ustaw wartosci domyślne dla wszystkich parametrów	res['type'] = 'error';	res['w'] = getElemWidth(hParent);	res['h'] = getElemHeight(hParent);	res['unique'] = 'error';		res['desc'] = '';	res['posID'] = parentID;	res['clear'] = false;	res['sep'] = false;	res['page'] = false;	res['selCount'] = 0;	res['disable'] = false;	res['defaultValue'] = false;	res['available'] = false;	res['parent'] = false;				for (var i=0; i<tab.length; i++)	{		tab[i].search('type_') > -1 ? res['type'] = tab[i].substr(5) : false;		tab[i].search('w_') > -1 ? res['w'] = tab[i].substr(2) : false;		 							tab[i].search('h_') > -1 ? res['h'] = tab[i].substr(2) : false;		tab[i].search('unique_') > -1 ? res['unique'] = tab[i].substr(7) : false;		tab[i].search('desc_') > -1 ? res['desc'] = str_replace('_',' ',tab[i].substr(5)) : false;		tab[i].search('posID_') > -1 ? res['posID'] = tab[i].substr(6) : false;		tab[i].search('clear_') > -1 ? res['clear'] = tab[i].substr(2) : false;		tab[i].search('sep_') > -1 ? res['sep'] = true : false;		tab[i].search('page_') > -1 ? res['page'] = tab[i].substr(5) : false;		tab[i].search('selCount_') > -1 ? res['selCount'] = tab[i].substr(9) : false;		tab[i].search('disable_') > -1 ? res['disable'] = explode(';',tab[i].substr(8)) : false;		tab[i].search('defaultValue_') > -1 ? res['defaultValue'] = explode(';',str_replace('~',' ',tab[i].substr(13))) : false;		tab[i].search('available_') > -1 ? res['available'] = explode(';',str_replace('~',' ',tab[i].substr(10))) : false;				tab[i].search('parent_') > -1 ? res['parent'] = explode(';',tab[i].substr(7)) : false;			}			res['available'][res['available'].length-1] == '' ? res['available'].length-- : false;			//jeśli zdefiniowano parametr selCount pobierz opisy wszystkich pozycji kontrolki select list	if (res['selCount']> 0 )		{		res['pos'] = new Array();		res['pos']['name'] = new Array();		res['pos']['select'] = new Array();		for (var i=0; i<tab.length; i++)					if (tab[i].search('pos::') > -1)			{				var pom = explode(':',tab[i].substr(5));				res['pos']['name'].push(str_replace('~',' ',pom[0]));				res['pos']['select'].push(pom[1]);							} 					}		//pobierz domyślne wartości z parametru defaultValue 	var ile = res['defaultValue'].length-1;	var pomTab = res['defaultValue'];	delete (res['defaultValue']);	res['defaultValue'] = new Array();	for (var i=0; i<ile; i++)	{		var pom = explode('=',pomTab[i]);		res['defaultValue'][pom[0]] =  str_replace('~',' ',pom[1]);				}		return res;}function newGetEditField(posID, className, hParent){	var typ, name, opis, width, height, elem, td, elem, editID, retID, page, select;		//pobierz konfigurację elementu z klasy wywołania	type = getClassParam(className, 'type');	name = getClassParam(className, 'name');		desc =  str_replace('_',' ', getClassParam(className, 'desc'));	desc != '' ? desc += " :" : false; 	width = getClassParam(className, 'w');	width == '' ? width = getElemWidth(hParent) : false;	height = getClassParam(className, 'h');	height == '' ? height = getElemHeight(hParent) : false;	param = getParam(posID);		name += posID;			switch (type)	{		case 'fck' :						td = CreateTableCol(hParent,null,true);			CreatePlainText(td,desc,"margin-top:5px; margin-bottom:2px;");			td = CreateTableCol(hParent,null,true);						td.innerHTML = CreateFckInstance(name, width, height, getParamField(param,name)).CreateHtml();						break;					case 'textarea':			td = CreateTableCol(hParent,null,true);			CreatePlainText(td,desc,"margin-top:5px;");			td = CreateTableCol(hParent,null,true);								CreateTextArea(td,null,5,20,name,getParamField(param,name),'width:'+(width-4)+'px; height:'+height+'px; margin-top:2px;')			break;					case 'edit':			td = CreateTableCol(hParent,null,true);			CreatePlainText(td,desc,"margin-top:5px;");			td = CreateTableCol(hParent,null,true);								CreateInput('text',td,null,name,getParamField(param,name),'width:'+(width-4)+'px; margin-top:2px;');			break;					case 'select':					td = CreateTableCol(hParent,null,true);			CreatePlainText(td,desc,"");			td = CreateTableCol(hParent,null,true);						select = CreateSelList(td,null,name,false,'width:'+width+'px;');			//wydobądź z nazwy klasy pozycje do selecta			var res = '', tab = explode(' ',className);						for (var i=0; i<tab.length; i++)																							if (tab[i].search('pos::') > -1)				{						res = tab[i].substr(tab[i].search('pos::') + 5) //+5 dla pominięcia 'pos::'														var selected, pos = explode(':',res);										pos[1].search('true') > -1 ? selected = true : selected = false;					CreateSelListOption(select,str_replace('_',' ',pos[0]),selected);				}			break;					case 'img':																						break;					default :			break;	} 		//sprawdź czy dana pozycja ma osobne id jesli tak stwórz pole hidden informujące o tym	var id = getClassParam(className,'posID');	if (id != '')		CreateInput('hidden',hParent,null,'osobneID_' + name, id, '');		}function getEditField(typ, opis, name, posID, width, height, className, editID, parent){	var res = "";	var elem, td, tr;		var panel = parent; 		editID != '' ? posID = editID : false;		param = getParam(posID);			 	switch(typ)	{					case 'file':			td = CreateTableCol(parent,null,true);			CreatePlainText(td,"Wskaż plik do wysłania :","") 			td = CreateTableCol(parent,null,true);					CreateInputFileField(td, name+posID, 40, '');					break;			case 'select' :									td = CreateTableCol(parent,null,true);			CreatePlainText(td,opis + ' :',"");			td = CreateTableCol(parent,null,true);			elem = CreateSelList(td,null,name,false,'width:100%;');			elem.onchange = function() { wybierzTP(this.selectedIndex,name);};						var selectParam = getParam(name);			var ile = count(selectParam);			var selPos = str_replace('#',' ',getClassParam(className,'selectvalue'));			for (var i=0; i<ile; i++)							CreateSelListOption(elem,selectParam[i],selectParam[i] == selPos);						break;								case 'edit':			var uniqueID = getClassParam(className,'id');			uniqueID == '' ? uniqueID=posID : null;			td = CreateTableCol(parent,null,true);			CreatePlainText(td,opis + ' :',"");			td = CreateTableCol(parent,null,true);			CreateEditField(td,name + uniqueID, name + uniqueID, str_replace('"','&#34;',getParamField(param,name+uniqueID)), 'width:100%;');							break;					case 'fck' :			var fck_height = getClassParam(className,'h');			fck_height == '' ? fck_height = height-50  : false;							var uniqueID = getClassParam(className,'id');			uniqueID == '' ? uniqueID=posID : false;						td = CreateTableCol(parent,null,true);			CreatePlainText(td,opis + ' :',"");			td = CreateTableCol(parent,null,true);						elem = CreateDivField(td, null, 'overflow:auto; width:100%;');					elem.innerHTML = CreateFckInstance(name+uniqueID, '100%', fck_height, getParamField(param,name+uniqueID)).CreateHtml();					break;						case 'linki' :				    			var proc70 = ((width - 14) * 7/10) - 4;								var proc30 = ((width - 14) * 3/10) - 6;			var proc100 = (width - 14) - 4;									for (var i=1; i<6; i++)			{				tr = CreateElem('tr',parent,null,null,null,null);				td = CreateElem('td',tr,null,null,null,'width:'+proc70+'px;');					CreateElem('div',td,null,null,'Treść ' + i,'font-size:10px;');				td = CreateElem('td',tr,null,null,null,'width:'+proc30+'px; align:right');				CreateElem('div',td,null,null,'Przycisk ' +i,'font-size:10px;');								tr = CreateElem('tr',parent,null,null,null,null);											td = CreateElem('td',tr,null,null,null,'width:'+proc70+'px;');								CreateInput('text',td,null,name+'_tresc'+i,getParamField(param,name+'_tresc'+i),'width:'+proc70+'px;');					td = CreateElem('td',tr,null,null,null,'width:'+proc30+'px;');								elem = CreateInput('text',td,null,name+'_button'+i,getParamField(param,name+'_button'+i),'width:'+proc30+'px;');												tr = CreateElem('tr',parent,null,null,null,null);				td = CreateElem('td',tr,null,null,null,null);				td.colSpan=2;				CreateElem('div',td,null,null,'Link ' + i,'width:70%;  font-size:10px;');				tr = CreateElem('tr',parent,null,null,null,null);				if (i < 5)					td = CreateElem('td',tr,null,null,null,'padding-bottom:10px;');				else					td = CreateElem('td',tr,null,null,null,null);				td.colSpan=2;				CreateInput('text',td,null,name+'_link'+i,getParamField(param,name+'_link'+i),'width:'+proc100+'px; ');													}			break;									case 'img' : 			var img_height = getClassParam(className,'h');		img_height == '' ? img_height = parseInt(width*3/4) : false;		var img_width = getClassParam(className,'w');		img_width == '' ? img_width = parseInt(width*3/4) : false;				res = '<tr><td>'+opis+':<br /><input id="file" type="file" name="'+ name + posID + '" /></td></tr>' + 			  '<tr><td>Aktualnie wybrany obrazek<br /><div style="width:' + img_width + 'px; height:'+ img_height + 'px; border: solid black 1px;"> ' +			  ' <img src="public/upload/' + getParamField(param,name+posID) + '" style="width:'+img_width+'px; height:'+img_height+'px;" alt="" /> ' +			  ' </div></td></tr>';		break;								case 'textarea':		var textarea_height = getClassParam(className,'h');		textarea_height == '' ? fck_height = height-30  : false;		res = '<tr><td>'+opis+':<br /><textarea style="width:100%; height:'+textarea_height+'px;" name="'+ name + posID + '" >' + getParamField(param,name+posID) + '</textarea></td></tr>';		break;								case 'galeria' : 		res = '<tr><td >Dodaj nowy obrazek' +						  			  '<input id="file" size="43" type="file" name="file" />'+			  '</td></tr>' +		      '<tr><td>Obrazki dodane do galerii:<br /><select name="obrazki[]" style="width:380px;" multiple="multiple" id="imagesList" size="10">';		for (var i=0; i<tempgallery.length; i++ )			res += '<option>' + tempgallery[i][0] + '</option>';		res += '</select ></td></tr>' + 			   '<input type="hidden" name="galeria" value="galeria" />' +			   '<input type="button" value="Usuń zaznaczone" onclick="SelectList_DelSelectedOptions(document.getElementById(\'imagesList\')); return false;" style="margin-top:5px;" />';		break;								case 'data' :		var uniqueID = getClassParam(className,'id');		uniqueID == '' ? uniqueID=posID : false;		TPID = uniqueID; 				res += getDynamicDataPanel("Data zdarzenia :",uniqueID, getParamField(param,'dzien'+uniqueID),								   getParamField(param,'miesiac'+uniqueID) , getParamField(param,'rok'+uniqueID));					break;							case 'galeria_normal' : 		var ih = getClassParam(className,'h');		var iw = getClassParam(className,'w');				var size = GetSize(8, 30, width-(2*8), height-(2*30));				var page1 = CreateTabCtrlPage(panel, 'galeria', size);		var page2 = CreateTabCtrlPage(panel, 'ustawienia', size);				var style='display:inline; float:left; margin:10px 5px; border:solid black 1px; width:'+iw+'px; height:'+ih+'px;';		page1.innerHTML = '<div style="padding:8px 5px;">Wybierz plik i wyślij do galerii :<br /><input id="file" type="file" name="file" size="40" />' +			  '&nbsp;<input type="button" value="&nbsp;&nbsp;wyślij&nbsp;&nbsp;" id="uploadButton" onclick="funkcja_1();" />' +			  '&nbsp;<input type="button" value="&nbsp;&nbsp;Usuń&nbsp;&nbsp;" id="delButton" onclick="usunObrazek();" />' +			  '</div>'; 			  		for (var i=0; i<12; i++)		{			var img = getParamField(param,'hidden_obrazek'+i);						if (img == '')				page1.innerHTML +='<div style="'+style+'" id="obrazek'+i+'"></div><input type="hidden" id="hidden_obrazek'+i+'" name="hidden_obrazek'+i+'" value="" />';			else				page1.innerHTML +='<div style="'+style+'" id="obrazek'+i+'"> ' +				'<img src="'+img+'" style="width:100%; height:100%;" onclick="zaznacz('+i+');" alt="" />' +				'</div><input type="hidden" id="hidden_obrazek'+i+'" name="hidden_obrazek'+i+'" value="'+img+'" />';		}		page1.innerHTML += '<input type="hidden" name="galeria_normal" value="galeria" /></td></tr>'; 					var check;		//skalowanie obrazow		CreateGroupPanel(page2, 10, 10, 230, 100, 'Skalowanie obrazów' );		getParamField(param,'skalowanie_img_enable'+posID) == '1' ? check = true : check = false;				CreateCheckBox(page2, 220, 20, 20, 15, 'skalowanie_img_enable'+posID, '', check);				CreateInputField(page2, 20, 25, 40, 15, 'img_w'+posID, 'szer :', getParamField(param,'img_w'+posID) );				CreateDiv(page2, 70, 45, 20, 20, '').innerHTML = 'x';		CreateInputField(page2, 82, 25, 40, 15, 'img_h'+posID, 'wys :' , getParamField(param,'img_h'+posID));				getParamField(param,'skalowanie_img'+posID) == 'Do rozmiaru' ? check = true : check = false;				CreateRadio(page2, 130, 42, 100, 15, 'skalowanie_img'+posID, 'Do rozmiaru', 'Do rozmiaru', check );				CreateInputField(page2, 50, 68, 73, 15, 'img_wsp'+posID, 'współczynnik :', getParamField(param,'img_wsp'+posID) );		getParamField(param,'skalowanie_img'+posID) == 'Proporcjonalnie' ? check = true : check = false;		CreateRadio(page2, 130, 85, 100, 15, 'skalowanie_img'+posID, 'Proporcjonalnie', 'Proporcjonalnie', check );								//skolowniae miniatur		CreateGroupPanel(page2, 255, 10, 230, 100, 'Skalowanie miniatur' );		getParamField(param,'skalowanie_mini_enable'+posID) == '1' ? check = true : check = false;		CreateCheckBox(page2, 465, 20, 20, 15, 'skalowanie_mini_enable'+posID, '', check);				CreateInputField(page2, 265, 25, 40, 15, 'mini_w'+posID, 'szer :', getParamField(param,'mini_w'+posID) );		CreateDiv(page2, 315, 45, 20, 20, '').innerHTML = 'x';		CreateInputField(page2, 325, 25, 40, 15, 'mini_h'+posID, 'wys :',getParamField(param,'mini_h'+posID) );		getParamField(param,'skalowanie_mini'+posID) == 'Do rozmiaru' ? check = true : check = false;		CreateRadio(page2, 375, 40, 100, 15, 'skalowanie_mini'+posID, 'Do rozmiaru', 'Do rozmiaru', check );				CreateInputField(page2, 292, 68, 73, 15, 'mini_wsp'+posID, 'współczynnik :', getParamField(param,'mini_wsp'+posID) );		getParamField(param,'skalowanie_mini'+posID) == 'Proporcjonalnie' ? check = true : check = false;		CreateRadio(page2, 375, 85, 100, 15, 'skalowanie_mini'+posID, 'Proporcjonalnie', 'Proporcjonalnie', check );				CreateGroupPanel(page2, 10, 120, 230, 100, 'Tryb powiększania obrazów' );		getParamField(param,'tryb'+posID) == 'GreyBox' ? check = true : check = false;		CreateRadio(page2, 15, 135, 100, 15, 'tryb'+posID, 'GreyBox', 'GreyBox', check );		getParamField(param,'tryb'+posID) == 'LightBox' ? check = true : check = false;		CreateRadio(page2, 15, 155, 100, 15, 'tryb'+posID, 'LightBox', 'LightBox', check );		getParamField(param,'tryb'+posID) == 'To samo okno' ? check = true : check = false;		CreateRadio(page2, 15, 175, 100, 15, 'tryb'+posID, 'To samo okno', 'To samo okno', check );		getParamField(param,'tryb'+posID) == 'Nowe okno' ? check = true : check = false;		CreateRadio(page2, 15, 195, 100, 15, 'tryb'+posID, 'Nowe okno', 'Nowe okno', check );				CreateGroupPanel(page2, 255, 120, 230, 100, 'Zaokrąglanie rogów' );		CreateInputField(page2, 265, 137, 150, 15, 'mini_round'+posID, 'Promień dla miniatur:', getParamField(param,'mini_round'+posID) );		CreateInputField(page2, 265, 177, 150, 15, 'img_round'+posID, 'Promień dla obrazów:', getParamField(param,'img_round'+posID) );						ShowPage('page1');					break;						default: alert('Niezdefiniowane wejście ' + typ + '. Skontaktuj się z autorem oprogramowania.');		}}function zaznacz(num){	var sender = document.getElementById('obrazek'+num);	if (sender == undefined)		return false;		var element = sender.childNodes[1];		if (element.select == undefined)		element.select = true;	else if (element.select == true)		element.select = false;	else		element.select = true;		element.select == true ? setOpacity(element,0.5) : setOpacity(element,1); }function setOpacity( element, alpha ) {	var style = element.style;	if( style.MozOpacity != undefined ) 	{ 		//Moz and older		style.MozOpacity = alpha;	}	else if( style.filter != undefined )	{ 		//IE				style.filter = "alpha(opacity="+alpha * 100+")"			}	else if( style.opacity != undefined ) 	{ 		//Opera		style.opacity = alpha;	}}function usunObrazek(){	var ile = 0;	for (var i=0; i<12; i++)	{		var elem = document.getElementById('obrazek'+i);		var img = elem.childNodes[1];		if (img != undefined)			if (img.select == true)						ile++;	}			if (ile == 0)	{		alert('Nie zaznaczono zadnego obrazka');		return false;	}		if (confirm('Czy na pewno chcesz usunąć wszystkie zaznaczone obrazki ?'))	{		for (var i=0; i<12; i++)		{			var elem = document.getElementById('obrazek'+i);			var img = elem.childNodes[1];			if (img != undefined)				if (img.select == true)				{					elem.removeChild(img);					var hidden = document.getElementById('hidden_obrazek'+i);					hidden.value = '';					//elem.innerHTML = '';				}		}		}	}function funkcja_1(){			var uploadHandler = 	{		upload: function(response) 		{			var responseText = str_replace('../','',response.responseText);						responseText = unserialize(Base64.decode(responseText));						responseText.ok.length = count(responseText.ok);			responseText.err.length = count(responseText.err);						var err = '';			for (var j=0; j<responseText.err.length; j++)				err +=  (j+1) + " - " + responseText.err[j] + "\r\n";							err != '' ? alert('W trakcie uploadu plików wystąpił(-y) następujące błędy :' + "\r\n" + err + " ") : false; 						//PrintObject(responseText.ok,1,1,10,true);			for (var i=0; i<responseText.ok.length; i++)							for (var j=0; j<12; j++)				{					var elem = document.getElementById('obrazek'+j);										if (elem != undefined && (elem.innerHTML == '' || elem.innerHTML == ' '))					{							var x, y;						//pobierz rozmiary obrazów (-2 dla pominięcia border ) 						x = getElemWidth(elem) - 2;						y = getElemHeight(elem) - 2;						elem.innerHTML = '<img src="'+responseText.ok[i]+'" style="width:' + x + 'px; height:' + y + 'px;" alt="" />';						//elem.innerHTML = '<img src="C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/strona/public/upload/27/galeria/org/Lilie_wodne.jpg" style="width:' + x + 'px; height:' + y + 'px;" alt="" />';						//alert(elem.innerHTML);						var hidden = document.getElementById('hidden_obrazek'+j);											hidden.value=responseText.ok[i];						document.getElementById("file").value="";				    						break;														}				}					}	};	//YAHOO.util.Connect.setForm('sendZmiany', true);	//YAHOO.util.Connect.asyncRequest('POST', CMS_AdminHref + 'index/asyncuploadfile', uploadHandler);	}function getClassParam(className, param){	var tab = explode(' ',className);	var res = '';	for (var j=0; j<tab.length; j++)	{		//poszukaj typu pozycji						tab[j].search(param+'_') > -1 ? res = tab[j].substr(param.length+1): false; 						}	return res;}function getParamField(param, field){	var res = "";		var value = "param." + name+field + " == undefined ? res = '' : res = param." + name+field;			eval(value);			return res;}function GetNewEditButton (parent){			poz = getPos(parent);				var div = document.createElement('div');		div.title = "Rozpocznij edycję";		if (document.getElementById('edit' + parent.id) == null)		div.id = 'edit' + parent.id;	div.parent = parent;	 	div.className = 'startEditButton';	SetElemStyle(div, GetCSSSize(poz[0], poz[1], 10, 10));	document.body.appendChild(div);	return div;} function getAllChildrenByName(parent, name, result){	if (parent.name == name)		result.push(parent);		if (parent.childNodes != undefined &&  parent.childNodes.length != 0)				for (var i = 0; i < parent.childNodes.length; i++) 					getAllChildrenByName(parent.childNodes[i], name, result);											}function getAllChildrenByClassName(parent, klasa, result){	var myclass = new RegExp('\\b'+klasa+'\\b');	if (myclass.test(parent.className))		result.push(parent);				if (parent.childNodes != undefined &&  parent.childNodes.length != 0)				for (var i = 0; i < parent.childNodes.length; i++) 					getAllChildrenByClassName(parent.childNodes[i], klasa, result);											}  function gray() { 	 	CreateShadow();	//opcja dla dialogu loader		var load = document.getElementById('loader');	load.style.display = 'block' ;	load.style.position = "absolute";		load.style.zIndex = 1;	load.style.left = (document.body.clientWidth / 2) - 50 + "px";			load.style.top = (document.documentElement||document.body).scrollTop +	                 ((document.documentElement||document.body).clientHeight / 2)	                  - load.clientHeight + "px";		 		return false; }  var licznik = 0; var t;  function ustawieniagray(panel) { 	var cien = document.getElementById('shadow'); 	if (cien != null)	{				cien.style.opacity= '0.7';		cien.style.filter="Alpha(Opacity=70)";		cien.style.display = 'block';		cien.style.height = document.body.clientHeight + 'px';		cien.style.width = document.body.clientWidth + 'px';	}			if (panel != null)	{				panel.style.display = 'block';			panel.style.top = 100 + 'px' ;		panel.style.left = cien.offsetWidth/2 - panel.offsetWidth/2 + 'px';		panel.style.opacity= '0.01';		panel.style.filter="Alpha(Opacity=1)";			}	return false; }     function checkSend(){	var wybrano = false;	var Wybrani = document.getElementById('Wybrani');		for (i = Wybrani.length - 1; i>=0; i--)  	{		Wybrani.options[i].selected = true;		wybrano  = true;	}		if (wybrano == false)	{		alert('Wybierz przynajmniej jeden adres e-mail.');		return false;	}		//kontrola ustawien serwera SMTP	var settings = true;	var elem = document.getElementById("mail_smtp");	if (elem != false)	{		if (elem.value == '')			settings = false;		}	elem = document.getElementById("mail_adres");	if (elem != false)	{		if (elem.value == '')			settings = false;	}	elem = document.getElementById("mail_user");	if (elem != false)	{		if (elem.value == '')			settings = false;	}	elem = document.getElementById("mail_pass");	if (elem != false)	{		if (elem.value == '')			settings = false;		}		if (settings == false)	{		alert('Nie wprowadzono wszystkich danych konfiguracyjnych. Kliknij przycisk Ustawienia e-mail.');		return false;	}		gray();		return true;}var speed=1var currentpos=0; function scrollwindow(){   window.scroll(0,currentpos)} function setActualWindowPosition(){	currentpos=document.body.scrollTop;} function notgray() { 	var elem; 	 	 	elem = document.getElementById('loader'); 	if (elem != null)				elem.style.display = 'none';	elem = document.getElementById('shadow'); 	if (elem != null)				elem.style.display = 'none';			elem = document.getElementById('ustawienia_panel'); 	if (elem != null)				elem.style.display = 'none';			elem = document.getElementById('pageSettings'); 	if (elem != null)				elem.style.display = 'none';			elem = document.getElementById('kontenerSettings'); 	if (elem != null)				elem.style.display = 'none';			elem = document.getElementById('newsSettings'); 	if (elem != null)				elem.style.display = 'none';			elem = document.getElementById('EMailSet'); 	if (elem != null)				elem.style.display = 'none';				scrollwindow();	currentpos = 0;			//if ( !isIE() && !isOpera() )	//{		//wyszukaj wszystkie elementy klasy belka i uczyn je przesuwalnymi		//var draggables = document.getElementsByTagName('*');		//for(i=0;i<draggables.length;i++)	 		//if (draggables[i].className.match(/(^|\s)belka(\s|$)/))							//	dragContainerInit(draggables[i]);	//}						 }//funkcja wyświetla na dialogu stroną "kontrolki TabCtrl" o id przekazanym w zmiennej strona//pozostałe strony ukrywafunction ShowPage(strona) { 			//znajdz wybraną stroną	var page = document.getElementById(strona);	//znajdź rodzica wybranej strony	var panel = page.parentNode;			//jeśli nie znajdziesz chociaż jednej z pozycji zakończ	if (panel == null || page == null)		return false;			var button_id = 'page_button' + str_replace('page','',strona);	//przeglądaj po wszystkich dzieciach	for (var i=0; i < panel.childNodes.length; i++)	{		var elem = panel.childNodes[i];		if ( elem.className != null)		{			//ukryj wszystkie strony 			if (elem.className == "page")				elem.id == strona ? elem.style.display = "block" : elem.style.display = "none";								//wyświetl wszystkie przyciski jako normalne				if (elem.className.match(/(^|\s)przycisk(\s|$)/))				elem.id == button_id ? elem.className = "przycisk select" : elem.className = "przycisk normal";		}	}				return false;} function clearForm(){	if (!confirm('Czy na pewno chcesz wyczyścić wszystkie pola formularza?'))		return false;				document.getElementById('formTresc').value='';	document.getElementById('formIlosc').value='';	document.getElementById('formDo').value='';	document.getElementById('formOd').value='';	document.getElementById('formTelefon').value='';	document.getElementById('formMail').value='';	document.getElementById('formNazwisko').value='';		return false;}function controlForm(){	if (document.getElementById('formTresc').value=='' ||		document.getElementById('formMail').value=='' ||	    document.getElementById('formNazwisko').value=='')	{		alert('Wypełnij wszystkie pola oznaczone gwiazdką.');		return false;	}	return true;}       function PrintObject(obj, ileWlini, start, stop, name) {	start==undefined ? start = 0 : false;	stop==undefined ? stop = 2048 : false;	name == undefined ? name = true : false;	 	var str=""; var i = 0; var j = 0; 	for(prop in obj) 	{ 		i++; 		j++; 		if ((j>=start) && (j<=stop)) 		{ 			 			name == true && typeof(obj[prop]) != 'function' ? str+= prop + "=" + obj[prop] + "\t" : str+= prop +  "\t";	 		if ( (i%ileWlini) == 0)	 		{		 		i = 0;	 			str += "\n";	 		} 		} 	} 		 	alert(str); }   //funkcja ustawia styl CSS obiektu przekazanego ajko pierwszy argument funkcji function SetElemStyle(obj, styl) { 	 	var pom = obj.style.cssText;  	obj.style.cssText = pom + '; ' + styl; 	 	 }         
