Your IP : 216.73.216.163


Current Path : /home/user/web/pansionat-v-yaroslavle.ru/public_html/331ab/
Upload File :
Current File : /home/user/web/pansionat-v-yaroslavle.ru/public_html/331ab/admin.tar

fileman_folder.php000064400000000140150240170740010216 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_folder.php");?>
sysupdate_log.php000064400000000144150240170740010136 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/update_log.php");
?>perfmon_index_detail.php000064400000000143150240170740011432 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_index_detail.php");
?>
seo_search_yandex_detail.php000064400000000140150240170740012255 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_detail.php");?>vote_channel_list.php000064400000000134150240170740010753 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_channel_list.php");
?>checklist.php000064400000000130150240170740007220 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/checklist.php");
?>
buy_support.php000064400000000124150240170740007645 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/buy_support.php");?>wizard_list.php000064400000000124150240170740007605 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/wizard_list.php");?>dump_auto.php000064400000000135150240170740007251 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/dump_auto.php");
?>
search_reindex.php000064400000000134150240170740010236 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_reindex.php");
?>
public_access_edit.php000064400000000125150240170740011057 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/access_edit.php");?>content_index.php000064400000000126150240170740010115 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/content_index.php");?>translate_list.php000064400000000133150240170740010302 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_list.php");translate_collector.php000064400000000140150240170740011313 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_collector.php");update_system_partner.php000064400000000145150240170740011676 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_partner.php");
?>forum_topics_search.php000064400000000144150240170740011312 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_topics_search.php");
?>urlrewrite_edit.php000064400000000135150240170740010465 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/urlrewrite_edit.php");?>form_crm.php000064400000000121150240170740007053 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_crm.php");?>template_admin.php000064400000000127150240170740010240 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_admin.php");?>rating_rule_edit.php000064400000000140150240170740010570 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/rating_rule_edit.php");
?>fileman_newfolder.php000064400000000143150240170740010733 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_newfolder.php");?>
fileman_stickers_admin.php000064400000000143150240170740011745 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_stickers_admin.php");?>
repair_db.php000064400000000131150240170740007177 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/repair_db.php");
?>htmleditor2/html_edit_editor.js000064400000010076150240170740012662 0ustar00arButtons['new'] = ['BXButton',
	{
		id : 'new',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBNewPage,
		handler : function ()
		{
			var _this = this;
			setTimeout(function()
			{
				new_doc_list.PopupShow(BX.pos(_this.pWnd));
				BX("new_doc_list").style.zIndex = 2100;
			}, 10);
		}
	}
];

arButtons['save_and_exit'] = ['BXButton',
	{
		id : 'save_and_exit',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBSaveExit,
		title : BX_MESS.TBSaveExit,
		show_name : true,
		handler : function ()
		{
			if(_bEdit)
			{
				this.pMainObj.SaveContent(true);
				this.pMainObj.isSubmited = true;
				this.pMainObj.pForm.submit();
			}
			else
			{
				__bx_fd_save_as();
			}
		}
	}
];

arButtons['exit'] = ['BXButton',
	{
		id : 'exit',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBExit,
		handler : function ()
		{
			this.pMainObj.OnEvent("OnSelectionChange");
			var need_to_ask = (pBXEventDispatcher.arEditors[0].IsChanged() && !pBXEventDispatcher.arEditors[0].isSubmited);

			if(need_to_ask)
			{
				this.bNotFocus = true;
				this.pMainObj.OpenEditorDialog("asksave", false, 600, {window: window, savetype: _bEdit ? 'save' : 'saveas'}, true);
			}
			else if(this.pMainObj.arConfig["sBackUrl"])
				window.location = this.pMainObj.arConfig["sBackUrl"];
		}
	}
];

arButtons['saveas'] = ['BXButton',
	{
		id : 'saveas',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBSaveAs,
		handler : function ()
		{
			this.bNotFocus = true;
			apply = true;
			__bx_fd_save_as();
		}
	}
];


arButtons['save'] = ['BXButton',
	{
		id : 'save',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBSave,
		handler : function ()
		{
			if(!_bEdit)
			{
				this.bNotFocus = true;
				apply = true;
				__bx_fd_save_as();
			}
			else
			{
				this.pMainObj.SaveContent(true);
				BX("apply2").value = 'Y';
				this.pMainObj.isSubmited = true;
				this.pMainObj.pForm.submit();
			}
		}
	}
];

arToolbars['manage'] = [FE_MESS.FILEMAN_HTMLED_MANAGE_TB, [arButtons['save_and_exit'], arButtons['exit'], arButtons['new'], arButtons['save'], arButtons['saveas']]];

if (window.bEditProps)
{
	arButtons['pageprops'] = ['BXButton',
		{
			id : 'pageprops',
			iconkit : '_global_iconkit.gif',
			codeEditorMode : true,
			name : BX_MESS.TBProps,
			handler : function ()
			{
				this.pMainObj.OpenEditorDialog("pageprops", false, 800);
			}
		}
	];
	arToolbars['manage'][1].push(arButtons['pageprops']);
}

arDefaultTBPositions['manage'] = [0, 0, 2];

window.onbeforeunload = function(e)
{
	try{
		var need_to_ask = (pBXEventDispatcher.arEditors[0].IsChanged() && !pBXEventDispatcher.arEditors[0].isSubmited);
		if (need_to_ask)
		{
			if (typeof(BX.PULL) != 'undefined' && typeof(BX.PULL.tryConnectDelay) == 'function') // TODO change to right code in near future (e.shelenkov)
			{
				BX.PULL.tryConnectDelay();
			}
			return BX_MESS.ExitConfirm;
		}
	} catch(e){}
}

arEditorFastDialogs['asksave'] = function(pObj)
{
	return {
		title: BX_MESS.EDITOR,
		innerHTML : "<div style='padding: 5px;'>" + BX_MESS.DIALOG_EXIT_ACHTUNG + "</div>",
		OnLoad: function()
		{
			window.oBXEditorDialog.SetButtons([
				new BX.CWindowButton(
				{
					title: BX_MESS.TBSaveExit,
					className: 'adm-btn-save',
					action: function()
					{
						pObj.pMainObj.isSubmited = true;
						if(pObj.params.savetype == 'saveas')
						{
							pObj.params.window.__bx_fd_save_as();
						}
						else
						{
							pObj.pMainObj.SaveContent(true);
							pObj.pMainObj.pForm.submit();
						}

						window.oBXEditorDialog.Close();
					}
				}),
				new BX.CWindowButton(
				{
					title: BX_MESS.DIALOG_EXIT_BUT,
					action: function()
					{
						pObj.pMainObj.isSubmited = true;
						if(pObj.pMainObj.arConfig["sBackUrl"])
							pObj.params.window.location = pObj.pMainObj.arConfig["sBackUrl"];

						window.oBXEditorDialog.Close();
					}
				}),
				window.oBXEditorDialog.btnCancel
			]);

			BX.addClass(window.oBXEditorDialog.PARTS.CONTENT_DATA, "bxed-dialog");
			window.oBXEditorDialog.adjustSizeEx();
		}
	};
}
htmleditor2/components2.js000064400000233034150240170740011613 0ustar00var components2_js = true;
function BXComponents2Taskbar()
{
	var oTaskbar = this;
	BXComponents2Taskbar.prototype.OnTaskbarCreate = function ()
	{
		if (!this.pMainObj.arComponents)
			this.pMainObj.arComponents = {};
		if (window.lca && !_$lca_to_output)
			this.pMainObj.AddEventHandler('SaveContentAfter', this.OnSaveLCA, this);

		this.pMainObj.C2Parser = new C2Parser(this.pMainObj, this);
		this.C2Parser = this.pMainObj.C2Parser;
		this.icon = 'components';
		this.iconDiv.className = 'tb_icon bxed-taskbar-icon-' + this.icon;

		this.pHeaderTable.setAttribute("__bxtagname", "_taskbar_cached"); // need for correct context menu for taskbar title
		if (window.lca)
			_$LCAContentParser_execed = false;

		oTaskbar.pCellComp = oTaskbar.CreateScrollableArea(oTaskbar.pWnd);

		oTaskbar.pCellComp.style.width = "100%";
		oTaskbar.pCellComp.style.height = "100%";
		this.pMainObj.pComponent2Taskbar = this;
		this.FetchArray();
		oBXEditorUtils.addPropertyBarHandler('component2', oTaskbar.ShowProps);
		this.pMainObj.AddEventHandler("OnDblClick", this.OnComp2DblClick, this);
		emptyRow = null;
		table = null;

		oTaskbar.DialogInit();
	}

	BXComponents2Taskbar.prototype.GetParams = function(P)
	{
		if (P.id && oTaskbar.pMainObj.arComponents[P.id])
			return oTaskbar.pMainObj.arComponents[P.id];
		return {};
	}

	BXComponents2Taskbar.prototype.SetParams = function(P)
	{
		if (P.params && P.id)
			oTaskbar.pMainObj.arComponents[P.id] = P.params;
	}

	BXComponents2Taskbar.prototype.OnElementDragEnd = function(oEl)
	{
		if (!oEl)
			return;

		var oTag = oTaskbar.pMainObj.GetBxTag(oEl);
		if (oTag.tag != 'component2')
			return;

		// Run it only when dropped into editor doc
		if (oEl.ownerDocument != oTaskbar.pMainObj.pEditorDocument)
			return oTaskbar.OnElementDragEnd(oTaskbar.pMainObj.pEditorDocument.body.appendChild(oEl.cloneNode(false)));

		oTag.id = null;
		delete oTag.id;
		oEl.id = '';
		oEl.removeAttribute('id');

		var draggedElId = oTaskbar.pMainObj.SetBxTag(oEl, copyObj(oTag));
		oEl.style.cursor = 'default';

		// Hack for safari
		if (BX.browser.IsSafari())
		{
			if (oEl && oEl.parentNode)
				oEl.parentNode.removeChild(oEl);

			oTaskbar.pMainObj.insertHTML('<img src="' + oEl.src + '" id="' + draggedElId + '">');
			setTimeout(function(){oTaskbar.pMainObj.SelectElement(oTaskbar.pMainObj.pEditorDocument.getElementById(draggedElId))}, 20);
		}

		if (oTaskbar.pMainObj.bRenderComponents)
		{
			var otherComp = BXFindParentByTagName(oEl, 'DIV', 'bxc2-block');
			if (otherComp) // Component dragged into another
				otherComp.parentNode.insertBefore(oEl, otherComp); // Put element before parent component
		}

		var props = oTag.params;
		oTaskbar.SetParams({id: oEl.id, params: props});

		if (oTaskbar.pMainObj.bRenderComponents)
		{
			oTaskbar.C2Parser.StartWaiting(oEl); // Show waiting icon instead of native component's icon
			oTaskbar.C2Parser.__bPreventComponentDeselect = true;
			oTaskbar.C2Parser.GetRenderedContent({name: props.name, pElement: oEl, bSelect: true}); // Get default html for new component
		}

		this.nLastDragNDropElement = null;
		this.nLastDragNDropElementFire = false;
	};

	BXComponents2Taskbar.prototype.OnComp2DblClick = function (e)
	{
		var pEl, oTag;
		if (!e)
			e = oTaskbar.pMainObj.pEditorWindow.event;
		if (e.target)
			pEl = e.target;
		else if (e.srcElement)
			pEl = e.srcElement;
		if (pEl.nodeType == 3)
			pEl = pEl.parentNode;

		if (pEl && pEl.nodeName)
		{
			oTag = oTaskbar.pMainObj.GetBxTag(pEl);
			if (oTag.tag != 'component2')
				return;

			if (oTaskbar.pMainObj.pMainObj.bRenderComponents && oTag.tag != 'component2')
				pEl = BXFindParentByTagName(pEl, 'DIV', 'bxc2-block');
			else if (pEl.nodeName.toLowerCase() == 'body' && pEl.lastChild && pEl.lastChild.getAttribute)
				pEl = pEl.lastChild;
		}

		if (!pEl || !pEl.getAttribute)
			return;

		oTag = oTaskbar.pMainObj.GetBxTag(pEl);
		if (oTag.tag != 'component2')
			return;

		this.pMainObj.OpenEditorDialog("component2", false, 650, {pElement: pEl});
		BX.PreventDefault(e);
	}

	BXComponents2Taskbar.prototype.FetchArray = function (clear_cache)
	{
		var loadComp2 = function()
		{
			oTaskbar.BuildList(window.arComp2Elements);
			window.as_arComp2Elements = [];
			var __len = window.arComp2Elements.length;
			for (var i = 0; i < __len; i++)
				window.as_arComp2Elements[window.arComp2Elements[i].name] = window.arComp2Elements[i];
			BX.closeWait();
		};

		CHttpRequest.Action = function(result)
		{
			try{
				setTimeout(loadComp2, 10);
			}catch(e){
				err_text = "ERROR in BXComponents2Taskbar.FetchArray(): ";
				if ((eind = result.indexOf('Fatal error')) != -1)
					err_text += "\n PHP error: \n\n....." + result.substr(eind - 10);
				alert(err_text);
			}
		};

		if (window.arComp2Elements)
			loadComp2();
		else
			CHttpRequest.Send('/bitrix/admin/fileman_load_components2.php?lang='+BXLang+'&site='+BXSite+'&load_tree=Y'+(clear_cache === true ? '&clear_comp2_cache=Y' : ''));
	}

	BXComponents2Taskbar.prototype.BuildList = function (__arElements)
	{
		var len = __arElements.length;
		if (len == 0) // if any allowed components in the list - close taskbar
			oTaskbar.Close();

		for (var i = 0; i < len; i++)
		{
			__arElements[i].tagname = 'component2';
			__arElements[i].childElements = [];
			__arElements[i].params.name = __arElements[i].name;

			if (__arElements[i].isGroup && !__arElements[i].path)
				oTaskbar.AddElement(__arElements[i], oTaskbar.pCellComp, __arElements[i].path);
		}
		this.fullyLoaded = false;
	}

	BXComponents2Taskbar.prototype.PreBuildList = function ()
	{
		var __arElements = window.arComp2Elements;
		var len = __arElements.length;
		for (var i = 0; i < len; i++)
		{
			if (!__arElements[i].isGroup || __arElements[i].path)
				oTaskbar.AddElement(__arElements[i], oTaskbar.pCellComp, __arElements[i].path);
		}
		this.fullyLoaded = true;
	}

	BXComponents2Taskbar.prototype.ShowProps = function (_bNew, _pTaskbar, _pElement, bReloadProps)
	{
		oTaskbar.bDialogMode = _pTaskbar.bDialogMode || false;
		oTaskbar.dialog_suffix = (_pTaskbar.bDialogMode) ? '_d' : '';

		if (bReloadProps || window._bx_reload_template_props || !_pTaskbar.bDialogMode)
		{
			oTaskbar._ShowProps(_bNew, _pTaskbar, _pElement, bReloadProps);
		}
		else
		{
			setTimeout(function() {
				if (!oTaskbar.bLoadProc || oTaskbar.bLoadProc != _pElement.id)
					oTaskbar._ShowProps(_bNew, _pTaskbar, _pElement, bReloadProps);
			}, 500);
		}
	}

	BXComponents2Taskbar.prototype._ShowProps = function (_bNew, _pTaskbar, _pElement, bReloadProps)
	{
		var arProps = this.GetParams({id: _pElement.id});
		if (bReloadProps === true || (!window._bx_reload_template_props && !window.as_arComp2Params[arProps.name + arProps.__bx_id]))
		{
			var str, j;
			for (j in arProps.paramvals)
			{
				str = arProps.paramvals[j];
				if (typeof str == 'string' && str.substr(0, 6).toLowerCase() == 'array(')
					arProps.paramvals[j] = str.toLowerCase() == 'array()' ? [] : eval("[" + str.substr(6, str.length - 7) + "]");
			}
			oTaskbar.bLoadProc = _pElement.id;
			var postData = oBXEditorUtils.ConvertArray2Post(oTaskbar.PrepareParamvals(arProps.paramvals), 'curval');
			oTaskbar.LoadComp2Params(arProps, oTaskbar.BXShowComponent2Panel, oTaskbar, [_bNew,  _pTaskbar, _pElement], 'POST', postData);
		}
		else if (window._bx_reload_template_props)
		{
			oTaskbar.DelTemplateParams(_pElement.id);
			var postData = oBXEditorUtils.ConvertArray2Post(oTaskbar.PrepareParamvals(arProps.paramvals), 'curval');
			oTaskbar.SetCompTemplate(_pElement, this); // TODO: remake this function
			//oTaskbar.pMainObj.GetBxTag(_pElement);

			arProps = this.GetParams({id: _pElement.id});
			oTaskbar.loadTemplateParams(arProps.name, arProps.template, oTaskbar.ShowProps, oTaskbar, [_bNew, _pTaskbar, _pElement, false], "POST", postData);
		}
		else if (window.as_arComp2Params[arProps.name + arProps.__bx_id])
		{
			oTaskbar.BXShowComponent2Panel(_bNew, _pTaskbar, _pElement);
		}
	}

	BXComponents2Taskbar.prototype.ClearCache = function ()
	{
		BX.showWait();
		BX.cleanNode(oTaskbar.pCellComp);
		window.arComp2Elements = false;
		oTaskbar.FetchArray(true);
	}

	BXComponents2Taskbar.prototype.GetPropFieldElements = function (_pTaskbar)
	{
		var arElements = {};
		var parentNode = _pTaskbar.pCellProps;
		arElements = this.AddPropFieldElements(parentNode.getElementsByTagName("SELECT"), arElements);
		arElements = this.AddPropFieldElements(parentNode.getElementsByTagName("INPUT"), arElements);
		arElements = this.AddPropFieldElements(parentNode.getElementsByTagName("TEXTAREA"), arElements);
		this.arCachedElements = arElements;
		return this.arCachedElements;
	}

	BXComponents2Taskbar.prototype.AddPropFieldElements = function(arNodes, arElements)
	{
		var el, name, i, l = arNodes.length;
		for(i = 0; i < l; i++)
		{
			el = arNodes[i];
			if(!isYes(el["__exp"])) continue;
			if(el.name.substr(el.name.length - 2, 2) == '[]')
			{
				name = el.name.substr(0, el.name.length - 2);
				if (!arElements[name])
					arElements[name] = [];
				arElements[name].push(el);
			}
			else
				arElements[el.name] = el;
		}
		return arElements;
	}

	BXComponents2Taskbar.prototype.ShowComponentParam = function(P)
	{
		var
			_this = this,
			_bNew = P._bNew,
			_pElement = P.pElement,
			pPropTsb = P.pPropTaskbar,
			pMainObj = oTaskbar.pMainObj,
			arPropertyParams = P.arProp,
			arAllProps = P.arAllProps,
			propertyID = arPropertyParams.param_name,
			refreshedByOnclick = false,
			arUsedValues = [],
			fChange = P.fChange,
			tProp, pParCell;

		pPropTsb.arElements.push(propertyID);

		if (arAllProps.paramvals && arAllProps.paramvals[propertyID] != undefined)
			arValues = arAllProps.paramvals[propertyID];
		else
			arValues = arPropertyParams.DEFAULT || '';

		oTaskbar.curParamvals[propertyID] = arValues;
		//__paramvals[propertyID] = arValues;
		if(!isYes(arPropertyParams.MULTIPLE))
			arPropertyParams.MULTIPLE = "N";
		if(!arPropertyParams.TYPE)
			arPropertyParams.TYPE = "STRING";
		if(!arPropertyParams.CNT)
			arPropertyParams.CNT = 0;
		if(!arPropertyParams.SIZE)
			arPropertyParams.SIZE = 0;
		if(!arPropertyParams.ADDITIONAL_VALUES)
			arPropertyParams.ADDITIONAL_VALUES = 'N';
		if(!arPropertyParams.ROWS)
			arPropertyParams.ROWS = 0;
		if(!arPropertyParams.COLS || parseInt(arPropertyParams.COLS) < 1)
			arPropertyParams.COLS = '30';

		var _arValues = [];
		if (typeof arValues == 'string')
		{
			var originalValue = arValues;
			if (isPHPBracket(arValues))
				arValues = JS_stripslashes(trimPHPBracket(arValues));

			if (isNum(arValues)) // If it's number - remove PHP brackets
				originalValue = arValues;

			if (arValues.substr(0, 6).toLowerCase() == 'array(')
				_arValues = _BXStr2Arr(arValues, true);
			else if (arPropertyParams.TYPE == "LIST")
				arValues = [originalValue];
			else
				arValues = originalValue;
		}

		if(isYes(arPropertyParams.MULTIPLE) && typeof(arValues) != 'object' && !arValues)
			arValues = _arValues;

		if(isYes(arPropertyParams.MULTIPLE))
		{
			arPropertyParams.CNT = parseInt(arPropertyParams.CNT);
			if (arPropertyParams.CNT < 1)
				arPropertyParams.CNT = 1;
		}
		if (isYes(arPropertyParams.HIDDEN))
			return;

		// If SEF = ON : show SEF_URL_TEMPLATES and SEF_FOLDER
		//     SEF = OFF: show VARIABLE_ALIASES
		if ((propertyID.substr(0, 17) == "SEF_URL_TEMPLATES" || propertyID == "SEF_FOLDER") && pPropTsb.__SEF_MODE === false)
			return;
		else if (propertyID.substr(0,16)=="VARIABLE_ALIASES" && pPropTsb.__SEF_MODE === true)
			return;

		if (!arPropertyParams.PARENT || !arPropertyParams.group)
		{
			arPropertyParams.PARENT = '__bx_additional_group';
			arPropertyParams.group_title = BX_MESS.ADD_INSERT;
		}

		// If it's grouped property
		if (arPropertyParams.PARENT)
		{
			if (!oTaskbar.arGroups[arPropertyParams.PARENT])
			{
				pParCell = oTaskbar.GetPropGroupDataCell(arPropertyParams.PARENT, arPropertyParams.group_title, P.oCont, [arAllProps.name]);
				oTaskbar.arGroups[arPropertyParams.PARENT] = {title: arPropertyParams.group_title, datacell: pParCell};
			}
			else
			{
				pParCell = oTaskbar.arGroups[arPropertyParams.PARENT].datacell;
			}

			var _tbls = pParCell.getElementsByTagName("TABLE");
			if (_tbls.length > 0)
				tProp = _tbls[0];
			else
				tProp =  pParCell.appendChild(BX.create('TABLE', {props: {className : "bxtaskbarprops"}}));
		}
		else
		{
			tProp = __tProp;
			oCont.appendChild(tProp);
		}

		row = tProp.insertRow(-1);
		row.className = "bxtaskbarpropscomp";
		cell = row.insertCell(-1);
		cell.className = "bxtaskbarprop-label";
		cell.innerHTML = "<SPAN>" + bxhtmlspecialchars(arPropertyParams.NAME) + ":</SPAN>";
		cell = row.insertCell(-1);

		arPropertyParams.TYPE = arPropertyParams.TYPE.toUpperCase();

		if (propertyID == "SEF_MODE")
			arPropertyParams.TYPE = "CHECKBOX";

		//* * * * * * Displaying data * * * * * *
		switch(arPropertyParams.TYPE)
		{
		case "LIST":
			arPropertyParams.SIZE = (isYes(arPropertyParams.MULTIPLE) && (parseInt(arPropertyParams.SIZE)<=1 || isNaN(parseInt(arPropertyParams.SIZE))) ? '3' : arPropertyParams.SIZE);
			if(parseInt(arPropertyParams.SIZE)<=0 || isNaN(parseInt(arPropertyParams.SIZE)))
				arPropertyParams.SIZE = 1;
			pSelect = pMainObj.CreateElement("SELECT", {size: arPropertyParams.SIZE, name: propertyID + (isYes(arPropertyParams.MULTIPLE) ? '[]' : ''), __exp: 'Y', onchange: fChange, multiple: isYes(arPropertyParams.MULTIPLE)});
			cell.appendChild(pSelect);
			if(!arPropertyParams.VALUES)
				arPropertyParams.VALUES = [];
			bFound = false;

			for(opt_val in arPropertyParams.VALUES)
			{
				if(typeof(arPropertyParams.VALUES[opt_val]) != 'string')
					continue;
				bSel = false;
				oOption = new Option(JS_stripslashes(arPropertyParams.VALUES[opt_val]), opt_val, false, false);
				pSelect.options.add(oOption);

				if(pSelect.options.length <= 1)
					setTimeout(__BXSetOptionSelected(oOption, false), 1);

				key = BXSearchInd(arValues, opt_val);
				if(key >= 0)
				{
					bFound = true;
					arUsedValues[key]=true;
					bSel = true;
					if (propertyID=="SEF_MODE")
						pPropTsb.__SEF_MODE = isYes(opt_val);
					setTimeout(__BXSetOptionSelected(oOption, true), 1);
				}
				else if(_arValues[opt_val])
				{
					bFound = true;
					arUsedValues[opt_val]=true;
					bSel = true;
					setTimeout(__BXSetOptionSelected(oOption, true), 1);
					delete _arValues[opt_val];
				}
			}

			if(arPropertyParams.ADDITIONAL_VALUES != 'N')
			{
				oOption = document.createElement("OPTION");
				oOption.value = '';
				oOption.selected = !bFound;
				oOption.text = (isYes(arPropertyParams.MULTIPLE) ? BX_MESS.TPropCompNS : BX_MESS.TPropCompOth)+' ->';
				pSelect.options.add(oOption, 0);
				oOption = null;

				if(isYes(arPropertyParams.MULTIPLE))
				{
					if (typeof(arValues) == 'string')
						arValues = _arValues;

					for(k in arValues)
					{
						if(typeof(arValues[k]) != 'string' || arUsedValues[k] || arValues[k] == '')
							continue;
						cell.appendChild(pMainObj.CreateElement("BR"));
						if(arPropertyParams.ROWS > 1)
						{
							var oTextarea = pMainObj.CreateElement("TEXTAREA", {cols: (isNaN(arPropertyParams.COLS) ? '20' : arPropertyParams.COLS), value: JS_stripslashes(arValues[k]), name: propertyID+'[]', __exp: 'Y', onchange: fChange});
							cell.appendChild(oTextarea);
							oTextarea = null;
						}
						else
						{
							var oInput = pMainObj.CreateElement("INPUT", {type: 'text', size: (isNaN(arPropertyParams.COLS)?'20':arPropertyParams.COLS), value: JS_stripslashes(arValues[k]), name: propertyID+'[]', '__exp': 'Y', onchange: fChange});
							cell.appendChild(oInput);
							oInput = null;
						}
					}

					for(k=0; k<arPropertyParams.CNT; k++)
					{
						cell.appendChild(pMainObj.CreateElement("BR"));
						if(arPropertyParams.ROWS>1)
						{
							var oTextarea = pMainObj.CreateElement("TEXTAREA", {'cols': (isNaN(arPropertyParams.COLS)?'20':arPropertyParams.COLS), 'value': '', 'name': propertyID+'[]', '__exp': 'Y', 'onchange': fChange});
							cell.appendChild(oTextarea);
							oTextarea = null;
						}
						else
						{
							var oInput = pMainObj.CreateElement("INPUT", {'type': 'text', 'size': (isNaN(arPropertyParams.COLS)?'20':arPropertyParams.COLS), 'value': '', 'name': propertyID+'[]', '__exp': 'Y', 'onchange': fChange});
							cell.appendChild(oInput);
							oInput = null;
						}
					}

					var oInput = pMainObj.CreateElement("INPUT", {'type': 'button', 'value': '+', 'pMainObj': pMainObj,  'arPropertyParams': arPropertyParams});
					xCell = cell.appendChild(oInput);
					oInput = null;
					var oBR = pMainObj.CreateElement("BR");
					cell.appendChild(oBR);
					oBR = null;
					xCell.propertyID = propertyID;
					xCell.fChange = fChange;
					xCell.onclick = function ()
					{
						this.parentNode.insertBefore(this.pMainObj.CreateElement("BR"), this);
						if(this.arPropertyParams['ROWS'] && this.arPropertyParams['ROWS']>1)
						{
							var oTextarea = this.pMainObj.CreateElement("TEXTAREA", {'cols': (!this.arPropertyParams['COLS'] || isNaN(this.arPropertyParams['COLS'])?'20':this.arPropertyParams['COLS']), 'value': '', 'name': this.propertyID+'[]', '__exp': 'Y', 'onchange': this.fChange});
							this.parentNode.insertBefore(oTextarea, this);
							oTextarea = null;
						}
						else
						{
							var oInput = this.pMainObj.CreateElement("INPUT", {'type': 'text', 'size': (!this.arPropertyParams['COLS'] || isNaN(this.arPropertyParams['COLS'])?'20':this.arPropertyParams['COLS']), 'value': '', 'name': this.propertyID+'[]', '__exp': 'Y', 'onchange': this.fChange});
							this.parentNode.insertBefore(oInput, this);
							oInput = null;
						}
					}
				}
				else
				{
					val = '';
					for(k=0; k<arValues.length; k++)
					{
						if(arUsedValues[k])
							continue;
						val = arValues[k];
						break;
					}

					if(arPropertyParams['ROWS'] && arPropertyParams['ROWS']>1)
						alt = cell.appendChild(pMainObj.CreateElement("TEXTAREA", {'cols': (!arPropertyParams['COLS'] || isNaN(arPropertyParams['COLS'])?'20':arPropertyParams['COLS']), 'value': val, 'disabled': bFound, 'name': propertyID+'_alt', '__exp': 'Y', 'onchange': fChange}));
					else
						alt = cell.appendChild(pMainObj.CreateElement("INPUT", {'type': 'text', 'size': (!arPropertyParams['COLS'] || isNaN(arPropertyParams['COLS'])?'20':arPropertyParams['COLS']), 'value': val, 'disabled': bFound, 'name': propertyID+'_alt', '__exp': 'Y', 'onchange': fChange}));

					pSelect.pAlt = alt;

					if (isYes(arPropertyParams.REFRESH))
						pSelect.onchange = function (e){fChange();_this.ShowProps(_bNew, pPropTsb, _pElement, true);};
					else
						pSelect.onchange = function (e){this.pAlt.disabled = (this.selectedIndex!=0); fChange();};
				}
			}

			if(!bFound)
				setTimeout(fChange, 100);

			if (isYes(arPropertyParams.REFRESH))
				pSelect.onchange = function (e){fChange();_this.ShowProps(_bNew, pPropTsb, _pElement, true);};

			if (propertyID=="SEF_MODE")
			{
				pSelect.onchange = function(e)
					{
						pPropTsb.__SEF_MODE = isYes(this.value);
						fChange();
						_this.ShowProps(_bNew, pPropTsb, _pElement, false);
					};
			}

			break;
		case "CHECKBOX":
			pCheckbox = pMainObj.CreateElement("INPUT", {'type':'checkbox', 'name': propertyID, '__exp': 'Y'});
			cell.appendChild(pCheckbox);

			if (arValues)
				oBXEditorUtils.setCheckbox(pCheckbox, isYes(arValues));
			else if (arPropertyParams.DEFAULT != undefined)
				oBXEditorUtils.setCheckbox(pCheckbox, isYes(arPropertyParams.DEFAULT));
			else
				oBXEditorUtils.setCheckbox(pCheckbox,false);

			if (propertyID=="SEF_MODE")
			{
				pCheckbox.onclick = function(e)
					{
						oBXEditorUtils.setCheckbox(this,this.checked);
						pPropTsb.__SEF_MODE = this.checked;
						fChange();
						_this.ShowProps(_bNew, pPropTsb, _pElement, false);
					}
				pPropTsb.__SEF_MODE = pCheckbox.checked;
			}
			else if(isYes(arPropertyParams.REFRESH))
			{
				pCheckbox.onclick = function(e)
				{
					oBXEditorUtils.setCheckbox(this,this.checked);
					fChange();
					_this.ShowProps(_bNew, pPropTsb, _pElement, true);
				}
				refreshedByOnclick = true;

			}
			else
			{
				pCheckbox.onclick = function(e) {oBXEditorUtils.setCheckbox(this, this.checked); fChange();}
			}
			//__paramvals[propertyID] = pCheckbox.value;
			oTaskbar.curParamvals[propertyID] = pCheckbox.value;
			break;
		case "STYLELIST":
			break;
		default: // 'STRING' OR 'FILE' OR 'COLORPICKER' OR 'CUSTOM'
			if (arPropertyParams.TYPE == 'COLORPICKER' || arPropertyParams.TYPE == 'FILE')
			{
				refreshedByOnclick = true;
				arPropertyParams.ROWS = 1;
				arPropertyParams.MULTIPLE = 'N';
				arPropertyParams.COLS = (arPropertyParams.TYPE == 'FILE') ? 40 : 6;
			}

			if(isYes(arPropertyParams.MULTIPLE))
			{
				bBr = false;
				var obVal = (typeof arValues == 'object') ? arValues : _arValues;
				for(k in obVal)
				{
					if(bBr)
						cell.appendChild(pMainObj.CreateElement("BR"));
					else
						bBr = true;

					val = obVal[k].replace(/(\\)?\\n/g, "\n");
					if(arPropertyParams.ROWS > 1)
						cell.appendChild(pMainObj.CreateElement("TEXTAREA", {cols: parseInt(arPropertyParams.COLS) || 20, value: JS_stripslashes(val), name: propertyID+'[]', __exp: 'Y', onchange: fChange}));
					else
						cell.appendChild(pMainObj.CreateElement("INPUT", {type: 'text', size: parseInt(arPropertyParams.COLS) || 20, value: JS_stripslashes(val), name: propertyID+'[]', __exp: 'Y', 'onchange': fChange}));
				}

				for(k=0; k<arPropertyParams.CNT; k++)
				{
					if(bBr)
						cell.appendChild(pMainObj.CreateElement("BR"));
					else
						bBr = true;

					if(arPropertyParams.ROWS > 1)
						cell.appendChild(pMainObj.CreateElement("TEXTAREA", {'cols': (isNaN(arPropertyParams['COLS'])?'20':arPropertyParams['COLS']), 'value': '', 'name': propertyID+'[]', '__exp': 'Y', 'onchange': fChange}));
					else
						cell.appendChild(pMainObj.CreateElement("INPUT", {'type': 'text', 'size': (isNaN(arPropertyParams['COLS'])?'20':arPropertyParams['COLS']), 'value': '', 'name': propertyID+'[]', '__exp': 'Y', 'onchange': fChange}));
				}

				xCell = cell.appendChild(pMainObj.CreateElement("INPUT", {'type': 'button', 'value': '+', 'pMainObj': pMainObj,  'arPropertyParams': arPropertyParams}));
				xCell.propertyID = propertyID;
				xCell.fChange = fChange;
				xCell.onclick = function ()
				{
					this.parentNode.insertBefore(this.pMainObj.CreateElement("BR"), this);
					if(this.arPropertyParams.ROWS && this.arPropertyParams.ROWS > 1)
						this.parentNode.insertBefore(this.pMainObj.CreateElement("TEXTAREA", {cols: (!this.arPropertyParams.COLS || isNaN(this.arPropertyParams.COLS) ? '20' : this.arPropertyParams.COLS), 'value': '', 'name': this.propertyID+'[]', '__exp': 'Y', 'onchange': this.fChange}), this);
					else
						this.parentNode.insertBefore(this.pMainObj.CreateElement("INPUT", {type: 'text', size: (!this.arPropertyParams.COLS || isNaN(this.arPropertyParams['COLS'])?'20':this.arPropertyParams.COLS), 'value': '', 'name': this.propertyID+'[]', '__exp': 'Y', 'onchange': this.fChange}), this);
				}
				cell.appendChild(pMainObj.CreateElement("BR"));
			}
			else
			{
				var oInput;
				val = arValues.replace(/(\\)?\\n/g, "\n");
				if(arPropertyParams.ROWS && arPropertyParams.ROWS > 1)
					cell.appendChild(pMainObj.CreateElement("TEXTAREA", {cols: (!arPropertyParams.COLS || isNaN(arPropertyParams.COLS)?'20':arPropertyParams.COLS), value: JS_stripslashes(val), name: propertyID, __exp: 'Y', onchange: fChange}));
				else
					oInput = cell.appendChild(pMainObj.CreateElement("INPUT", {type: 'text', size: (!arPropertyParams.COLS || isNaN(arPropertyParams.COLS)?'20':arPropertyParams.COLS), value: JS_stripslashes(val), name: propertyID, __exp: 'Y', onchange: fChange}))

				if (!oInput)
					break;
				if (arPropertyParams.TYPE == 'FILE')
				{
					oInput.className = 'fl';
					if (arPropertyParams.FD_USE_MEDIALIB && parseInt(arPropertyParams.FD_USE_MEDIALIB) > 0)
					{
						// Replace id, and increase "curCount"
						var html = window['_bxMlBrowseButton_' + propertyID.toLowerCase()];
						if(BX.browser.IsIE() && !this.bxAppendedCSSForML)
						{
							var
								s1 = html.indexOf('<' + 'style>'),
								s2 = html.indexOf('</' + 'style>'),
								css = html.substr(s1 + 7, s2 - s1 - 7);

							document.styleSheets[0].cssText += css;
							this.bxAppendedCSSForML = true;
						}

						var code = [], start, end, i, cnt;
						while((start = html.indexOf('<' + 'script>')) != -1)
						{
							var end = html.indexOf('</' + 'script>', start);
							if(end == -1)
								break;
							code[code.length] = html.substr(start + 8, end - start - 8);
							html = html.substr(0, start) + html.substr(end + 9);
						}

						for(var i = 0, cnt = code.length; i < cnt; i++)
							if(code[i] != '')
								jsUtils.EvalGlobal(code[i]);

						cell.appendChild(BX.create("DIV", {props: {}, html: html}));

						xCell = BX("bx_fd_input_" + propertyID.toLowerCase());
						if (xCell)
							xCell.onclick = window['BX_FD_' + propertyID];
					}
					else
					{
						xCell = cell.appendChild(pMainObj.CreateElement("INPUT", {type: 'button', value: '...'}));
						xCell.onclick = window['BX_FD_' + propertyID];
					}

					// Result of selecting file
					if (isYes(arPropertyParams.REFRESH))
					{
						window['BX_FD_ONRESULT_' + propertyID] = function(filename, filepath)
						{
							if (typeof filename == 'object')
								oInput.value = filename.src; // From medialibrary
							else
								oInput.value = (filepath + "/" + filename).replace(/\/\//ig, '/'); // From old good file dialog
							fChange();
							_this.ShowProps(_bNew, pPropTsb, _pElement, true);
						}
					}
					else
					{
						window['BX_FD_ONRESULT_' + propertyID] =  function(filename, filepath)
						{
							if (typeof filename == 'object')
								oInput.value = filename.src; // From medialibrary
							else
								oInput.value = (filepath + "/" + filename).replace(/\/\//ig, '/'); // From old good file dialog
							fChange();
						};
					}

					if (isYes(arPropertyParams.REFRESH))
					{
						oInput.onblur = function()
						{
							fChange();
							_this.ShowProps(_bNew, pPropTsb, _pElement, true);
						}
					}
				}
				else if(arPropertyParams.TYPE == 'COLORPICKER')
				{
					var oCP = pMainObj.CreateCustomElement('BXEdColorPicker',
					{
						id : 'BackColor',
						title : arPropertyParams.NAME,
						OnChange : isYes(arPropertyParams.REFRESH) ?
						function (color) {oInput.value = color; fChange(); _this.ShowProps(_bNew, pPropTsb, _pElement, true);}
						:
						function (color){oInput.value = color.replace(/^#+/g, ""); fChange();}
					});
					xCell = cell.appendChild(oCP.pWnd);
					oInput.className = "compPropFloat";
					oCP.pWnd.className = "compPropFloat";
				}
				else if(arPropertyParams.TYPE == 'CUSTOM')
				{
					if (!arPropertyParams.JS_FILE || !arPropertyParams.JS_EVENT)
						break;
					var data = arPropertyParams.JS_DATA || '';
					oInput.style.display = "none";
					//var getComponentParamsElements = function(){return oTaskbar.GetPropFieldElements(pPropTsb);};
					var getFunction = function(arParams)
					{
						return function()
						{
							if (window[arParams.propertyParams.JS_EVENT])
								window[arParams.propertyParams.JS_EVENT](arParams);
						};
					};
					var oCallBack = getFunction({
						propertyID : propertyID,
						propertyParams: arPropertyParams,
						//getElements : getComponentParamsElements,
						getElements : function(){return oTaskbar.GetPropFieldElements(pPropTsb);},
						oInput : oInput,
						oCont : cell,
						data : data,
						fChange: fChange
					});
					BXLoadJSFiles([arPropertyParams.JS_FILE], {func: oCallBack, obj: {}}, true);
				}
			}
			break;
		}
		if(isYes(arPropertyParams.REFRESH) && !refreshedByOnclick)
		{
			xCell = cell.appendChild(pMainObj.CreateElement("INPUT", {type: 'button', value: 'ok', pMainObj: pMainObj,  'arPropertyParams': arPropertyParams}));
			xCell.onclick = function(){fChange(); _this.ShowProps(_bNew, pPropTsb, _pElement, true);};
		}

		// Tooltip
		if (oTaskbar.arCurrentTooltips[propertyID] && pMainObj.showTooltips4Components)
		{
			new BX.CHint(
			{
				hint: oTaskbar.arCurrentTooltips[propertyID],
				parent: cell.appendChild(BX.create("IMG", {props: {src: one_gif_src, className: "bx-comp2-hint"}}))
			});
		}
	}

	BXComponents2Taskbar.prototype.ParamsOnChange = function(P)
	{
		var
			pPropTsb = P.pPropTaskbar,
			arAllFields = oTaskbar.GetPropFieldElements(pPropTsb),
			arAllProps = P.arAllProps,
			arProps = {}, // Component parameters
			arProps_temp,
			l = pPropTsb.arElements.length,
			propID, i, j, val, k;

		if (!window.arVA)
			arVA = [];

		for(i = 0; i < l; i++)
		{
			propID = pPropTsb.arElements[i];
			val = arAllFields[propID];
			if(val && val.selectedIndex == 0 && arAllFields[propID + '_alt'])
				val = arAllFields[propID + '_alt'];

			if(propID.substr(0, 18) == "SEF_URL_TEMPLATES_")
			{
				if (oTaskbar.bFChangeSEFMode !== true)
					continue;

				if (val && val.value)
					_val = val.value;
				else if(arAllProps.paramvals[propID])
					_val = arAllProps.paramvals[propID];
				else
					continue;

				arVA[propID.substr(18)] = catchVariableAliases(_val);
			}

			if(!val)
			{
				if (arAllProps.paramvals[propID])
					arProps[propID] = arAllProps.paramvals[propID];
				continue;
			}

			if(val.tagName) // one element
			{
				if (propID == "SEF_MODE")
					oTaskbar.bFChangeSEFMode = isYes(val.value);

				if(val.tagName.toUpperCase() == "SELECT")
				{
					for(j=0; j<val.length; j++)
					{
						if(val[j].selected && val[j].value!='')
							arProps[propID] = val[j].value;
					}
				}
				else
				{
					arProps[propID] = val.value;
				}
			}
			else
			{
				arProps_temp = [];
				for(k = 0; k < val.length; k++)
				{
					if(val[k].tagName.toUpperCase() == "SELECT")
					{
						for(j = 0; j < val[k].length; j++)
							if(val[k][j].selected && val[k][j].value != '')
								arProps_temp.push(val[k][j].value);
					}
					else if (val[k].value.toString().length > 0)
					{
						arProps_temp.push(val[k].value);
					}
				}
				arProps[propID] = _BXArr2Str(arProps_temp);
			}
		}

		arAllProps.paramvals = arProps;
		oTaskbar.SetParams({id: P.id, params: arAllProps});
		// Rerender component with new params
		oTaskbar.C2Parser.ReRenderComponent(P.id, P.pElement);
	}

	BXComponents2Taskbar.prototype.BXShowComponent2Panel = function (_bNew, _pTaskbar, _pElement)
	{
		if (oTaskbar.bPropDialogOpened && _pTaskbar.pCellProps.className != 'c2dialog_propdiv')
			return;

		var
			id =_pElement.id,
			arAllProps = this.GetParams({id: id}),
			arProps = window.as_arComp2Params[arAllProps.name + arAllProps.__bx_id];

		if (!arProps)
			return;

		oTaskbar.bLoadProc = false;
		oTaskbar.bFChangeSEFMode = false;
		_pTaskbar.arElements = [];
		oTaskbar.arGroups = [];
		oTaskbar.arCurrentTooltips = arComp2Tooltips[arAllProps.name];
		oTaskbar.curParamvals = [];

		BX.cleanNode(_pTaskbar.pCellProps);

		var
			_this = this,
			row, cell, arPropertyParams, bSel, arValues, res, pSelect, arUsedValues, bFound, key, oOption, val, xCell, opt_val, bBr, i, k, alt,
			fChange = function(){_this.ParamsOnChange({id: id, pPropTaskbar: _pTaskbar, arAllProps: arAllProps, pElement: _pElement});},
			fDisplay = function(arProp, tProp, oCont){_this.ShowComponentParam({arProp: arProp, pPropTbl: tProp, oCont: oCont, pPropTaskbar: _pTaskbar, arAllProps: arAllProps, fChange: fChange, _bNew: _bNew, pElement: _pElement});};

		var BXCreateGroups = function(cn, oCont)
		{
			if (window.arComp2ParamsGroups[cn])
			{
				var
					groups = window.arComp2ParamsGroups[cn],
					key;
				for (key in groups)
				{
					oTaskbar.arGroups[key] =
					{
						title : groups[key],
						datacell : oTaskbar.GetPropGroupDataCell(key, groups[key], oCont, [arAllProps.name])
					};
				}
			}
		};

		//****** DISPLAY TITLE *******
		var
			compTitle = window.as_arComp2Elements[arAllProps.name].title,
			compDesc = window.as_arComp2Elements[arAllProps.name].params.DESCRIPTION,
			bComplex = isYes(window.as_arComp2Elements[arAllProps.name].complex),
			tCompTitle = _pTaskbar.pCellProps.appendChild(BX.create('TABLE', {props: {className : "componentTitle"}}));

		// Component title
		BX.adjust(tCompTitle.insertRow(-1).insertCell(-1), {props: {className: "titlecell"}, html: "<span class='title'>" + compTitle + "  (" + arAllProps.name + ")</span><br /><span class='description'>" + (bComplex ? BX_MESS.COMPLEX_COMPONENT : "") + compDesc+"</span>"});

		//DISPLAY COMPONENT TEMPLATE PARAMETERS
		if (arAllProps.template == undefined)
			arAllProps.template = "";

		var
			oOption, el, k, site_template, j, bSel,
			arTemplates = as_arComp2Templates[arAllProps.name],
			temlLen = arTemplates.length,
			oCont = _pTaskbar.pCellProps;

		if (temlLen > 0)
		{
			var pParDatacell = oTaskbar.GetPropGroupDataCell('templateParams', BX_MESS.COMPONENT_TEMPLATE, _pTaskbar.pCellProps, [arAllProps.name]);
			var tTProp = pParDatacell.appendChild(BX.create('TABLE', {props: {id: '__bx_tProp', className : "bxtaskbarprops"}}));

			var row = BX.adjust(tTProp.insertRow(-1), {props: {className: "bxtaskbarpropscomp"}});
			BX.adjust(row.insertCell(-1), {props: {className: 'bxtaskbarprop-label'}, html: '<label for="__bx_comp2templ_select">' + BX_MESS.COMPONENT_TEMPLATE + ':</label>'});

			var templList = row.insertCell(-1).appendChild(BX.create("SELECT", {props: {id: '__bx_comp2templ_select'}}));
			templList.onchange = function(e)
			{
				oTaskbar.DelTemplateParams(_pElement.id);
				var postData = oBXEditorUtils.ConvertArray2Post(oTaskbar.PrepareParamvals(arAllProps.paramvals), 'curval');
				oTaskbar.SetCompTemplate(_pElement, this.value);
				arAllProps = oTaskbar.GetParams({id: id});
				oTaskbar.loadTemplateParams(arAllProps.name, arAllProps.template, oTaskbar.ShowProps,oTaskbar, [_bNew, _pTaskbar, _pElement, false], "POST", postData);
			};

			//Displaying component template list
			for (j = 0; j < temlLen; j++)
			{
				el = arTemplates[j];
				site_template = '';
				if (el.template != '')
				{
					for (k in arBXTemplates)
					{
						if (arBXTemplates[k].value == el.template)
						{
							site_template = ' (' + arBXTemplates[k].name + ')';
							break;
						}
					}
				}
				else
				{
					site_template = ' ('+BX_MESS.BUILD_IN_TEMPLTE+')';
				}

				bSel = ((arAllProps.template == undefined && (el.name == ".default" || el.name=="")) || arAllProps.template == "" && el.name==".default" || arAllProps.template == el.name);
				templList.options.add(new Option(
					((el.title) ? el.title : el.name) + site_template, // text
					el.name, // value
					bSel, bSel)
				);
			}

			// Displaying component's template parameters
			var
				arTemplParams = window.as_arComp2TemplParams[arAllProps.name + arAllProps.__bx_id],
				cl = arTemplParams.length;

			BXCreateGroups(arAllProps.name, oCont);
			for (j = 0; j < cl; j++)
				fDisplay(arTemplParams[j], tTProp, oCont);
		}
		templList = oOption = null;

		var i, l = window.as_arComp2Groups[arAllProps.name + arAllProps.__bx_id].length, gr;
		for(i = 0; i < l; i++)
		{
			gr = window.as_arComp2Groups[arAllProps.name + arAllProps.__bx_id][i];
			oTaskbar.arGroups[gr.name] = {
				title: gr.title,
				datacell: oTaskbar.GetPropGroupDataCell(gr.name, gr.title, oCont, [arAllProps.name])
			};
		}

		//Displaying components params
		var
			templateID = _pTaskbar.pMainObj.templateID,
			oDiv = BXCreateElement('DIV', {}, {width: '100%', height: '0%'}, document),
			tProp = BXCreateElement('TABLE', {id: '__bx_tProp', className : 'bxtaskbarprops', cellSpacing: 0, cellPadding: 1}, {width: '100%'}, document);

		if (arProps && arProps.length > 0)
		{
			for(var i = 0, l = arProps.length; i < l; i++)
			{
				if (arProps[i].param_name == "SEF_FOLDER" && !arProps[i].DEFAULT)
					arProps[i].DEFAULT = (relPath!="/" ? relPath : "")+"/";
				fDisplay(arProps[i], tProp, oCont);
			}
		}

		arAllProps.paramvals = oTaskbar.curParamvals;
		oTaskbar.SetParams({id: id, params: arAllProps});

		// No params in component
		if (arProps.length == 0 && temlLen == 0)
			_pTaskbar.pCellProps.appendChild(BX.create('DIV', {style: {margin : "5px 0 0 22px"}, text: BX_MESS.CompNoParams}));
	}

	BXComponents2Taskbar.prototype.LoadComp2Params = function (arProps, calbackFunc, calbackObj, calbackParams, method, data)
	{
		this.arCachedElements = false;
		var
			elementName = arProps.name,
			templName = arProps.template || '',
			loadHelp = (this.pMainObj.showTooltips4Components) ? "Y" : "N";

		arComp2Tooltips[elementName] = [];
		window.arComp2Props = null;
		window.arComp2Templates = null;
		window.arComp2TemplateProps = null;

		function OnRequest()
		{
			try{
				setTimeout(function ()
					{
						var arProps = oTaskbar.GetParams({id: calbackParams[2].id});
						if (!arProps.__bx_id)
							arProps.__bx_id = push2Component2("__bx_c2_" + Math.random(), arProps.name);

						window.as_arComp2Params[elementName + arProps.__bx_id] = window.arComp2Props;
						window.as_arComp2Groups[elementName + arProps.__bx_id] = window.arComp2Groups;
						window.as_arComp2Templates[elementName] = window.arComp2Templates;
						window.as_arComp2TemplParams[elementName + arProps.__bx_id] = window.arComp2TemplateProps;

						if(calbackObj && calbackFunc)
							calbackFunc.apply(calbackObj, calbackParams ? calbackParams : []);
						else if(calbackFunc)
							calbackFunc();
					}, 50
				);
			}catch(e) {alert('Error >> LoadComp2Params');}
		}

		var url = '/bitrix/admin/fileman_load_comp2_params.php?lang=' + BXLang + '&site=' + BXSite + '&cname=' + elementName+'&stid='+((this.pMainObj.templateID) ? this.pMainObj.templateID : '')+"&loadhelp="+loadHelp+'&tname=' + templName + '&bxsender=fileman_html_editor&bxeditor=' + this.pMainObj.name;

		this.pMainObj.__authFailureHandlerCallback = function(){oTaskbar.LoadComp2Params(arProps, calbackFunc, calbackObj, calbackParams, method, data);};
		this.pMainObj.__authFailureHandlerCallbackClose = function(){window.oBXEditorDialog.Close();};

		if (method == 'POST' && data)
			BX.ajax.post(url, data, OnRequest);
		else
			BX.ajax.get(url, {}, OnRequest);
	};

	//Set template
	BXComponents2Taskbar.prototype.SetCompTemplate = function(pEl, value)
	{
		var
			id = pEl.id,
			arProps = oTaskbar.GetParams({id: id});

		arProps.template = value || '';
		oTaskbar.SetParams({id: id, params: arProps});

		// Rerender component with new params
		oTaskbar.C2Parser.ReRenderComponent(id, pEl);
	}

	BXComponents2Taskbar.prototype.loadTemplateParams = function(componentName, templateName, calbackFunc, calbackObj, calbackParams, method, data)
	{
		var _CHttpRequest = new JCHttpRequest();
		_CHttpRequest.Action = function(result)
		{
			// try {
				setTimeout(function ()
					{
						//oTaskbar.pMainObj.GetBxTag(id);
						var arProps = oTaskbar.pMainObj.arComponents[calbackParams[2].id];
						window.as_arComp2TemplParams[componentName + arProps.__bx_id] = window.arComp2TemplateProps;
						window._bx_reload_template_props = false;

						if(calbackObj && calbackFunc)
							calbackFunc.apply(calbackObj, (calbackParams) ? calbackParams : []);
						else if(calbackFunc)
							calbackFunc();
					}, 10
				);
			// }catch(e) {alert('ERROR can\'t load template params...');}
		}

		if (method == 'POST' && data)
			_CHttpRequest.Post('/bitrix/admin/fileman_load_templates.php?lang='+BXLang+'&site='+BXSite + '&cname='+componentName+'&tname='+templateName+'&mode=params&stid='+((this.pMainObj.templateID) ? this.pMainObj.templateID : ''),data);
		else
			_CHttpRequest.Send('/bitrix/admin/fileman_load_templates.php?lang='+BXLang+'&site='+BXSite+'&cname='+componentName+'&tname='+templateName+'&mode=params&stid='+((this.pMainObj.templateID) ? this.pMainObj.templateID : ''));
	}

	BXComponents2Taskbar.prototype.DelTemplateParams = function(id)
	{
		var
			arAllProps = oTaskbar.GetParams({id: id}),
			arPropsVals = arAllProps.paramvals,
			len = window.arComp2TemplateProps.length,
			name, i;

		for (i = 0; i < len; i++)
		{
			name = window.arComp2TemplateProps[i].param_name;
			if (arPropsVals[name] != undefined)
				delete arPropsVals[name];
		}
		arAllProps.paramvals = arPropsVals;
		oTaskbar.SetParams({id: id, params: arAllProps});
		window.arComp2TemplateProps = [];
	}

	BXComponents2Taskbar.prototype.UnParseElement = function(node)
	{
		if (!window.arVA)
			window.arVA = [];

		var bxTag = oTaskbar.pMainObj.GetBxTag(node.arAttributes.id);
		if (!bxTag || bxTag.tag != 'component2')
			return false;

		var
			arAllProps = oTaskbar.GetParams({id: node.arAttributes["id"]}),
			arPropsVals = arAllProps.paramvals,
			res = "<?$APPLICATION->IncludeComponent(\n" +
				"\t\"" + arAllProps.name+"\",\n" +
				"\t\"" + (arAllProps.template ? arAllProps.template : "") + "\",\n";

		if (arPropsVals)
		{
			res += "\tArray(\n";
			var _len1 = "SEF_URL_TEMPLATES_".length;
			var _len2 = "VARIABLE_ALIASES_".length;
			var _SUT, _VA, lio, templ_key, var_fey, _count;
			var params_exist = false;
			var __val, __len;

			for (var i in arPropsVals)
			{
				try{
					if (!params_exist)
						params_exist = true;
					if (typeof(arPropsVals[i]) == 'function')
						continue;
					else if (typeof(arPropsVals[i]) == 'string')
						arPropsVals[i] = JS_stripslashes(arPropsVals[i]);
					else if (typeof(arPropsVals[i]) == 'object')
					{
						__val = 'array(';
						__len = 0;
						for (var _i in arPropsVals[i])
						{
							if (typeof(arPropsVals[i][_i]) == 'string')
							{
								__len++;
								__val += '"'+JS_stripslashes(arPropsVals[i][_i])+'",';
							}
						}
						if (__len > 0)
							__val = __val.substr(0,__val.length-1)+')';
						else
							__val += ')';

						arPropsVals[i] = __val;
					}

					if (isYes(arPropsVals["SEF_MODE"]))
					{
						//*** Handling SEF_URL_TEMPLATES in SEF = ON***
						if(i.substr(0,_len1) == "SEF_URL_TEMPLATES_")
						{
							_val = arPropsVals[i];
							__k = i.substr(_len1);
							arVA[__k] = catchVariableAliases(_val);

							if (!_SUT)
							{
								res += "\t\t\""+i.substr(0,_len1-1)+"\" => Array(\n"
								_SUT = true;
							}
							res += "\t\t\t\"" + i.substr(_len1) + "\" => ";
							if (isPHPBracket(arPropsVals[i]))
								res += trimPHPBracket(arPropsVals[i]);
							else
								res += "\"" + JS_addslashes(arPropsVals[i])+"\"";
							res += ",\n";
							continue;
						}
						else if (_SUT)
						{
							lio = res.lastIndexOf(",");
							res = res.substr(0,lio)+res.substr(lio+1);
							_SUT = false;
							res += "\t\t),\n";
						}

						//*** Handling  VARIABLE_ALIASES  in SEF = ON***
						if(i.substr(0,_len2)=="VARIABLE_ALIASES_")
							continue;

					}
					else if(arPropsVals["SEF_MODE"]=="N")
					{
						//*** Handling SEF_URL_TEMPLATES in SEF = OFF ***
						if (i.substr(0,_len1)=="SEF_URL_TEMPLATES_" || i=="SEF_FOLDER")
							continue;

						//*** Handling VARIABLE_ALIASES  in SEF = OFF ***
						if(i.substr(0,_len2)=="VARIABLE_ALIASES_")
						{
							if (!_VA)
							{
								res += "\t\t\""+i.substr(0,_len2-1)+"\" => Array(\n";
								_VA = true;
							}
							res += "\t\t\t\"" + i.substr(_len2) + "\" => \"" + JS_addslashes(arPropsVals[i]) + "\",\n";
							continue;
						}
						else if (_VA)
						{
							lio = res.lastIndexOf(",");
							res = res.substr(0,lio)+res.substr(lio+1);
							_VA = false;
							res += "\t\t),\n";
						}
					}

					res += "\t\t\""+i+"\" => ";
					if (isPHPBracket(arPropsVals[i]))
						res += trimPHPBracket(arPropsVals[i]);
					else if (arPropsVals[i].substr(0, 6).toLowerCase() == 'array(')
						res += arPropsVals[i];
					else
						res += '"' + JS_addslashes(arPropsVals[i]) + '"';
					res += ",\n";

				}catch(e){continue;}
			}

			if (_VA || _SUT)
			{
				lio = res.lastIndexOf(",");
				res = res.substr(0,lio)+res.substr(lio+1);
				_VA = false;
				_SUT = false;
				res += "\t\t),\n";
			}

			if (isYes(arPropsVals["SEF_MODE"]))
			{
				res += "\t\t\"VARIABLE_ALIASES\" => Array(\n";

				if (arVA)
				{
					for (templ_key in arVA)
					{
						if (typeof(arVA[templ_key]) != 'object')
							continue;
						res += "\t\t\t\""+templ_key+"\" => Array(";
						_count = 0;
						for (var_key in arVA[templ_key])
						{
							if (typeof(arVA[templ_key][var_key]) != 'string')
								continue;
							_count++;
							res += "\n\t\t\t\t\""+var_key+"\" => \""+arVA[templ_key][var_key]+"\",";
						}
						if (_count>0)
						{
							lio = res.lastIndexOf(",");
							res = res.substr(0,lio)+res.substr(lio+1);
							res += "\n\t\t\t),\n";
						}
						else
							res += "),\n";
					}
				}

				res += "\t\t),\n";
			}

			if (params_exist)
			{
				lio = res.lastIndexOf(",");
				res = res.substr(0,lio) + res.substr(lio+1);
			}
			res += "\t)";
		}
		else
		{
			res += "Array()"
		}

		if (arAllProps.parentComponent !== false || arAllProps.exParams !== false)
		{
			var pc = arAllProps.parentComponent;
			if (!pc || pc.toLowerCase() == '={false}')
			{
				res += ",\nfalse";
			}
			else
			{
				if (isPHPBracket(pc))
					res += ",\n" + trimPHPBracket(pc);
				else
					res += ",\n'" + pc + "'";
			}

			if (arAllProps.exParams !== false && typeof arAllProps.exParams == 'object')
			{
				res += ",\nArray(";
				for (var i in arAllProps.exParams)
				{
					if (typeof(arAllProps.exParams[i]) == 'string')
						res += "\n\t'" + i + "' => '" + JS_stripslashes(arAllProps.exParams[i]) + "',";
				}
				if (res.substr(res.length - 1) == ',')
					res = res.substr(0, res.length - 1) + "\n";
				res += ")";
			}
		}
		res += "\n);?>";
		if (window.lca)
		{
			var key = str_pad_left(++_$compLength, 4, '0');
			_$arComponents[key] = res;
			return '#COMPONENT'+String(key)+'#';
		}
		else
			return res;
	}

	BXComponents2Taskbar.prototype.GetPropGroupDataCell = function (name, title, oCont, arParams)
	{
		var _oTable = document.createElement('TABLE');
		_oTable.className = 'bxpropgroup';
		var rowTitle = _oTable.insertRow(-1);
		var c = rowTitle.insertCell(-1);
		c.style.width = '11px';
		c.appendChild(this.pMainObj.CreateElement("IMG", {src: one_gif_src, className: 'tskbr_common bx_btn_tabs_plus_big'}));
		c = rowTitle.insertCell(-1);
		c.style.width = '2000px';
		c.innerHTML = (title) ? BXReplaceSpaceByNbsp(title) : "";

		var rowData = _oTable.insertRow(-1);
		c = rowData.insertCell(-1);
		c.colSpan = 2;
		c.id = '__bxpropgroup_dc_' + name + oTaskbar.dialog_suffix;

		var compName = arParams[0];
		var _this = this;
		rowTitle.__bxhidden = false;
		rowTitle.id = '__bxpropgroup_tr_' + name + oTaskbar.dialog_suffix;
		rowTitle.className = "bxtskbrprp_title_d";
		rowTitle.onclick = function(){_this.HidePropGroup(name, !this.__bxhidden, [compName]);};
		oCont.appendChild(_oTable);

		if (!arComp2PropGroups[compName])
		{
			arComp2PropGroups[compName] = {};
			arComp2PropGroups[compName][name] = false;
			oTaskbar.HidePropGroup(name, false, arParams);
		}
		else
			oTaskbar.HidePropGroup(name, ((arComp2PropGroups[compName][name]===false) ? true : false), arParams);
		return c;
	}

	BXComponents2Taskbar.prototype.HidePropGroup = function (groupName, bHide, arParams)
	{
		if (!arParams)
			arParams = [];

		var compName = arParams[0];
		arComp2PropGroups[compName][groupName] = !bHide;

		var
			titleRow = BX('__bxpropgroup_tr_' + groupName + oTaskbar.dialog_suffix),
			dataCell = BX('__bxpropgroup_dc_' + groupName + oTaskbar.dialog_suffix);

		if (titleRow && dataCell)
		{
			if (bHide)
			{
				dataCell.style.display = GetDisplStr(0);
				titleRow.__bxhidden = true;
				titleRow.className = "bxtskbrprp_title_d";
				titleRow.cells[0].firstChild.className = 'tskbr_common bx_btn_tabs_plus_big';
			}
			else
			{
				dataCell.style.display = GetDisplStr(1);
				titleRow.__bxhidden = false;
				titleRow.className = "bxtskbrprp_title_a";
				titleRow.cells[0].firstChild.className = 'tskbr_common bx_btn_tabs_minus_big';
			}
		}
	}

	BXComponents2Taskbar.prototype.OnElementClick = function (oEl, arEl)
	{
		if (!this.pMainObj.oPropertiesTaskbar)
			return;

		if (!arEl.screenshots)
			arEl.screenshots = [];

		_pTaskbar = this.pMainObj.oPropertiesTaskbar;
		BX.cleanNode(_pTaskbar.pCellProps);

		//****** DISPLAY TITLE *******
		var compName = arEl.name;
		var compTitle = arEl.title;
		var compDesc = arEl.params.DESCRIPTION;
		var bComplex = isYes(arEl.complex);

		var tCompTitle = document.createElement("TABLE");
		tCompTitle.className = "componentTitle";
		var row = tCompTitle.insertRow(-1);
		var cell = row.insertCell(-1);
		cell.innerHTML = "<SPAN class='title'>"+compTitle+"  ("+compName+")</SPAN><BR /><SPAN class='description'>"+(bComplex ? BX_MESS.COMPLEX_COMPONENT : "")+compDesc+"</SPAN>";
		cell.className = "titlecell";
		cell.width = "100%";
		var _helpCell = row.insertCell(-1);
		_helpCell.className = "helpicon";

		_pTaskbar.pCellProps.appendChild(tCompTitle);
		var oDivSS;
		for (var i=0; i<arEl.screenshots.length; i++)
		{
			oDivSS = document.createElement("DIV");
			oDivSS.className = "scrshot";
			var imgSS = oTaskbar.pMainObj.CreateElement("IMG", {src: arEl.screenshots[i], title: compTitle, alt: compTitle});
			oDivSS.appendChild(imgSS);
			_pTaskbar.pCellProps.appendChild(oDivSS);
			oDivSS = null;
		}

		oDivSS = null;
		_helpCell = null;
		_helpicon = null;
		tCompTitle = null;
	}

	BXComponents2Taskbar.prototype.OnSaveLCA = function()
	{
		var sContent = this.pMainObj.GetContent();
		sContent = LCAContentParser(sContent, this.pMainObj, true);
		this.pMainObj.pValue.value = sContent;
	};

	BXComponents2Taskbar.prototype.PrepareParamvals = function(arParamvals)
	{
		var key, val;
		for (var key in arParamvals)
		{
			val = arParamvals[key];
			if (typeof val == 'function' || typeof val == 'object')
				continue;

			if (isPHPBracket(val))
			{
				val = trimPHPBracket(val);
				if (val.substr(0, 6).toLowerCase() == 'array(')
					arParamvals[key] = _BXStr2Arr(val, true);
			}
		}
		return arParamvals;
	};

	BXComponents2Taskbar.prototype.DialogInit = function()
	{
		window.arEditorFastDialogs.component2 = function(pObj)
		{
			var str = '<div id="bxc2_dialog_prop_div_' + oTaskbar.pMainObj.name + '" class="c2dialog_propdiv"></div>';

			var OnSave = function(t)
			{
				oTaskbar.SetParams({id: pObj.realComponentId, params: oTaskbar.GetParams({id: 'temp_c2_dialog_id'})});
				// Rerender component with new params
				if (pObj.pMainObj.bRenderComponents)
					oTaskbar.C2Parser.ReRenderComponent(pObj.realComponentId, pObj.params.pElement);
				else
					BXSelectRange(window.oPrevRange, pObj.pMainObj.pEditorDocument, pObj.pMainObj.pEditorWindow);
				pObj.pMainObj.OnEvent("OnSelectionChange", ['always']);
			};

			var
				w = parseInt(window.comp2_dialog_size.width),
				h = parseInt(window.comp2_dialog_size.height);

			return {
				title: BX_MESS.Comp2Props,
				innerHTML : str,
				width: w,
				height: h,
				resizable: true,
				resize_id: 'bx_edc2_' + pObj.pMainObj.name,
				min_height: 200,
				min_width: 400,
				OnLoad: function()
				{
					var
						div = window.oBXEditorDialog.PARTS.CONTENT_DATA,
						id = pObj.params.pElement.id,
						pElement_temp = pObj.pMainObj.CreateElement('IMG', {id: 'temp_c2_dialog_id'});

					pObj.pMainObj.SetBxTag(false, {id: 'temp_c2_dialog_id', tag: 'component2'});
					pObj.pContDiv = BX('bxc2_dialog_prop_div_' + oTaskbar.pMainObj.name);

					BX.addClass(div, "c2dialog_cnt");
					pObj.pMainObj.pC2PropsDialog = pObj;
					oTaskbar.bPropDialogOpened = true;

					pObj.realComponentId = id;
					pObj.params.pElement_temp = pElement_temp;

					// Save cur params in temp object
					oTaskbar.SetParams({id: 'temp_c2_dialog_id', params: oTaskbar.GetParams({id: id})});

					// Build component properties
					oTaskbar.ShowProps(true, {pMainObj : pObj.pMainObj, pCellProps : pObj.pContDiv, bDialogMode : true}, pElement_temp, false);

					if (!pObj.pMainObj.bRenderComponents)
						window.oPrevRange = BXGetSelectionRange(pObj.pMainObj.pEditorDocument, pObj.pMainObj.pEditorWindow);

					window.oBXEditorDialog.SetButtons([
						new BX.CWindowButton(
						{
							title: BX_MESS.TBSave,
							className: 'adm-btn-save',
							action: function()
							{
								OnSave();
								window.oBXEditorDialog.Close();
							}
						}),
						window.oBXEditorDialog.btnCancel
					]);

					BX.addCustomEvent(window.oBXEditorDialog, 'onWindowUnRegister', function()
					{
						oTaskbar.bPropDialogOpened = false;
						if (window.oBXEditorDialog && window.oBXEditorDialog.DIV && window.oBXEditorDialog.DIV.parentNode)
							window.oBXEditorDialog.DIV.parentNode.removeChild(window.oBXEditorDialog.DIV);
					});
				}
			};
		}
	};
}

function C2Parser(pMainObj, C2Taskbar)
{
	this.pMainObj = pMainObj;
	this.C2Taskbar = C2Taskbar;

	this.arComponentsCSS = {};
	this.arComponentsSource = {};
	this.sCSS = '';
	this.bInited = false;

	if (pMainObj.bRenderComponents)
		this.InitRenderingSystem();
}

C2Parser.prototype =
{
	InitRenderingSystem : function()
	{
		this.bInited = true;
		this.sCSS = "\n"+
		".bxc2-block{border: 1px dotted #E4E4E4 !important; margin:2px !important;}\n" +
		".bxc2-block-selected{border: 1px solid #000 !important;}\n" +
		".bxc2-block *{-moz-user-select:none; cursor: default !important;}\n" +
		".bxc2-block-icon{padding: 0!important; margin:0!important;}\n" +
		".bxc2-cont-block{padding: 4px;}\n" +
		".bxc2-del{width: 21px; height: 18px; cursor: pointer !important; background: url(" + image_path + "/c2del.gif);}\n" +
		".bxc2-flip{width: 18px; height: 18px; cursor: pointer !important; background: url(" + image_path + "/c2flip.gif);}\n" +
		".bxc2-flop{width: 18px; height: 18px; cursor: pointer !important; background: url(" + image_path + "/c2flop.gif);}\n" +
		".bxc2-move{width: 12px; height: 18px; cursor: move !important; background: url(" + image_path + "/c2move.gif) 0 1px; padding: 0!important; margin:0!important;}\n" +
		".bxc2-block-tbl{width: 100%; height: 18px; background-color: #E4E4E4; border-collapse: collapse;}\n" +
		".bxc2-block-tbl td{padding: 0 0 0 0px; font-size: 13px; color: #404040; border-width: 0px !important; white-space: nowrap !important;}\n" +
		".bx-bogus-inp{width: 5px; position: absolute;}\n" +
		".bxc2-block-selected .bxc2-block-tbl td{font-weight: bold; color: #000; background-color: #C0C0C0;}\n";

		this.pMainObj.AddEventHandler("OnChangeView", this.COnChangeView, this);
		this.pMainObj.AddEventHandler("OnSelectionChange", this.COnSelectionChange, this);

		if (this.pMainObj.sEditorMode == 'html') // It's  always true at the start
			this.COnChangeView();
	},

	COnChangeView : function()
	{
		if (this.pMainObj.sEditorMode == 'html' || (this.pMainObj.sEditorMode == 'split' && this.pMainObj.sEditorSplitMode != 'code'))
		{
			var _this = this;
			window['COnKeyDown' + this.pMainObj.name] = function(e){_this.COnKeyDown(e);};
			window['COnMouseDown' + this.pMainObj.name] = function(e){_this.COnMouseDown(e);};
			window['COnDragEnd' + this.pMainObj.name] = function(e){_this.COnDragEnd(e);};

			if (!BX.browser.IsIE())
				addAdvEvent(this.pMainObj.pEditorDocument, 'dragdrop', window['COnDragEnd' + this.pMainObj.name]);

			addAdvEvent(this.pMainObj.pEditorDocument, 'keydown', window['COnKeyDown' + this.pMainObj.name]);
			addAdvEvent(this.pMainObj.pEditorDocument, 'mousedown', window['COnMouseDown' + this.pMainObj.name]);

			this.GetRenderedContent({bAllContent: true});
			this.pMainObj.pParser.AppendCSS(this.sCSS);
		}
		else
		{
			this.DeSelectComponent(false, false);
			if (this.pMainObj.oPropertiesTaskbar)
			{
				BX.cleanNode(this.pMainObj.oPropertiesTaskbar.pCellProps);
				this.pMainObj.oPropertiesTaskbar.OnSelectionChange('always', this.pMainObj.pEditorDocument.body);
			}
		}
	},

	COnMouseDown : function(e)
	{
		this.__bMouseDownComp = false;
		this.pMainObj.__bMouseDownComp = false;
		var
			bFlip = false,
			bDel = false,
			bMove = false,
			pElement, pElementTemp, tagName, cn;
		if (!e)
			e = this.pMainObj.pEditorWindow.event;
		if (e.target)
			pElement = e.target;
		else if (e.srcElement)
			pElement = e.srcElement;
		if (pElement.nodeType == 3) // defeat Safari bug
			pElement = pElement.parentNode;

		while(pElement && (pElementTemp = pElement.parentNode) != null)
		{
			if(pElementTemp.nodeType!=1 || !pElement.tagName)
			{
				pElement = pElementTemp;
				continue;
			}
			tagName = pElement.tagName.toLowerCase();
			cn = pElement.className;
			if (tagName == 'img' && cn.indexOf('bxc2-block-icon') != -1)
			{
				bDel = cn.indexOf('bxc2-del') != -1; // Delete
				bFlip = cn.indexOf('bxc2-flip') != -1; // Flip-flop
				bMove = cn.indexOf('bxc2-move') != -1; // Start drag
			}

			if(tagName == 'div' && cn.indexOf('bxc2-block') != -1)
			{
				if (bFlip)
				{
					this.FlipComponent(pElement);
				}

				if (bDel)
					this.DeleteComponent(pElement);
				if (bMove)
				{
					this.pDraggedElementId = pElement.id;
					break;
				}

				this.__bMouseDownComp = true;
				this.pMainObj.__bMouseDownComp = true;
				if (BX.browser.IsIE())
					this._IEClearStupidSelection(pElement);

				// Select component;
				this.SelectComponent(pElement);
				return BX.PreventDefault(e);
			}
			pElement = pElementTemp;
		}
		return true;
	},

	_IEClearStupidSelection : function(pEl)
	{
		try{
		var
			_this = this,
			id = pEl.id,
			pWin = this.pMainObj.pEditorWindow,
			pDoc = this.pMainObj.pEditorDocument;

		var dd = pDoc.getElementById('dd_toggle_' + id);
		if (dd && dd.parentNode)
		{
			var inp = this.pMainObj.CreateEditorElement("INPUT", {className: 'bx-bogus-inp', id: id + '_bogus_input'});
			dd.parentNode.insertBefore(inp, dd);
			setTimeout(function()
			{
				try{
					if (inp && inp.parentNode)
					{
						inp.focus();
						inp.parentNode.removeChild(inp);
					}
				}
				catch(e)
				{
					inp = _this.pMainObj.pEditorDocument.getElementById(id + '_bogus_input');
					if (inp)
					{
						inp.focus();
						inp.parentNode.removeChild(inp);
					}
				}
			}, 50);
		}
		}catch(e){};
	},

	COnDragEnd : function(e)
	{
		if (!this.pDraggedElementId)
			return;

		var
			o, par, bInside, pDel,
			id = this.pDraggedElementId,
			ddid = 'dd_toggle_' + id,
			_this = this;

		// Rerender component into the dragged toggle position
		setTimeout(function()
		{
			var
				arImgs = _this.pMainObj.pEditorDocument.getElementsByTagName('IMG'),
				el, i, l = arImgs.length;

			for (i = 0; i < l; i++)
			{
				el = arImgs[i];
				if (el && el.id == ddid)
				{
					// Check parent
					o = el;
					bInside = false;
					while(par = o.parentNode)
					{
						if(par.tagName && par.tagName.toUpperCase() == 'DIV' && par.className && par.className.indexOf('bxc2-block') != -1)
						{
							if (par.id != id) // Element inside other component
								pDel = el;
							bInside = true;
							break;
						}
						o = par;
					}

					if (!bInside)
						_this.MoveRenderedComponent(el, id);
				}
			}

			if (pDel)
				pDel.parentNode.removeChild(pDel);
		}, 5);
	},

	COnKeyDown : function(e)
	{
		var pElement, pElementTemp, tn, cn, _this = this;
		if (!e)
			e = this.pMainObj.pEditorWindow.event;
		if (e.target)
			pElement = e.target;
		else if (e.srcElement)
			pElement = e.srcElement;
		if (pElement.nodeType == 3)
			pElement = pElement.parentNode;

		if (this.lastSelectedComponent)
		{
			if (e.keyCode == 27) // Esc - deselect component
			{
				_this.DeSelectComponent(el);
			}
			else if (e.keyCode == 37) // left arrow
			{
				// Deselect and focus before
			}
			else if (e.keyCode == 39) // right arrow
			{
				// Deselect and focus after
			}
			else
			{
				var el = this.lastSelectedComponent;
				try{
					this.pMainObj.SelectElement(el);
				}catch(e){}
				setTimeout(function(){
					if (el && el.parentNode)
					{
						var tbl = el.getElementsByTagName('TABLE');
						if (tbl.length <= 0)
						{
							var innerHTML = el.innerHTML.toString();
							if (innerHTML.indexOf('>') == -1) // text content
							{
								var txt = _this.pMainObj.pEditorDocument.createTextNode(innerHTML);
								el.parentNode.insertBefore(txt, el);
							}
							_this.DeleteComponent(el);
						}
					}
				}, 1);
			}
		}

		while(pElement && (pElementTemp = pElement.parentNode) != null)
		{
			if(pElementTemp.nodeType!=1 || !pElement.tagName)
			{
				pElement = pElementTemp;
				continue;
			}
			tn = pElement.tagName.toLowerCase();
			cn = pElement.className;
			if(tn == 'div' && cn.indexOf('bxc2-block') != -1)
			{
				return BX.PreventDefault(e);
			}
			pElement = pElementTemp;
		}
	},

	COnSelectionChange : function(sReloadControl)
	{
		if (this.__bMouseDownComp || this.__bPreventComponentDeselect)
			return false;
		this.DeSelectComponent();
	},

	GetRenderedContent : function(P)
	{
		if (!this.pMainObj.bRenderComponents)
			return;

		var
			url = '/bitrix/admin/fileman_comp2_render.php?sessid=' + BX.bitrix_sessid() + '&site=' + BXSite,
			data = {stid: this.pMainObj.templateID || ''},
			_this = this;

		if (!P.bReRender)
			P.bReRender = false;

		if (P.bAllContent) // send all editor content with all components
		{
			data.source = this.pMainObj.GetContent();
		}
		else if (P.name) // get rendered content of the some component
		{
			data.name = P.name;
			if (P.template)
				data.template = P.template;
			// Get params
			if (P.paramvals)
				data.params = this.C2Taskbar.PrepareParamvals(P.paramvals);
		}

		var calbackFunc = function(result)
		{
			if (_this.pMainObj.IsSessionExpired(result))
			{
				if (!P.bReqestReply)
				{
					P.bReqestReply = true;
					_this.GetRenderedContent(P);
				}
				else
				{
					alert('Error: Session expired');
				}
			}

			var s = '';
			//try{
			setTimeout(function ()
			{
				if (result.length <= 0)
					result  = '#BX_RENDERED_COMPONENT##BX_RENDERED_COMPONENT#';

				if (window.arUsedCSS && window.arUsedCSS.length > 0)
				{
					_this.LoadComponentCSS(window.arUsedCSS);
					window.arUsedCSS = null;
				}

				if(P.bAllContent)
				{
					var
						_arC2RenderedContent = [],
						c2Name, c2List, i, l, id, ind, oEl;
					result.replace(/(#BX_RENDERED_COMPONENT_(\d+?)#)((?:\S|\s)*?)\1/ig, function(s, b1, b2, b3){_arC2RenderedContent.push(b3); return '';});

					// Rendering components in array
					for (c2Name in arComponents2)
					{
						c2List = arComponents2[c2Name];
						l = c2List.length;
						if (typeof c2List != 'object' || !c2List.length)
							continue;

						for (i = 0; i < l; i++)
						{
							id = c2List[i].id;
							ind = c2List[i].ind;

							oEl = _this.pMainObj.pEditorDocument.getElementById(id);
							s = _arC2RenderedContent[ind];
							_this.RenderComponent(id, s, false, oEl);
						}
					}
				}
				else if (P.name && P.pElement)
				{
					if (result.indexOf('#BX_RENDERED_COMPONENT#') != -1)
					{
						s = result.replace(/(#BX_RENDERED_COMPONENT#)((?:\S|\s)*?)\1/ig, "$2");
						s = s.replace("#BX_RENDERED_COMPONENT#", "");
					}
					oEl = _this.RenderComponent(P.pElement.id, s, P.bReRender, P.pElement);

					if (P.bSelect && oEl)
					{
						// Only for FF: Clear white markers after component's icon replacing
						if (!BX.browser.IsIE())
							_this.pMainObj.pEditorDocument.execCommand('RemoveFormat', false, null);
						_this.SelectComponent(oEl);
					}
				}
			}, 10);
			//}catch(e) {alert('Error >> RenderComponents');}
		}

		BX.ajax.post(url, data, calbackFunc);
	},

	RenderComponent : function(id, source, bReRender, repEl)
	{
		this.arComponentsSource[id] = source;

		if (typeof source != 'string' || source.trim().length <= 0) // Component return empty result
		{
			if (bReRender)
				source = BX_MESS.Comp2EmptyResult;
			else
				return this.StopWaiting(id, repEl);
		}

		var
			_this = this,
			pContentBlock = false, pHeader,
			title = BX_MESS.DefComp2Title,
			oEl = repEl || this.pMainObj.pEditorDocument.getElementById(id);

		if (!oEl)
			return false;

		if (bReRender)
		{
			var
				arDivs = oEl.getElementsByTagName('DIV'),
				pBlock = oEl,
				i, l = arDivs.length,
				arCh = pBlock.childNodes,
				node, l2 = arCh.length;

			pBlock.style.width = null;

			for (i = 0; i < l; i++)
			{
				if (arDivs[i].className == 'bxc2-cont-block')
				{
					pContentBlock = arDivs[i];
					break;
				}
			}

			for (i = 0; i < l2; i++)
			{
				node = arCh[i];
				if (node.nodeType == 1 && node.nodeName.toUpperCase() == 'TABLE' && node.className == 'bxc2-block-tbl')
				{
					pHeader = node;
					break;
				}
			}

			if (!pContentBlock)
				return this.RenderComponent(id, source, false);
		}
		else
		{
			if (this.pMainObj.arComponents[id] && this.pMainObj.arComponents[id].name && window.as_arComp2Elements[this.pMainObj.arComponents[id].name])
				title = window.as_arComp2Elements[this.pMainObj.arComponents[id].name].title;

			var pBlock = this.pMainObj.CreateEditorElement("DIV", {id: id, className: 'bxc2-block'});
			pHeader = this.pMainObj.CreateEditorElement("TABLE", {className: 'bxc2-block-tbl'});

			var r = pHeader.insertRow(-1);
			var c0 = r.insertCell(-1); // move
			c0.style.width = '18px';
			var pMoveIcon = c0.appendChild(this.pMainObj.CreateEditorElement("IMG", {id: 'dd_toggle_' + id, src: one_gif_src, className: 'bxc2-block-icon bxc2-move'}));
			pMoveIcon.title = BX_MESS.MoveComponent;

			var c1 = r.insertCell(-1); // title
			c1.className = 'bxc2-block-title';
			c1.innerHTML = BX_MESS.Comp2Name + ': ' + title;

			var c2 = r.insertCell(-1); // Buttons block
			c2.style.textAlign = 'right';
			//var pPropIcon = c2.appendChild(this.pMainObj.CreateEditorElement("IMG", {src: one_gif_src, className: 'bxc2-block-icon bxc2-prop'}));
			c2.appendChild(this.pMainObj.CreateEditorElement("IMG", {src: one_gif_src, className: 'bxc2-block-icon bxc2-flip', title: BX_MESS.FlipComponent}));

			c2.appendChild(this.pMainObj.CreateEditorElement("IMG", {src: one_gif_src, className: 'bxc2-block-icon bxc2-del', title: BX_MESS.DelComponent}));

			pBlock.appendChild(pHeader);
			pContentBlock = pBlock.appendChild(this.pMainObj.CreateEditorElement("DIV", {className: 'bxc2-cont-block'}));

			oEl.parentNode.insertBefore(pBlock, oEl); // Insert rendered block
			oEl.parentNode.removeChild(oEl); // Remove yelow pill

			this.pMainObj.nLastDragNDropElement = false;
			pBlock.style.MozUserSelect = 'none'; // For mozilla

			if (BX.browser.IsIE())
			{
				pMoveIcon.ondragend = window['COnDragEnd' + this.pMainObj.name];
				pBlock.ondragend = function(){_this._IEpBlockOnDragEnd(id);};
			}
		}

		try
		{
			pContentBlock.innerHTML = source;
		}
		catch(e) //IE BUG WORKAROUND:  "Unknown runtime error" when using innerHTML
		{
			var _p = this.pMainObj.CreateEditorElement("DIV", {className: 'bxc2-cont-block'});
			_p.innerHTML = source;
			pContentBlock.parentNode.insertBefore(_p, pContentBlock);
			pContentBlock.parentNode.removeChild(pContentBlock); //
			pContentBlock = _p;
		}
		this.arComponentsSource[id] = source;

		// Set width correct width depending on content
		this.ResizeAfterRendering(pBlock, pContentBlock, pHeader);
		return pBlock;
	},

	_IEpBlockOnDragEnd : function(id)
	{
		var _this = this;
		setTimeout(function()
		{
			var
				oEl = _this.pMainObj.pEditorDocument.getElementById(id),
				otherComp = BXFindParentByTagName(oEl, 'DIV', 'bxc2-block');

			if (otherComp) // Component dragget into another
			{
				var tmpIcon = _this.pMainObj.CreateEditorElement("IMG", {src: one_gif_src}); // Create simple image
				otherComp.parentNode.insertBefore(tmpIcon, otherComp); // Put element before parent component
				_this.MoveRenderedComponent(tmpIcon, id);
			}
			else //Rerender content after system dragging
			{
				_this.RenderComponent(id, _this.arComponentsSource[id], oEl);
			}
		}, 100);

	},

	StartWaiting: function(pIcon)
	{
		if (src = pIcon.getAttribute('src'))
			this.pMainObj.Add2BxTag(pIcon, {'_src': src});
		pIcon.src = c2wait_path;
	},

	StopWaiting : function(id, repEl)
	{
		var pEl = repEl || this.pMainObj.pEditorDocument.getElementById(id);
		if (pEl && pEl.nodeName.toLowerCase() == 'img')
		{
			var oTag = this.pMainObj.GetBxTag(pEl);
			if (oTag.params && oTag.params._src)
				pEl.src = oTag.params._src;
		}
		return pEl;
	},

	ReRenderComponent : function(id, pEl)
	{
		if (this.pMainObj.bRenderComponents)
		{
			if (this.C2Taskbar.bPropDialogOpened) // We rerender component later - when close dialog
				return;

			if (!pEl)
				pEl = this.pMainObj.pEditorDocument.getElementById(id);

			var props = this.pMainObj.arComponents[id];
			this.GetRenderedContent({name: props.name, pElement: pEl, template: props.template || '', paramvals: props.paramvals || false, bSelect: true, bReRender: true});
		}
	},

	ResizeAfterRendering : function(pBlock, pContentBlock, pHeader)
	{
		setTimeout(function()
		{
			var
				blockWidth = parseInt(pBlock.offsetWidth) - 20,
				arCh = pContentBlock.childNodes,
				maxWidth = 0,
				node, w, i, l = arCh.length;

			for (i = 0; i < l; i++) // For each child in content block
			{
				node = arCh[i];
				if (node && node.nodeType == 1) // If it's html element
				{
					w = parseInt(node.offsetWidth);
					if (!isNaN(w) && w > maxWidth)
						maxWidth = w;
				}
			}

			if (maxWidth > 0 && (blockWidth - maxWidth) > 20)
				pBlock.style.width = (maxWidth + 20) + 'px';

			if (maxWidth > 8)
				pContentBlock.style.width = (maxWidth - 8) + 'px';

			setTimeout(function()
			{
				if (pHeader)
				{
					var headerWidth = parseInt(pHeader.offsetWidth);
					if (!isNaN(headerWidth) && headerWidth > maxWidth)
						pBlock.style.width = (headerWidth) + 'px';
						//pBlock.style.width = (headerWidth + 20) + 'px';

					if (headerWidth > 8)
						pContentBlock.style.width = (headerWidth - 8) + 'px';
				}
			}, 20);

		}, 300);
	},

	MoveRenderedComponent : function(el, id)
	{
		var pEl = this.pMainObj.pEditorDocument.getElementById(id);
		pEl.parentNode.removeChild(pEl);
		this.RenderComponent(id, this.arComponentsSource[id], false, el);
	},

	SelectComponent : function(pEl)
	{
		//try{
		if (this.lastSelectedComponent)
		{
			if (pEl.id == this.lastSelectedComponent.id) // already selected
				return;
			this.DeSelectComponent(false, false);
		}

		if (pEl.nodeName.toLowerCase() != 'img')
			pEl.className = 'bxc2-block bxc2-block-selected';
		this.lastSelectedComponent = pEl;
		this.pMainObj.SetFocus();

		var _this = this;
		setTimeout(function()
		{
			_this.pMainObj.oPropertiesTaskbar.OnSelectionChange('always', pEl);
			_this.__bPreventComponentDeselect = false;
		}, 250);
		setTimeout(function(){_this.__bMouseDownComp = false;}, 500);
		setTimeout(function(){_this.pMainObj.__bMouseDownComp = false;}, 500);
		//}catch(e){}
	},

	DeSelectComponent : function(pEl, bCleanPropTaskbar)
	{
		try{ // For IE permission denied stupid errors
		if (!pEl)
			pEl = this.lastSelectedComponent;
		if (!pEl || !pEl.nodeName)
			return true;
		if (pEl.nodeName.toLowerCase() != 'img')
			pEl.className = 'bxc2-block';
		this.lastSelectedComponent = false;
		SETTINGS[obj.pMainObj.name].arTaskbarSettings['BXPropertiesTaskbar'].show = true; // hack
		if (bCleanPropTaskbar !== false)
			this.pMainObj.oPropertiesTaskbar.OnSelectionChange('always');
		}catch(e){}
	},

	FlipComponent : function(pEl)
	{
		var pContentBlock = BX.findChild(pEl, {tagName: 'DIV', className: 'bxc2-cont-block'}, false);
		if (!pContentBlock)
			return;

		var pBut = BX.findChild(pEl, {tagName: 'IMG', className: 'bxc2-flip'}, true);
		if (pContentBlock.style.display == 'none')
		{
			pContentBlock.style.display = 'block';
			if (pBut)
			{
				BX.removeClass(pBut, 'bxc2-flop');
				pBut.title = BX_MESS.FlipComponent;
			}
		}
		else
		{
			pContentBlock.style.display = 'none';
			if (pBut)
			{
				BX.addClass(pBut, 'bxc2-flop');
				pBut.title = BX_MESS.FlopComponent;
			}
		}
	},

	DeleteComponent : function(pEl)
	{
		// TODO: Del from array
		var id = pEl.id;
		//this.arComponents[id] = null;
		//this.arShadowedControls[id] = null;
		pEl.parentNode.removeChild(pEl);
		this.lastSelectedComponent = false;
	},

	LoadComponentCSS : function(arCSS)
	{
		var
			i, l = arCSS.length, css,
			_this = this, cssReq;

		for (i = 0; i < l; i++)
		{
			css = arCSS[i];
			if (this.arComponentsCSS[css])
				continue;

			this.arComponentsCSS[css] = css;
			cssReq = new JCHttpRequest();
			cssReq.Action = function(styles){
				var path2css = css.substr(0, css.lastIndexOf('/'));
				// Replace relative urls to absolute
				styles = styles.replace(/url\((?:"|\'*)([^\/]{1}.*?)(?:"|\'*)\)/ig, "url(\"" + path2css + "/" + "$1" + "\")");
				setTimeout(function(){_this.AddCSSToEditorFrame(styles);}, 10);
			};
			cssReq.Send(css + '?v=s' + parseInt(Math.random() * 100000)); // Request css file
		}
	},

	AddCSSToEditorFrame : function(styles)
	{
		if (styles.toLowerCase().indexOf('</html>') != -1) // Return if it's html page
			return false;
		this.sCSS += styles + "\n";
		this.pMainObj.pParser.AppendCSS(styles);
	}
}



function BXCheckForComponent2(_str, pMainObj, bLCA_mode)
{
	if (lca && _$lca_only && !bLCA_mode) // for LCA mode - components already parsed
		return false;

	_str = oBXEditorUtils.PHPParser.trimPHPTags(_str);
	_str = oBXEditorUtils.PHPParser.cleanCode(_str);

	var _oFunc = oBXEditorUtils.PHPParser.parseFunction(_str);
	if (!_oFunc)
		return false;

	if (_oFunc.name.toUpperCase() == '$APPLICATION->INCLUDECOMPONENT')
	{
		var
			arParams = oBXEditorUtils.PHPParser.parseParameters(_oFunc.params)
			name = arParams[0],
			template = arParams[1] || "",
			params = arParams[2] || {},
			parentComponent = (arParams[3] && arParams[3] != '={false}') ? arParams[3] : false,
			exParams = arParams[4] || false;

		for (var key in params)
			if (typeof params[key] == 'object')
				params[key] = _BXArr2Str(params[key]);

		//try{
			var
				comProps = window.as_arComp2Elements[name],
				icon = (comProps.icon) ? comProps.icon : '/bitrix/images/fileman/htmledit2/component.gif',
				tagname = (comProps.tagname) ? comProps.tagname : 'component2',
				allParams = copyObj(comProps.params);

			allParams.name = name;
			allParams.template = template;
			allParams.parentComponent = parentComponent;
			allParams.exParams = exParams;

			//Handling SEF_URL_TEMPLATES
			if (params["SEF_URL_TEMPLATES"])
			{
				var _str = params["SEF_URL_TEMPLATES"];
				var arSUT = oBXEditorUtils.PHPParser.getArray((_str.substr(0,8).toLowerCase() == "={array(") ? _str.substr(2,_str.length-3) : _str);

				for (var _key in arSUT)
					params["SEF_URL_TEMPLATES_"+_key] = arSUT[_key];

				delete params["SEF_URL_TEMPLATES"];
			}

			if (params["VARIABLE_ALIASES"])
			{
				if (params["SEF_MODE"]=="N")
				{
					var _str = params["VARIABLE_ALIASES"];
					var _arVA = oBXEditorUtils.PHPParser.getArray((_str.substr(0,8).toLowerCase() == "={array(") ? _str.substr(2,_str.length-3) : _str);

					for (var _key in _arVA)
						params["VARIABLE_ALIASES_"+_key] = _arVA[_key];
				}
				delete params["VARIABLE_ALIASES"];
			}

			allParams.paramvals = params;
			var bTagParams = {};
			if (pMainObj.bRenderComponents)
			{
				bTagParams._src = icon;
				icon = c2wait_path;
			}

			var id = pMainObj.SetBxTag(false, {tag: tagname, params: bTagParams});
			allParams.__bx_id = push2Component2(id, allParams.name); // Used to cache component-params for each component

			if (!pMainObj.arComponents)
				pMainObj.arComponents = {};
			pMainObj.arComponents[id] = allParams;

			return '<img style="cursor: default;" id="' + id + '" src="' + icon + '" />';
		//}catch(e) {}
	}
	return false;
}


function LCAContentParser(str, pMainObj, returnCode)
{
	returnCode = (returnCode === true);
	var replaceLCA = function(str, key)
	{
		var cCode = _$arComponents[key]; // Code of component: $APLICATION->IncludeComponent( .........
		if (!cCode)
			return '';
		if (returnCode)
			return cCode;
		return BXCheckForComponent2(cCode, pMainObj, true);
	};
	str = str.replace(/#COMPONENT(\d{4})#/ig, replaceLCA);
	_$LCAContentParser_execed = true;
	return str;
}

if (window.lca) //limit component access
	oBXEditorUtils.addContentParser(LCAContentParser);
oBXEditorUtils.addPHPParser(BXCheckForComponent2, 0, true);

function checkComp2Template(pMainObj)
{
	var compList, len, i, compName, arCompNames = [];
	for (compName in arComponents2)
		arCompNames.push(compName);

	var postData = oBXEditorUtils.ConvertArray2Post(arCompNames, 'complist');
	var params = [];
	loadComp2TemplateLists(pMainObj.templateID, __checkComp2Template, [pMainObj], "POST",postData);
}

function __checkComp2Template(params)
{
	var pMainObj = params[0];

	var template, oEl, allParams, name;
	for (compName in arComponents2)
	{
		compList = arComponents2[compName];
		len = compList.length;

		for (i =0; i < len; i++)
		{
			id = compList[i].id;

			oEl = pMainObj.pEditorDocument.getElementById(id);
			if (!oEl)
				continue;

			allParams = pMainObj.pComponent2Taskbar.GetParams({id: id});
			template = allParams.template;
			name = allParams.name;

			if (!arComp2TemplateLists[name][template] || ((template=="" || template==".default") && !(arComp2TemplateLists[name][''] || arComp2TemplateLists[name]['.default'])))
			{
				allParams.template = arComp2TemplateLists[name][''] ? "" : ".default";
				pMainObj.SetBxTag(oEl, {id: oEl.id, params: allParams});
			}
			as_arComp2Templates[name] = [];
			for (__i in arComp2TemplateLists[name])
				as_arComp2Templates[name].push(arComp2TemplateLists[name][__i]);

			window._bx_reload_template_props = true;
		}
	}
	setTimeout(function (){pMainObj.OnEvent("OnSelectionChange");}, 5);
}

function loadComp2TemplateLists(siteTemplate,calbackFunc, calbackParams,method,data)
{
	var _CHttpRequest = new JCHttpRequest();
	_CHttpRequest.Action = function(result)
	{
		try
		{
			setTimeout(function ()
				{
					if(calbackFunc)
						calbackFunc(calbackParams);
				}, 5
			);
		}
		catch(e)
		{
			alert('ERROR can\'t load template params...');
		}
	}
	if (method == 'POST' && data)
		_CHttpRequest.Post('/bitrix/admin/fileman_load_templates.php?lang='+BXLang+'&site='+BXSite+'&mode=list&stid='+siteTemplate,data);
	else
		_CHttpRequest.Send('/bitrix/admin/fileman_load_templates.php?lang='+BXLang+'&site='+BXSite+'&mode=list&stid='+siteTemplate);
}

function push2Component2(id, name)
{
	if (!arComponents2[name])
		arComponents2[name] = [];

	arComponents2[name].push({'id':id, ind: arComponents2Length});
	arComponents2Length++;
	return arComponents2[name].length;
}

function _BXArr2Str(arObj)
{
	try
	{
		var _arObj = [];
		var str = 'array(';
		for (var _key in arObj)
		{
			if (typeof(arObj[_key]) == 'function')
				continue;
			if (parseInt(_key).toString()=='NaN')
				_arObj.push('"'+_key+'" => "'+arObj[_key]+'"');
			else
				_arObj[_key] = '"'+arObj[_key]+'"';
		}

		str += _arObj.join(", ");
		str += ')';
	}
	catch(e)
	{
		str = 'array()';
	}
	return str;
}

function _BXStr2Arr(str, bSkipEmpty)
{
	var
		arObj = oBXEditorUtils.PHPParser.getArray(str),
		res = {}, i;

	for (i in arObj)
	{
		if (i !== "" && typeof arObj[i] != 'function' && (arObj[i] !== '' || !bSkipEmpty))
			res[i] = arObj[i];
	}
	return res;
}

function catchVariableAliases(str)
{
	var arRes = [];
	var res = str.match(/(\?|&)(.+?)=#([^#]+?)#/ig);
	if (!res)
		return arRes;

	for (var l=0;l<res.length; l++)
	{
		var _res = res[l].match(/(\?|&)(.+?)=#([^#]+?)#/i);
		arRes[_res[3]] = _res[2];
	}
	return arRes;
}

oBXEditorUtils.addTaskBar('BXComponents2Taskbar', 2, BX_MESS.CompTBTitle, [], 10);htmleditor2/editor.js000064400000210576150240170740010640 0ustar00// ========================
var editor_js = true;
// ========================
//pMainObj - name of MAIN object which contains all editor's methods. Used for coordinashion between different components and objects
//	pEditorFrame - link to IFRAME for visual editing
//	pFrame - link to table with editor
//	pDocument - parent document
//	pEditorDocument - document of edited file

function BXHTMLEditor(name, start_func)
{
	GLOBAL_pMainObj[name] = this;
	name_cur_obj = name;
	this.start_func = (start_func) ? start_func : function(){};
	this.pMainObj = this;
	this.arBarHandlersCache = [];
	this.name = name;
	this.showTooltips4Components = true;
	this.visualEffects = true;
	this.arUndoBuffer = [];
	this.SessionLostStr = 'BX_EDITOR_ERROR_SESSION_EXPIRED';
	this.iUndoPos = -1;
	this.sOnChangeLastType = '';
	this.customToolbars = true;
	this.bDotNet = window.bDotNet || false;
	this.limit_php_access = limit_php_access; // Limit php access
	this.lastCursorId = 'bx-editor-cursor-id';
	this.bxTags = {};

	this.bLoadFinish = false;
	this.isSubmited = false;
	// *** Limit component access (LCA) ***
	if(window.lca)
	{
		_$lca_only = false;
		_$arComponents = window._$arComponents || false;
		_$lca_to_output = _$arComponents ? true : false;
	}

	this.fullEdit = (this.name == 'CONTENT'); // For template edit
	this.sOnChangeLastSubType = '';
	this.sLastContent = '';
	this.bSkipChanges = false;
	this.sFirstContent = null;
	if(BXEditorLoaded)
		this.OnBeforeLoad();
	else
		BXEditorRegister(this);
}

BXHTMLEditor.prototype.CreateElement = BXCreateElement;

BXHTMLEditor.prototype.OnBeforeLoad = function()
{
	this.allowedTaskbars = window['ar_' + this.name + '_taskbars'];
	this.BXPreloader = new BXPreloader(
		[
			{func: BX.proxy(this.GetConfig, this), params: []},
			{obj: this, func: this.PreloadTaskbarsData}
		],
		{
			obj : this,
			func: this.OnLoad
		}
	);
	this.BXPreloader.LoadStep();
};


BXHTMLEditor.prototype.PreloadTaskbarsData = function(oCallBack)
{
	var arTsbSet = SETTINGS[this.name].arTaskbarSettings;
	try{
		if (this.bDotNet)
		{
			var bShow = !arTsbSet || !arTsbSet['ASPXComponentsTaskbar'] || arTsbSet['ASPXComponentsTaskbar'].show;
			if (this.allowedTaskbars['ASPXComponentsTaskbar'] && bShow)
				this.BXPreloader.AddStep({obj: this, func: this.LoadASPXComponents});
		}
		else
		{
			var settings = false;
			if (arTsbSet)
				settings =  arTsbSet['BXComponents2Taskbar'];

			if (this.allowedTaskbars['BXComponents2Taskbar'] && (!settings || settings.show))
				this.BXPreloader.AddStep({obj: this, func: this.LoadComponents2});
		}
	}catch(e){_alert(this.name+': ERROR:  pMainObj.PreloadTaskbarsData');}

	oCallBack.func.apply(oCallBack.obj);
};

BXHTMLEditor.prototype.OnLoad = function()
{
	//try{
	var obj = this;
	this.bShowed = true;
	this.bDragging = false;
	this.bNotSaved = false;
	this.bFirstClick = false;
	this.className = 'BXHTMLEditor';
	this.arEventHandlers = [];
	this.pDocument = document;
	this.bTableBorder = false;
	this.pWnd = BX(this.name + '_object');
	this.pValue = BX('bxed_' + this.name);
	this.arToolbarSet = [];
	this.toolArea = [];
	this.arTaskbarSet = [];
	this.pParser = new BXParser(this);
	this.bEditSource = false;
	this.arConfig = window['ar_' + this.name + '_config'];
	this.bRenderComponents = this.arConfig.renderComponents;
	this.bRenderStyleList = styleList_render_style;

	if (!this.pWnd || !BX.isNodeInDom(this.pWnd))
	{
		BX.closeWait();
		return;
	}

	this.bodyParams = ""; // Used to add some css for body
	if (this.arConfig.body_class)
		this.bodyParams += ' class="' + this.arConfig.body_class + '"';
	if (this.arConfig.body_id)
		this.bodyParams += ' id="' + this.arConfig.body_id + '"';

	if (BX.WindowManager)
	{
		BX.WindowManager.setStartZIndex(2010);
		BX.WindowManager.disableKeyCheck();
	}

	this.oTransOverlay = new BXTransOverlay({zIndex: 2080, edId: this.name});

	this.fullEditMode = window.fullEditMode || false;

	this.pParser.ClearHBF(); // Init HBF
	window.CACHE_DISPATCHER = []; // GLOBAL CACHE
	if (this.arConfig.sBackUrl)
		this.arConfig.sBackUrl = this.arConfig.sBackUrl.replace(/&amp;/gi, '&');
	if (this.OnLoad_ex)
		this.OnLoad_ex();
	// ******** List of entities to replace **********
	if (this.arConfig["ar_entities"].toString() == '')
		this.arConfig["ar_entities"] = [];
	else
		this.arConfig["ar_entities"] = this.arConfig["ar_entities"].toString().split(',');

	var arAllEntities = {}, k;
	arAllEntities['umlya'] = ['&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&OElig;','&oelig;','&Scaron;','&scaron;','&Yuml;'];
	arAllEntities['greek'] = ['&Alpha;','&Beta;','&Gamma;','&Delta;','&Epsilon;','&Zeta;','&Eta;','&Theta;','&Iota;','&Kappa;','&Lambda;','&Mu;','&Nu;','&Xi;','&Omicron;','&Pi;','&Rho;','&Sigma;','&Tau;','&Upsilon;','&Phi;','&Chi;','&Psi;','&Omega;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigmaf;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&thetasym;','&upsih;','&piv;'];
	arAllEntities['other'] = ['&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&circ;','&tilde;','&ensp;','&emsp;','&thinsp;','&zwnj;','&zwj;','&lrm;','&rlm;','&ndash;','&mdash;','&lsquo;','&rsquo;','&sbquo;','&ldquo;','&rdquo;','&bdquo;','&dagger;','&Dagger;','&permil;','&lsaquo;','&rsaquo;','&euro;','&bull;','&hellip;','&prime;','&Prime;','&oline;','&frasl;','&weierp;','&image;','&real;','&trade;','&alefsym;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&crarr;','&lArr;','&uArr;','&rArr;','&dArr;','&hArr;','&forall;','&part;','&exist;','&empty;','&nabla;','&isin;','&notin;','&ni;','&prod;','&sum;','&minus;','&lowast;','&radic;','&prop;','&infin;','&ang;','&and;','&or;','&cap;','&cup;','&int;','&there4;','&sim;','&cong;','&asymp;','&ne;','&equiv;','&le;','&ge;','&sub;','&sup;','&nsub;','&sube;','&supe;','&oplus;','&otimes;','&perp;','&sdot;','&lceil;','&rceil;','&lfloor;','&rfloor;','&lang;','&rang;','&loz;','&spades;','&clubs;','&hearts;','&diams;'];

	this.arEntities = [];
	for(k in this.arConfig["ar_entities"])
	{
		if(arAllEntities[this.arConfig["ar_entities"][k]])
			this.arEntities = this.arEntities.concat(arAllEntities[this.arConfig["ar_entities"][k]]);
	}
	this.arEntities_h = BX.create("span", {html: this.arEntities.join(',')}).innerHTML.split(',');

	this.arConfig.undosize = this.arConfig.undosize || 25;
	this.arConfig.width = this.arConfig.width || "750";

	this.pWnd.style.width = parseInt(this.arConfig.width) + (this.arConfig.width.indexOf('%') == -1 ? "px" : '%');
	this.arConfig.height = this.arConfig.height || "500";
	this.pWnd.style.height = parseInt(this.arConfig.height) + (this.arConfig.height.indexOf('%') == -1 ? "px" : '%');

	this.arToolbars = this.arConfig.arToolbars || ["standart", "style", "formating", "source", "template"];

	if(this.arConfig["customToolbars"])
		this.customToolbars = this.arConfig["customToolbars"];

	this.pForm = BXFindParentByTagName(this.pWnd, "FORM");
	if(this.pForm)
		addAdvEvent(this.pForm, 'submit', window['OnSubmit_' + this.name]);

	BX.addCustomEvent(window, "OnHtmlEditorRequestAuthFailure", BX.proxy(this.AuthFailureHandler, this));

	//Table which makes structure of Toolbarsets, taskbarsets and editor area....
	var pFrame = this.pDocument.getElementById(this.name+'_pFrame');
	//Editor area
	this.cEditor = BX(this.name + '_cEditor');
	window.IEplusDoctype = (lightMode && BX.browser.IsDoctype() && BX.browser.IsIE());
	this.pFrame = pFrame;

	// Hack for render bug in IE
	if (BX.browser.IsIE())
	{
		setTimeout(function()
		{
			obj.pFrame.style.position = 'absolute';
			setTimeout(function(){obj.pFrame.style.position = 'static';}, 10);
		}, 800);
	}

	this.pEditorFrame = this.cEditor.appendChild(BX.create("IFRAME", {props: {id: "ed_" + this.name, className: "bx-editor-iframe", src: "javascript:void(0)", frameborder: 0}}));

	if(this.pEditorFrame.contentDocument && !BX.browser.IsIE())
		this.pEditorDocument = this.pEditorFrame.contentDocument;
	else
		this.pEditorDocument = this.pEditorFrame.contentWindow.document;
	this.pEditorWindow = this.pEditorFrame.contentWindow;
	this.pEditorDocument.className = "pEditorDocument";
	this.pEditorDocument.pMainObj = this;

	//Toolbarsets creation
	this.pTopToolbarset = BX(this.name + '_toolBarSet0');
	if(!lightMode)
	{
		this.arToolbarSet[0] = new BXToolbarSet(this.pTopToolbarset, this, false); // top toolbar
		this.arToolbarSet[1] = new BXToolbarSet(BX(this.name + '_toolBarSet1'), this, true); // left toolbar
	}

	//Taskbarsets creation
	this.arTaskbarSet[2] = new BXTaskbarSet(BX(this.name + '_taskBarSet2'), this, 2); // Right taskbar
	this.arTaskbarSet[3] = new BXTaskbarSet(BX(this.name + '_taskBarSet3'), this, 3); // Bottom taskbar
	this.pTaskTabs = BX(this.name + '_taskBarTabs'); // Taskbar Tabs


	var ta = BX.create("TEXTAREA", {props: {className: "bxeditor-textarea"}, style: {height: '100%'}});
	if (BX.browser.IsIE())
	{
		this.pSourceDiv = this.cEditor.appendChild(this.CreateElement("DIV", {}, {display: 'none', height: '100%', width: '100%', overflowX: 'hidden', overflowY: 'auto', overflow: 'auto'}));
		this.pSourceFrame = this.pSourceDiv.appendChild(ta);
	}
	else
	{
		this.pSourceFrame = this.cEditor.appendChild(ta);
	}

	this.pSourceFrame.onkeydown = function (e)
	{
		var tabKeyCode = 9;
		var replaceWith = "  ";
		if(window.event)
		{
			if(event.keyCode == tabKeyCode)
			{
				this.selection = document.selection.createRange();
				this.selection.text = replaceWith;
				event.returnValue = false;
				return false;
			}
		}
		else
		{
			if(e.keyCode == tabKeyCode)
			{
				var
					selectionStart = this.selectionStart,
					selectionEnd = this.selectionEnd,
					scrollTop = this.scrollTop,
					scrollLeft = this.scrollLeft;

				this.value = this.value.substring(0, selectionStart)+ replaceWith + this.value.substring(selectionEnd);
				this.focus();
				this.setSelectionRange(selectionStart + (selectionStart != selectionEnd?0:1), selectionStart + replaceWith.length);
				this.scrollTop = scrollTop;
				this.scrollLeft = scrollLeft;
				return false;
			}
		}
	};

	this.pSourceFrame.onkeyup = function (){BX.onCustomEvent(obj, 'onChange');};

	pBXEventDispatcher.__Add(this);
	if (this.bDotNet && this.pASPXParser && this.pASPXParser.OnLoadSystem)
		this.pASPXParser.OnLoadSystem();

	BXHTMLEditor.prototype.OnDragDrop = function (e)
	{
		if (this.sEditorMode == 'code' || this.sEditorMode == 'split' && this.sEditorSplitMode == 'code')
			return;

		if(this.nLastDragNDropElement && this.nLastDragNDropElement.length > 0)
		{
			var obj = this;
			setTimeout(function ()
			{
				var pEl = obj.pEditorDocument.getElementById(obj.nLastDragNDropElement);
				if (!pEl)
					pEl = BX(obj.nLastDragNDropElement);

				if(obj.pEditorWindow.getSelection)
					obj.pEditorWindow.getSelection().selectAllChildren(pEl);

				if (obj.nLastDragNDropElementFire !== false)
					obj.nLastDragNDropElementFire(pEl);
				obj.OnClick(e);
			}, 10);
		}
	};

	BXHTMLEditor.prototype.__ShowTableBorder = function (pTable, bShow)
	{
		var arTableBorderStyles = ["border", "borderBottom", "borderBottomColor", "borderBottomStyle", "borderBottomWidth", "borderCollapse", "borderColor", "borderLeft", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderStyle", "borderTop", "borderTopColor", "borderTopStyle", "borderTopWidth", "borderWidth"];
		if(!pTable.border || pTable.border == "0")
		{
			try{
				if(bShow)
				{
					pTable.setAttribute("__bxborderCollapse", pTable.style.borderCollapse);
					pTable.style.borderCollapse = "collapse";
				}
				else
				{
					pTable.style.borderCollapse = pTable.getAttribute("__bxborderCollapse");
					pTable.removeAttribute("__bxborderCollapse");
				}
			} catch(e){}

			var pCell, arCells = pTable.getElementsByTagName("TD");
			for(var j = 0; j < arCells.length; j++)
			{
				pCell = arCells[j];
				if(bShow)
				{
					if(!pCell.getAttribute("__bxborder"))
					{
						pCell.setAttribute("__bxborder", BXSerializeAttr(pCell.style, arTableBorderStyles));
						pCell.style.border = "1px #ACACAC dashed";
					}
				}
				else
				{
					if(pCell.getAttribute("__bxborder"))
					{
						pCell.style.borderWidth = "";
						pCell.style.borderColor = "";
						pCell.style.borderStyle = "";
						BXUnSerializeAttr(pCell.getAttribute("__bxborder"), pCell.style, arTableBorderStyles);
						pCell.removeAttribute("__bxborder");
					}
				}
			}
		}
	};

	BXHTMLEditor.prototype.Show = function (flag)
	{
		this.bShowed = flag;
		if(flag && this.pWnd.style.display=='none')
			this.pWnd.style.display='block';
		else if(!flag && this.pWnd.style.display != 'none')
			this.pWnd.style.display='none';
	};

	BXHTMLEditor.prototype.ShowTableBorder = function (bShow)
	{
		if(this.bTableBorder == bShow)
			return false;

		this.bTableBorder = bShow;
		var arTables = this.pEditorDocument.getElementsByTagName("TABLE");
		for(var i=0; i<arTables.length; i++)
			this.__ShowTableBorder(arTables[i], bShow);

		return true;
	};

	BXHTMLEditor.prototype.OnClick = function(e)
	{
		if (!e)
			e = this.pEditorWindow.event;
		if (!e)
			e = window.event;

		if (e)
		{
			var pElement = e.target || e.srcElement;
			if (pElement && pElement.nodeType == 1 && pElement.tagName && pElement.tagName.toLowerCase() == 'img')
				this.SelectElement(pElement);
		}

		if (this.__bMouseDownComp) // Prevent default for selecting other element after Rendered Component selection
			return;

		if(this.pOnChangeSelectionTimer)
			clearTimeout(this.pOnChangeSelectionTimer);

		BX.onCustomEvent(this, 'onChange');

		this.bFirstClick = true;
		var obj = this;
		this.pOnChangeSelectionTimer = setTimeout(function (){obj.OnEvent("OnSelectionChange");}, 200);
	};

	BXHTMLEditor.prototype.OnDblClick = function (e)
	{
		var pEl, oTag = false;
		if (!e)
			e = this.pEditorWindow.event;
		if (e.target)
			pEl = e.target;
		else if (e.srcElement)
			pEl = e.srcElement;
		if (pEl.nodeType == 3)
			pEl = pEl.parentNode;

		if (pEl && pEl.nodeName)
			oTag = this.GetBxTag(pEl);

		if (oTag)
		{
			if (oTag.tag == "img")
				this.OpenEditorDialog("image", null, 500, {pElement: pEl});
			else if (oTag.tag == "a")
				this.OpenEditorDialog("editlink", null, 520);
			if (oTag.tag == "anchor")
				this.OpenEditorDialog("anchor", null, 400);
			if (oTag.tag == "flash")
				this.OpenEditorDialog("flash", null, 500, {bUseTabControl: true, pMainObj: this});
		}

		obj.OnEvent("OnDblClick", [e]);
	};

	BXHTMLEditor.prototype.OnMouseUp = function (e)
	{
		this.bFirstClick = true;
		if(this.pOnChangeSelectionTimer)
			clearTimeout(this.pOnChangeSelectionTimer);
		var obj = this;
		this.pOnChangeSelectionTimer = setTimeout(function (){obj.OnEvent("OnSelectionChange");}, 100);
	};

	this.pSourceFrame.onblur = function (e){obj.pEditorFrame.onfocus(e);};

	this.pSourceFrame.onfocus = function (e)
	{
		if(obj.bEditSource)
			return;

		obj.bEditSource = true;
		if(obj.sEditorMode == 'split')
		{
			obj.SaveContent();
			obj.OnEvent('ClearResourcesBeforeChangeView');
			obj.SetCodeEditorContent(obj.GetContent());
			obj.sEditorSplitMode = 'code';
			obj.OnEvent("OnChangeView", [this.sEditorMode, this.sEditorSplitMode]);
		}
	};

	this.pEditorFrame.onfocus = function (e)
	{
		if(!obj.bEditSource)
			return;

		obj.bEditSource = false;
		if(obj.sEditorMode=='split')
		{
			obj.SetEditorContent(obj.GetCodeEditorContent());
			obj.sEditorSplitMode = 'html';
			obj.OnEvent("OnChangeView", [this.sEditorMode, this.sEditorSplitMode]);
		}
	};

	this.value = this.pValue.value;
	BXStyleParser.Create();
	this.oStyles = new BXStyles(this);

	if(this.arConfig["TEMPLATE"])
		this.SetTemplate(this.arConfig["TEMPLATE"]["ID"], this.arConfig["TEMPLATE"], true);
	// ***********************************************************************************************
	// 	Adding all toolbars and buttons to them
	// ***********************************************************************************************
	var arAllowedToolbars = window['ar_' + this.name + '_toolbars'];
	var arSet;
	if (!SETTINGS[this.name].arToolbarSettings)
		SETTINGS[this.name].arToolbarSettings = arToolbarSettings_default;
	var arToolbarSettings = SETTINGS[this.name].arToolbarSettings;
	if (lightMode)
	{
		var
			pGlobalToolbar = new BXGlobalToolbar(this),
			arSourceToolbar = [], val;

		if (this.arConfig.toolbarConfig)
		{
			var _handledButtons = {}, _val;
			for(var j = 0, n = this.arConfig.toolbarConfig.length; j < n ; j++)
			{
				val = this.arConfig.toolbarConfig[j];
				if (val.indexOf("-") === -1 && val == parseInt(val) && arGlobalToolbar[val])
				{
					arSourceToolbar.push(arGlobalToolbar[val]);
				}

				_val = val.replace("-", '');
				if (arGlobalToolbar[_val])
				{
					_handledButtons[arGlobalToolbar[_val][1].id] = true;
				}
			}

			for(j = 0; j < arGlobalToolbar.length ; j++)
			{
				if (!_handledButtons[arGlobalToolbar[j][1].id])
				{
					arSourceToolbar.push(arGlobalToolbar[j]);
				}
			}
		}
		else
		{
			arSourceToolbar = arGlobalToolbar;
		}

		pGlobalToolbar.LineBegin(true);
		for(var i = 0, l = arSourceToolbar.length; i < l ; i++)
		{
			var arButton = arSourceToolbar[i];
			if(!arButton || (arButton[1] && arButton[1].hideCondition && arButton[1].hideCondition(this)))
				continue;

			if (typeof(arButton) == 'object')
			{
				pGlobalToolbar.AddButton(this.CreateCustomElement(arButton[0], arButton[1]));
			}
			else if(arButton == 'new_line')
			{
				pGlobalToolbar.LineEnd();
				pGlobalToolbar.LineBegin();
			}
			else if(arButton == 'separator')
			{
				pGlobalToolbar.AddButton(this.CreateCustomElement('BXButtonSeparator'));
			}
		}
		pGlobalToolbar.LineEnd();
	}
	else // admin
	{
		for(var sToolBarId in arToolbars)
		{
			if (arAllowedToolbars !== false && !arAllowedToolbars[sToolBarId])
			{
				delete arToolbars[sToolBarId];
				continue;
			}

			//try{
			if (!arToolbarSettings[sToolBarId])
			{
				SETTINGS[this.name].arToolbarSettings[sToolBarId] = arToolbarSettings_default[sToolBarId];
				arSet = arToolbarSettings_default[sToolBarId];
			}
			else
			{
				arSet = arToolbarSettings[sToolBarId];
			}

			if(BXSearchInd(this.arToolbars, sToolBarId) < 0 && this.customToolbars !== true)
				continue;

			var arSourceToolbar = [], val;
			if (this.arConfig.toolbarConfig && this.arConfig.toolbarConfig[sToolBarId])
			{
				for(var j = 0, n = this.arConfig.toolbarConfig[sToolBarId].length; j < n ; j++)
				{
					val = this.arConfig.toolbarConfig[sToolBarId][j];
					if (val.indexOf("-") === -1 && val == parseInt(val) && arToolbars[sToolBarId][1][val])
						arSourceToolbar.push(arToolbars[sToolBarId][1][val]);
				}
			}
			else
			{
				arSourceToolbar = arToolbars[sToolBarId][1];
			}

			var arButton, i, l = arSourceToolbar.length;
			if (!l) // All buttons was disabled
			{
				// Have to del toolbar
				delete arToolbars[sToolBarId];
				continue;
			}

			var pToolbar = new BXToolbar(this, arToolbars[sToolBarId][0], sToolBarId);

			for(i = 0; i < l ; i++)
			{
				arButton = arSourceToolbar[i];
				if(!arButton || (arButton[1] && arButton[1].hideCondition && arButton[1].hideCondition(this)))
					continue;

				if(arButton == 'separator')
				{
					pToolbar.AddButton(this.CreateCustomElement('BXButtonSeparator'));
				}
				else if(!arButton[1].id || !pToolbar.buttons[arButton[1].id])
				{
					pToolbar.AddButton(this.CreateCustomElement(arButton[0], arButton[1]));
					pToolbar.buttons[arButton[1].id] = true;
				}
			}

			if (arSet.docked && arSet.position)
				arDefaultTBPositions[sToolBarId] = arSet.position;
			if(arDefaultTBPositions[sToolBarId])
				this.arToolbarSet[arDefaultTBPositions[sToolBarId][0]].AddToolbar(pToolbar, arDefaultTBPositions[sToolBarId][1], arDefaultTBPositions[sToolBarId][2]);
			else
				this.arToolbarSet[0].AddToolbar(pToolbar, 100, 0);

			if (!arSet.docked && arSet.position)
				pToolbar.SetPosition(arSet.position.x,arSet.position.y);

			if (!arSet.show)
			{
				pToolbar.Close();
				continue;
			}
			pToolbar = null;

			//}catch(e){_alert("Error: loading "+sToolBarId+" toolbar"); continue;}
		}
		arSet = null;
	}

	// Init event "OnCreate" : adding all taskbars
	setTimeout(function (){BXCreateTaskbars(obj, true);}, 50);
	this.SetView("html");
	if(this.arConfig["fullscreen"])
	{
		this.pDocument.body.style.display = 'block';
		this.SetFullscreen(true);
	}

	this.start_func(this);
	pFrame.style.display = ''; // Show Editor frame
	setTimeout(function ()
		{
			BX.closeWait();
			obj.bLoadFinish = true;
			obj.SetFocus();
			try{jsUtils.onCustomEvent('EditorLoadFinish_' + obj.name);}catch(e){}
		}, 10
	);

	//Table border = ON
	this.ShowTableBorder(true);

	oBXContextMenu = this.CreateCustomElement("BXContextMenu");
	oBXContextMenu.Create();

	this.oBXVM = new BXVisualMinimize();

	jsUtils.addCustomEvent('OnToggleTabs', this.ClearPosCache, [], this);
	ar_BXTaskbarS = [];
	BXPopupWindow.bCreated = false;

	if (BX.WindowManager)
	{
		var wnd = BX.WindowManager.Get();
		if (wnd)
		{
			BX.addCustomEvent(wnd, 'onWindowDragFinished', function()
			{
				CACHE_DISPATCHER['pEditorFrame_' + obj.name] = null;
				CACHE_DISPATCHER['pEditorFrame'] = null;
			});
		}
	}
	//}catch(e){alert('ERROR: BXHTMLEditor.prototype.OnLoad'); alert(e);}

	// Autosave handlers
	var pForm = obj.pValue.form;
	if (pForm)
	{
		//BX.addCustomEvent(pForm, 'onAutoSavePrepare', function()
		//{
			if (pForm && pForm.BXAUTOSAVE)
			{
				try{
					BX.addCustomEvent(obj, 'onChange', function()
					{
						pForm.BXAUTOSAVE.Init();
					});
					BX.addCustomEvent(pForm, 'onAutoSave', function (ob, data)
					{
						if (obj.bShowed)
						{
							obj.SaveContent(); // Save editor content
							data[obj.name] = obj.GetContent(); // Get it from textarea and put to form_data to saving
						}
					});

					BX.addCustomEvent(pForm, 'onAutoSaveRestore', function (ob, data)
					{
						if (obj.bShowed)
						{
							obj.SetContent(data[obj.name]);
							obj.LoadContent();
						}
					});
				}catch(e){}
			}
		//});
	}
};

BXHTMLEditor.prototype.SetContent = function(sContent)
{
	this.OnEvent('SetContentBefore', [sContent]);
	this.pValue.value = this.value = sContent;
	this.OnEvent('SetContentAfter', [sContent]);
};

BXHTMLEditor.prototype.GetContent = function()
{
	this.OnEvent('GetContent');
	return this.value.toString();
};

BXHTMLEditor.prototype.LoadContent = function()
{
	this.OnEvent('LoadContentBefore');
	var sContent = this.GetContent();
	if(this.sFirstContent == null)
		this.sFirstContent = sContent;

	switch(this.sEditorMode)
	{
		case 'code':
			this.SetCodeEditorContent(sContent);
			break;
		case 'split':
			this.SetCodeEditorContent(sContent)
			this.SetEditorContent(sContent)
			break;
		case 'html':
			this.SetEditorContent(sContent);
	}
	this.OnEvent('LoadContentAfter');
};

BXHTMLEditor.prototype.SaveContent = function()
{
	this.OnEvent('SaveContentBefore');
	switch(this.sEditorMode)
	{
		case 'code':
			this.SetContent(this.GetCodeEditorContent());
			break;
		case 'split':
			if(this.sEditorSplitMode == 'code')
				this.SetContent(this.GetCodeEditorContent());
			else
				this.SetContent(this.GetEditorContent(true, true));
			break;
		case 'html':
			this.SetContent(this.GetEditorContent(true, true));
	}
	this.OnEvent('SaveContentAfter');
};


BXHTMLEditor.prototype.SetEditorContent = function(sContent)
{
	var _this = this;
	sContent = this.pParser.SystemParse(sContent);

	if (this.pEditorDocument.designMode)
	{
		try{
			this.pEditorDocument.designMode = 'off';
		}catch(e){_alert('SetEditorContent: designMode=\'off\'');}
	}
	this.OnEvent('SetEditorContentBefore', [sContent]);
	//Writing content
	this.pEditorDocument.open();
	this.pEditorDocument.write('<html><head></head><body' + this.bodyParams + '>' + sContent + '</body></html>');
	this.pEditorDocument.close();

	this.pEditorDocument.body.style.padding = "5px";
	this.pEditorDocument.body.style.margin = "0";
	this.pEditorDocument.body.style.borderWidth = "0";

	//Handling DOM
	this.pParser.DOMHandle();
	if(this.bTableBorder)
	{
		this.bTableBorder = false;
		this.ShowTableBorder(true);
	}
	if(BX.browser.IsIE())
	{
		this.pEditorDocument.body.contentEditable = true;
		addAdvEvent(this.pEditorDocument, 'focus', window['onClick_'+this.name]);
	}
	else
	{
		this.pEditorWindow.__bxedname = this.name;
		this.pEditorWindow.addEventListener("focus", this.FFOnFocus, false);
	}

	this.oStyles.SetToDocument(this.pEditorDocument);
	this.pEditorDocument.className = 'pEditorDocument';
	this.pEditorDocument.pMainObj = this;
	pBXEventDispatcher.SetEvents(this.pEditorDocument);

	addAdvEvent(this.pEditorDocument, 'contextmenu', window['onContextMenu_'+this.name]);
	addAdvEvent(this.pEditorDocument, 'click', window['onClick_'+this.name]);
	addAdvEvent(this.pEditorDocument, 'dblclick', window['onDblClick_'+this.name]);
	addAdvEvent(this.pEditorDocument, 'mouseup', window['onMouseUp_'+this.name]);
	addAdvEvent(this.pEditorDocument, 'dragdrop', window['onDragDrop_'+this.name]);

	addAdvEvent(this.pEditorDocument, 'keydown', BX.proxy(function(e){return this.OnKeyPress(e, true)}, this));
	addAdvEvent(this.pEditorDocument, 'keyup', BX.proxy(function(e){_this.OnClick(e); _this.OnChange("keyup", "");}, this));

	if(BX.browser.IsIE())
		addAdvEvent(this.pEditorDocument.body, 'paste', window['onPaste_' + this.name]);
	addAdvEvent(this.pEditorDocument, 'keydown', window['onKeyDown_' + this.name]);

	pBXEventDispatcher.OnEditorEvent("OnSetEditorContent", this);
	this.OnEvent('SetEditorContentAfter');
};

BXHTMLEditor.prototype.GetEditorContent = function()
{
	this.OnEvent('GetEditorContentBefore');

	var bBorders = this.bTableBorder;
	if(bBorders) this.ShowTableBorder(false);
	this.pParser.Parse();
	if(bBorders) this.ShowTableBorder(true);

	var sContent = this.pParser.GetHTML(true);
	sContent = this.pParser.ClearFromHBF(sContent);
	sContent = this.pParser.SystemUnParse(sContent);

	if (this.fullEditMode)
		sContent = this.pParser.AppendHBF(sContent, true);

	this.OnEvent('GetEditorContentAfter', [sContent]);
	return sContent;
};


BXHTMLEditor.prototype.SetCodeEditorContent = function(sContent)
{
	this.pSourceFrame.value = sContent;
};

BXHTMLEditor.prototype.GetCodeEditorContent = function()
{
	return this.PreparseHeaders(this.pSourceFrame.value);
};

BXHTMLEditor.prototype.PreparseHeaders = function(sContent)
{
	if (!this.fullEditMode)
		return sContent;
	return this.pParser.GetHBF(sContent, true);
};

BXHTMLEditor.prototype.SetView = function(sType)
{
	if (this.sEditorMode == sType)
		return;
	var _this = this;
	this.SaveContent();
	switch(sType)
	{
		case 'code':
			this.pSourceFrame.style.height = "99%";
			this.pEditorFrame.style.display = "none";
			this._DisplaySourceFrame();

			if (BX.browser.IsIE())
			{
				this.pSourceFrame.rows = "50";
				this.pSourceDiv.style.height = "99%";
				this.pSourceDiv.style.display = "block";
			}
			this.pSourceFrame.style.borderTop = "0px solid #808080";

			// Hide taskbarsets
			var
				rightTaskbar = this.arTaskbarSet[2],
				bottomTaskbar = this.arTaskbarSet[3];

			this.oTaskbarsInHtmlMode = {
				rightTaskbar: rightTaskbar.bShowing,
				bottomTaskbar: bottomTaskbar.bShowing
			};

			if (rightTaskbar.bShowing)
				rightTaskbar.Display(false);
			if (bottomTaskbar.bShowing)
				bottomTaskbar.Display(false);

			this.oBXTaskTabs.Refresh();

			this.SetCodeEditorContent(this.GetContent());

			setTimeout(function(){_this.pSourceFrame.focus();}, 200);
			break;
		case 'split':
			this.pEditorFrame.style.height = "50%";
			if (BX.browser.IsIE())
			{
				this.pSourceFrame.style.height = "97%";
				this.pSourceFrame.rows = "40";
				this.pSourceDiv.style.overflow = "hidden";
				this.pSourceDiv.style.height = "49%";
				this.pSourceDiv.style.display = "block";
			}
			else
			{
				this.pSourceFrame.style.height = "49%";
			}
			this.pSourceFrame.style.borderTop = "2px solid #808080";
			this._DisplaySourceFrame();
			this.pEditorFrame.style.display = "block";
			if(this.sEditorMode == 'code')
				this.SetEditorContent(this.GetContent());
			else if(this.sEditorMode == 'html')
				this.SetCodeEditorContent(this.GetContent());

			break;
		default:
			this.pEditorFrame.style.height = "100%";
			this.pSourceFrame.style.display = "none";
			this.pEditorFrame.style.display = "block";

			if (IEplusDoctype)
				this.pSourceDiv.style.display = "none";

			// Hide taskbarsets
			if (this.oTaskbarsInHtmlMode)
			{
				if (this.oTaskbarsInHtmlMode.rightTaskbar)
					this.arTaskbarSet[2].Display(true); //rightTaskbar
				if (this.oTaskbarsInHtmlMode.bottomTaskbar)
					this.arTaskbarSet[3].Display(true); // bottomTaskbar

				this.oBXTaskTabs.Refresh();
				this.oTaskbarsInHtmlMode = null;
			}

			this.SetEditorContent(this.GetContent());
			sType = "html";
	}
	this.arTaskbarSet[3].Resize();

	this.sEditorMode = sType;
	this.SetCursorFF();

	this.OnEvent("OnChangeView", [this.sEditorMode, this.sEditorSplitMode]);
};

// Dirty hack for Firefox (Chrome, Safari, Opera)
BXHTMLEditor.prototype.SetCursorFF = function()
{
	if (this.sEditorMode != 'code' && !BX.browser.IsIE())
	{
		var _this = this;
		try{
			this.pEditorFrame.blur();
			this.pEditorFrame.focus();

			setTimeout(function(){
				_this.pEditorFrame.blur();
				_this.pEditorFrame.focus();
			}, 600);

			setTimeout(function(){
				_this.pEditorFrame.blur();
				_this.pEditorFrame.focus();
			}, 1000);
		}catch(e){}
	}
};

BXHTMLEditor.prototype._DisplaySourceFrame = function(bCheck)
{
	if (bCheck && this.sEditorMode != 'code' && this.sEditorMode != 'split')
		return;
	if (BX.browser.IsIE())
	{
		this.pSourceFrame.style.display = "none";
		var _this = this;
		setTimeout(function(){_this.pSourceFrame.style.display = "block";}, 100);
	}
	else
	{
		this.pSourceFrame.style.display = "block";
	}
}

BXHTMLEditor.prototype.PasteAsText = function(text)
{
	text = bxhtmlspecialchars(text);
	text = text.replace(/\r/g, '');
	text = text.replace(/\n/g, '<br/>');
	this.insertHTML(text);
};

BXHTMLEditor.prototype.CleanWordText = function(text, arParams)
{
	text = text.replace(/<(P|B|U|I|STRIKE)>&nbsp;<\/\1>/g, ' ');
	text = text.replace(/<o:p>([\s\S]*?)<\/o:p>/ig, "$1");
	//text = text.replace(/<o:p>[\s\S]*?<\/o:p>/ig, "&nbsp;");

	text = text.replace(/<span[^>]*display:\s*?none[^>]*>([\s\S]*?)<\/span>/gi, ''); // Hide spans with display none

	text = text.replace(/<!--\[[\s\S]*?\]-->/ig, ""); //<!--[.....]-->	-	<!--[if gte mso 9]>...<![endif]-->
	text = text.replace(/<!\[[\s\S]*?\]>/ig, "");		//	<! [if !vml]>
	text = text.replace(/<\\?\?xml[^>]*>/ig, "");	//<xml...>, </xml...>

	text = text.replace(/<o:p>\s*<\/o:p>/ig, "");

	text = text.replace(/<\/?[a-z1-9]+:[^>]*>/gi, "");	//<o:p...>, </o:p>
	text = text.replace(/<([a-z1-9]+[^>]*) class=([^ |>]*)(.*?>)/gi, "<$1$3");
	text = text.replace(/<([a-z1-9]+[^>]*) [a-z]+:[a-z]+=([^ |>]*)(.*?>)/gi, "<$1$3"); //	xmlns:v="urn:schemas-microsoft-com:vml"

	if (arParams.spaces)
	{
		text = text.replace(/&nbsp;/ig, ' ');
		text = text.replace(/\s+?/gi, ' ');
	}

	// Remove mso-xxx styles.
	text = text.replace(/\s*mso-[^:]+:[^;"]+;?/gi, "");

	// Remove margin styles.
	text = text.replace(/\s*margin: 0cm 0cm 0pt\s*;/gi, "");
	text = text.replace(/\s*margin: 0cm 0cm 0pt\s*"/gi, "\"");

	//if (removeIndents)
	if (arParams.indents)
	{
		text = text.replace(/\s*TEXT-INDENT: 0cm\s*;/gi, "");
		text = text.replace(/\s*TEXT-INDENT: 0cm\s*"/gi, "\"");
	}

	text = text.replace(/\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"");
	text = text.replace(/\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"");
	text = text.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"");
	text = text.replace(/\s*tab-stops:[^;"]*;?/gi, "");
	text = text.replace(/\s*tab-stops:[^"]*/gi, "");

	// Remove FONTS
	if (arParams.fonts)
	{
		text = text.replace(/<FONT[^>]*>([\s\S]*?)<\/FONT>/gi, '$1');
		text = text.replace(/\s*face="[^"]*"/gi, "");
		text = text.replace(/\s*face=[^ >]*/gi, "");
		text = text.replace(/\s*FONT-FAMILY:[^;"]*;?/gi, "");
	}

	// Remove Class attributes
	text = text.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");

	// Remove styles.
	if (arParams.styles)
		text = text.replace(/<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3");

	// Remove empty styles.
	text = text.replace(/\s*style="\s*"/gi, '');

	// Remove Lang attributes
	text = text.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");

	var iter = 0;
	while (text.toLowerCase().indexOf('<span') != -1 && text.toLowerCase().indexOf('</span>') != -1 && iter++ < 20)
		text = text.replace(/<span[^>]*?>([\s\S]*?)<\/span>/gi, '$1');

	var
		_text,
		i, tag, arFormatTags = ['b', 'strong', 'i', 'u', 'font', 'span', 'strike'];

	while (true)
	{
		_text = text;
		for (i in arFormatTags)
		{
			tag = arFormatTags[i];
			text = text.replace(new RegExp('<' + tag + '[^>]*?>(\\s*?)<\\/' + tag + '>', 'gi'), '$1');
			text = text.replace(new RegExp('<\\/' + tag + '[^>]*?>(\\s*?)<' + tag + '>', 'gi'), '$1');
		}

		if (_text == text)
			break;
	}

	// Remove empty tags
	text = text.replace(/<(?:[^\s>]+)[^>]*>([\s\n\t\r]*)<\/\1>/g, "$1");
	text = text.replace(/<(?:[^\s>]+)[^>]*>(\s*)<\/\1>/g, "$1");
	text = text.replace(/<(?:[^\s>]+)[^>]*>(\s*)<\/\1>/g, "$1");

	//text = text.replace(/<\/?xml[^>]*>/gi, "");	//<xml...>, </xml...>
	text = text.replace(/<xml[^>]*?(?:>\s*?<\/xml)?(?:\/?)?>/ig, '');
	text = text.replace(/<meta[^>]*?(?:>\s*?<\/meta)?(?:\/?)?>/ig, '');
	text = text.replace(/<link[^>]*?(?:>\s*?<\/link)?(?:\/?)?>/ig, '');
	text = text.replace(/<style[\s\S]*?<\/style>/ig, '');

	if (arParams.tableAtr)
		text = text.replace(/<table([\s\S]*?)>/gi, "<table>");

	if (arParams.trtdAtr)
	{
		text = text.replace(/<tr([\s\S]*?)>/gi, "<tr>");
		text = text.replace(/(<td[\s\S]*?)width=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<td[\s\S]*?)height=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<td[\s\S]*?)style=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<td[\s\S]*?)valign=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<td[\s\S]*?)nowrap=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<td[\s\S]*?)nowrap([\s\S]*?>)/gi, "$1$3");

		text = text.replace(/(<col[\s\S]*?)width=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
		text = text.replace(/(<col[\s\S]*?)style=("|')[\s\S]*?\2([\s\S]*?>)/gi, "$1$3");
	}

	// For Opera (12.10+) only when in text we have reference links.
	if (BX.browser.IsOpera())
		text = text.replace(/REF\s+?_Ref\d+?[\s\S]*?MERGEFORMAT\s([\s\S]*?)\s[\s\S]*?<\/xml>/gi, " $1 ");

	return text;
};


BXHTMLEditor.prototype.PasteWord = function(text, arParams)
{
	this.insertHTML(this.CleanWordText(text, arParams));
};


BXHTMLEditor.prototype.LoadTemplateParams = function(templateID)
{
	var _this = this;
	return BX.ajax.post(editor_action_path + '&action=sitetemplateparams&lang=' + BXLang + '&site=' + BXSite + '&templateID=' + templateID, {}, function(){
		setTimeout(function(){
			_this.SetTemplate(window.bx_template_params["ID"], window.bx_template_params, false);
		}, 100);
	});
};

BXHTMLEditor.prototype.SetTemplate = function (templateID, arTemplateParams, bReload)
{
	//try{
	if(this.templateID && this.templateID == templateID || arTemplateParams === false)
		return;

	if(!arTemplateParams)
		return this.LoadTemplateParams(templateID);

	this.templateID = arTemplateParams["ID"];

	if(this.pTemplateListbox)
		this.pTemplateListbox.SelectByVal(this.templateID);

	this.arTemplateParams = arTemplateParams;
	if (bReload) // Reload contents
	{
		this.SaveContent();
		if (this.bDotNet)
			this.SetTemplate_ex();
		this.LoadContent();
	}

	// Change styles
	if (to_template_path && this.arTemplateParams.ID)
		this.oStyles.Parse(this.arTemplateParams["STYLES"], to_template_path + this.arTemplateParams.ID);

	var styleTitles = this.arTemplateParams["STYLES_TITLE"];
	if (styleTitles)
	{
		// Workaround for Chrome
		for (var title in styleTitles)
			if (title && title != title.toLowerCase() && !styleTitles[title.toLowerCase()])
				styleTitles[title.toLowerCase()] = styleTitles[title];
	}

	// Set styles
	this.oStyles.SetToDocument(this.pEditorDocument);

	var _this = this;

	if (this.pParser.strStyleNodes)
		setTimeout(function(){_this.pParser.AppendCSS(_this.pParser.strStyleNodes);}, 300);

	this.OnEvent("OnTemplateChanged");
	//}catch(e){_alert('ERROR: BXHTMLEditor.prototype.SetTemplate');}
};

BXHTMLEditor.prototype.SetFocus = function ()
{
	if(!this.bEditSource)
		BX.focus(this.pEditorWindow.focus ? this.pEditorWindow : this.pEditorDocument.body);
};

BXHTMLEditor.prototype.insertHTML = function(sValue)
{
	this.SetFocus();

	// Don't clear "try catch"... Some times browsers generetes failures
	try
	{
		if(BX.browser.IsIE())
		{
			var oRng = this.pEditorDocument.selection.createRange();
			oRng.pasteHTML(sValue);
			oRng.collapse(false);
			oRng.select();
		}
		else if(BX.browser.IsIE11())
		{
			this.PasteHtmlAtCaret(sValue);
		}
		else
		{
			this.pEditorWindow.document.execCommand('insertHTML', false, sValue);
		}
	}
	catch(e){}

	this.OnChange("insertHTML", "");
};

BXHTMLEditor.prototype.PasteHtmlAtCaret = function(html, selectPastedContent)
{
	var
		win = this.pEditorWindow,
		doc = this.pEditorDocument,
		sel, range;

	if (win.getSelection)
	{
		// IE9 and non-IE
		sel = win.getSelection();
		if (sel.getRangeAt && sel.rangeCount)
		{
			range = sel.getRangeAt(0);
			range.deleteContents();

			// Range.createContextualFragment() would be useful here but is
			// only relatively recently standardized and is not supported in
			// some browsers (IE9, for one)
			var el = doc.createElement("div");
			el.innerHTML = html;
			var frag = doc.createDocumentFragment(), node, lastNode;
			while ((node = el.firstChild))
				lastNode = frag.appendChild(node);

			var firstNode = frag.firstChild;
			range.insertNode(frag);

			// Preserve the selection
			if (lastNode)
			{
				range = range.cloneRange();
				range.setStartAfter(lastNode);
				if (selectPastedContent)
					range.setStartBefore(firstNode);
				else
					range.collapse(true);

				sel.removeAllRanges();
				sel.addRange(range);
			}
		}
	}
	else if ((sel = doc.selection) && sel.type != "Control")
	{
		// IE < 9
		var originalRange = sel.createRange();
		originalRange.collapse(true);
		sel.createRange().pasteHTML(html);
		if (selectPastedContent)
		{
			range = sel.createRange();
			range.setEndPoint("StartToStart", originalRange);
			range.select();
		}
	}
};

BXHTMLEditor.prototype.OnContextMenu = function (e, pElement, bNotFrame, arParams)
{
	var obj = this, arFramePos;
	obj.OnEvent("OnSelectionChange");
	if(obj.pEditorWindow.event)
		e = obj.pEditorWindow.event;
	if(!e)
		e = window.event;

	if (!pElement)
		pElement = e.target || e.srcElement;

	if(e.pageX || e.pageY)
	{
		e.realX = e.pageX;
		e.realY = e.pageY;
		if (!bNotFrame)
		{
			e.realX -= obj.pEditorDocument.body.scrollLeft;
			e.realY -= obj.pEditorDocument.body.scrollTop;
		}
	}
	else if(e.clientX || e.clientY)
	{
		e.realX = e.clientX;
		e.realY = e.clientY;
		if (bNotFrame)
		{
			e.realX += document.body.scrollLeft;
			e.realY += document.body.scrollTop;
		}
	}

	if(!bNotFrame)
	{
		if (!(arFramePos = CACHE_DISPATCHER['pEditorFrame_' + this.name]))
			CACHE_DISPATCHER['pEditorFrame_' + this.name] = arFramePos = BX.pos(obj.pEditorFrame);

		e.realX += arFramePos["left"];
		e.realY += arFramePos["top"];
	}
	oBXContextMenu.Show(2500, 0, {left : e.realX, top : e.realY}, pElement, arParams, this);

	return BX.PreventDefault(e);
};

BXHTMLEditor.prototype.executeCommand = function(commandName, sValue)
{
	this.SetFocus();
	try{
		var res = this.pEditorWindow.document.execCommand(commandName, false, sValue);
	}catch(e){};
	this.SetFocus();
	this.OnEvent("OnSelectionChange");
	this.OnChange("executeCommand", commandName);
	return res;
};

BXHTMLEditor.prototype.queryCommand = function(commandName)
{
	var sValue = '';
	try{
		if(!this.pEditorDocument.queryCommandEnabled(commandName))
			return null;
	}catch(e){return null;}

	try{
		return this.pEditorDocument.queryCommandValue(commandName);
	}catch(e) {}

	return null;
};


BXHTMLEditor.prototype.queryCommandState = function(commandName)
{
	var sValue = '';
	try
	{
		if(!this.pEditorDocument.queryCommandEnabled(commandName))
			return 'DISABLED';
	}
	catch(e){return 'DISABLED';}

	try
	{
		return (this.pEditorDocument.queryCommandState(commandName)?'CHECKED':'ENABLED');
	}
	catch(e) {return 'ENABLED';}

	return 'DISABLED';
};


BXHTMLEditor.prototype.updateBody = function()
{
	this.extractBodyParams(this._body);
};

BXHTMLEditor.prototype.extractBodyParams = function(_body)
{
	var sParams = _body.replace(/<body(.*?)>/i, "$1");
	var arBodyParams_src = sParams.match(/\w+\s*=".*?"/ig);
	var arBodyParams = [];
	var _val;

	for (var i in arBodyParams_src)
	{
		if (parseInt(i).toString()=="NaN") continue;
		var arBodyParams_src = sParams.match(/(\w+)\s*=".*?"/ig);
		_val = arBodyParams_src[i].replace(/(\w+)\s*="(.*?)"/ig,"$2");
		arBodyParams[RegExp.$1] = _val;
	}
};

BXHTMLEditor.prototype.FFOnFocus = function(e)
{
	try{
		var pMainObj = GLOBAL_pMainObj[this.__bxedname];
		if (pMainObj.pEditorDocument.designMode == 'on')
			return;

		pMainObj.pEditorDocument.designMode = "on";
		//pMainObj.pEditorDocument.execCommand("useCSS", false, true); //deprecated
		pMainObj.pEditorDocument.execCommand("styleWithCSS", false, false); // new moz call

		setTimeout(function(){
			try{pMainObj.pEditorDocument.execCommand("styleWithCSS", false, false);}catch(e){}
		}, 1000);

		this.document.execCommand("insertBrOnReturn", false, false); // new moz call
	}catch(e){/*_alert('Eror: pMainObj.FFOnFocus');*/}
};

BXHTMLEditor.prototype.onSubmit = function(e)
{
	if (!this.isSubmited)
	{
		this.isSubmited = true;
		BX.cleanNode(this.oPropertiesTaskbar.pCellProps);

		if (!this.sEditorMode)
			this.sEditorMode = 'html';

		this.OnEvent('OnSubmit');

		if(this.bShowed)
			this.SaveContent();

		this.Show(false);
	}
};

BXHTMLEditor.prototype.OnKeyDown = function (e)
{
	if (!e)
		e = this.pEditorWindow.event;

	var key = e.which || e.keyCode;

	if (!BX.browser.IsIE() && !BX.browser.IsOpera())
	{
		if (e.ctrlKey && !e.shiftKey && !e.altKey)
		{
			switch (key)
			{
				case 66 : // B
				case 98 : // b
					this.executeCommand('Bold');
					return BX.PreventDefault(e);
				case 105 : // i
				case 73 : // I
					this.executeCommand('Italic');
					return BX.PreventDefault(e);
				case 117 : // u
				case 85 : // U
					this.executeCommand('Underline');
					return BX.PreventDefault(e);
			}
		}
	}

	// Tab and Shift+Tab
	if (key == 16) // Shift
	{
		var _this = this;
		this._bShiftPressed = true;
		setTimeout(function(){_this._bShiftPressed = false;}, 200);
	}
	else if (key == 9)
	{
		// It's SHIFT + TAB
		if (this._bShiftPressed || e.shiftKey)
		{
			this.executeCommand('Outdent');
			return BX.PreventDefault(e);
		}
		else // It's TAB
		{
			this.executeCommand('Indent');
			return BX.PreventDefault(e);
		}
	}

	// Ctrl + V or Shift + Ins
	if ((e.ctrlKey && key == 86) ||
		((this._bShiftPressed || e.shiftKey) && key == 45))
		this.OnCtrlV();
};

BXHTMLEditor.prototype.OnCtrlV = function()
{
	var arUsedId = {}, _this = this;

	setTimeout(function(){
		CheckChilds(_this.pEditorDocument.body, {
			func: function(node)
			{
				if (node.nodeType != 1)
					return;

				var id = node.id;
				if (!id || id.substr(0, 5) != "bxid_")
					return;

				if (arUsedId[id] === true)
				{
					var oTag = _this.GetBxTag(node);
					if (oTag.tag)
					{
						oTag.id = null;
						delete oTag.id;
						node.id = '';
						node.removeAttribute('id');

						var newId = _this.SetBxTag(node, copyObj(oTag));

						// Temp hack. TODO: save comp params in oTag.params
						if (oTag.tag == 'component2' && _this.pComponent2Taskbar)
						{
							_this.pComponent2Taskbar.SetParams({id: newId, params: copyObj(_this.pComponent2Taskbar.GetParams({id: id}))});
						}
						arUsedId[newId] = true;
					}
				}
				else
				{
					arUsedId[id] = true;
				}
			},
			obj: _this
		});
		arUsedId = null;

	}, 500);
};

BXHTMLEditor.prototype.OnPaste = function (e)
{
	var clipboardHTML = this.GetClipboardHTML();
	var AutoDetectWordContent = true;
	if (AutoDetectWordContent)
	{
		var RE_MS_WORD = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;
		if (RE_MS_WORD.test(clipboardHTML))
		{
			if (confirm(BX_MESS.MaybeTextFromWord))
			{
				this.bNotFocus = true;
				this.pMainObj.OpenEditorDialog("pasteword", false, 450);
				e.returnValue = false;
				e.cancelBubble = true;
			}
			else
				return;
		}
	}
};

BXHTMLEditor.prototype.GetClipboardHTML = function()
{
	var oDiv = document.createElement('DIV');
	oDiv.style.visibility = 'hidden';
	oDiv.style.overflow = 'hidden';
	oDiv.style.position = 'absolute';
	oDiv.style.width = 1;
	oDiv.style.height = 1;

	document.body.appendChild(oDiv);
	oDiv.innerHTML = '';

	var oRange = document.body.createTextRange();
	oRange.moveToElementText(oDiv);
	oRange.execCommand("Paste");

	var sData = oDiv.innerHTML;
	oDiv.innerHTML = '';

	return sData;
};

BXHTMLEditor.prototype.OnKeyPress = function (e, bEdit)
{
	this.bFirstClick = true;
	if(!e)
		e = window.event;

	if(e.keyCode == 27)
	{
		if (this.oPublicDialog && !this.CheckSubdialogs())
			return this.oPublicDialog.Close();

		if (window.oBXEditorDialog && window.oBXEditorDialog.isOpen)
			return window.oBXEditorDialog.Close();

		if (window.oBXContextMenu && oBXContextMenu.menu && oBXContextMenu.menu.IsVisible())
			oBXContextMenu.menu.PopupHide();
	}

	if (!bEdit && e.keyCode == 13)
	{
		var target = e.target || e.srcElement;
		if (target && target.nodeName.toUpperCase() == 'TEXTAREA')
			return true;
		return BX.PreventDefault(e);
	}
	return true;
};

BXHTMLEditor.prototype.RemoveElements = function (arParentElement, tagName, arAttributes, oRange)
{
	var arChildren;
	arChildren = arParentElement.children;
	if(arChildren)
	{
		for(var i=0; i<arChildren.length; i++)
		{
			var elChild = arChildren[i];

			this.RemoveElements(elChild, tagName, arAttributes);

			if(elChild.tagName.toLowerCase() != tagName.toLowerCase())
				continue;


			var bEqual = true;
			for(var attrName in arAttributes)
			{
				attrValue = arAttributes[attrName];
				switch(attrName.toLowerCase())
				{
					case 'style':
						var styleValue = attrValue.toLowerCase();
						var re = /([^:]+):[^;]+/g;
						var arr;
						while((arr = re.exec(styleValue)) != null)
						{
							var styleName = RegExp.$1;
							if(elChild.style.cssText.toLowerCase().indexOf(styleName.toLowerCase())==-1)
							{
								bEqual = false;
								break;
							}
						}
						break;
					case 'class' :
						if(elChild.getAttribute('className', 0) != attrValue)
							bEqual = false;
						break;
					default:
						if(elChild.getAttribute(attrNalue, 0) != attrValue)
							bEqual = false;
				}
			}

			if(bEqual)
			{
				elChild.insertAdjacentHTML('beforeBegin', elChild.innerHTML);
				elChild.parentElement.removeChild(elChild);
			}
		}
	}
};

BXHTMLEditor.prototype.WrapSelectionWith = function (tagName, arAttributes)
{
	this.SetFocus();
	var oRange, oSelection;

	if (!tagName)
		tagName = 'SPAN';

	var sTag = 'FONT', i, pEl, arTags, arRes = [];

	try{this.pEditorDocument.execCommand("styleWithCSS", false, false);}catch(e){}
	this.executeCommand("FontName", "bitrixtemp");
	try{this.pEditorDocument.execCommand("styleWithCSS", false, false);}catch(e){}

	arTags = this.pEditorDocument.getElementsByTagName(sTag);

	for(i = arTags.length - 1; i >= 0; i--)
	{
		if (arTags[i].getAttribute('face') != 'bitrixtemp')
			continue;

		pEl = BX.create(tagName, arAttributes, this.pEditorDocument);
		arRes.push(pEl);

		while(arTags[i].firstChild)
			pEl.appendChild(arTags[i].firstChild);

		arTags[i].parentNode.insertBefore(pEl, arTags[i]);
		arTags[i].parentNode.removeChild(arTags[i]);
	}

	return arRes;
};

BXHTMLEditor.prototype.RidOfNode = function (pNode, bHard)
{
	if (!pNode || pNode.nodeType != 1)
		return;

	var i, nodeName = pNode.tagName.toLowerCase();
	if (nodeName == 'span' || nodeName == 'strike' || nodeName == 'font') // Check node names
	{
		if (bHard !== true)
		{
			for (i = pNode.attributes.length - 1; i >= 0; i--)
			{
				if (BX.util.trim(pNode.getAttribute(pNode.attributes[i].nodeName.toLowerCase())) != "")
					return false; // Node have attributes, so we cant get rid of it without loosing info
			}
		}

		var arNodes = pNode.childNodes;
		while(arNodes.length > 0)
			pNode.parentNode.insertBefore(arNodes[0], pNode);

		pNode.parentNode.removeChild(pNode);
		this.OnEvent("OnSelectionChange");
		return true;
	}

	return false;
}

BXHTMLEditor.prototype.GetToolbarSet = function ()
{
	return this.arToolbarSet;
};

BXHTMLEditor.prototype.GetTaskbarSet = function ()
{
	return this.arTaskbarSet;
};

BXHTMLEditor.prototype.SelectElement = function (pElement)
{
	if(this.pEditorWindow.getSelection)
	{
		var oSel = this.pEditorWindow.getSelection();
		oSel.selectAllChildren(pElement);
		oRange = oSel.getRangeAt(0);
	}
	else
	{
		this.pEditorDocument.selection.empty();
		var oRange = this.pEditorDocument.selection.createRange();

		if (oRange.moveToElementText)
			oRange.moveToElementText(pElement);
		oRange.select();
	}
	return oRange;
};

BXHTMLEditor.prototype.CollapseSelection = function ()
{
	if(this.pEditorWindow.getSelection)
	{
		var oSel = this.pEditorWindow.getSelection();
		if (oSel.collapseToEnd)
			oSel.collapseToEnd();
	}
	else if (this.pEditorDocument && this.pEditorDocument.selection && this.pEditorDocument.selection.empty)
	{
		this.pEditorDocument.selection.empty();
	}
}

BXHTMLEditor.prototype.GetSelectedNode = function(bOnlyNode)
{
	var oSelection;
	if(this.pEditorDocument.selection && !BX.browser.IsIE9())  // IE, exept IE9
	{
		oSelection = this.pEditorDocument.selection;

		var s = oSelection.createRange();
		if(oSelection.type=="Control")
			return s.commonParentElement();

		if(s.parentElement() && (s.text == s.parentElement().innerText || bOnlyNode))
			return (s.parentElement().childNodes.length == 1) ? s.parentElement().firstChild : s.parentElement();

		return s;
	}
	else
	{
		oSelection = this.pEditorWindow.getSelection();
		if(!oSelection || oSelection.rangeCount!=1)
			return false;

		var oRange, container;
		oRange = oSelection.getRangeAt(0);
		container = oRange.startContainer;
		if(container.nodeType != 3)
		{
			if(container.nodeType == 1 && container.childNodes.length <= 0)
				return container;
			else if(oRange.endOffset - oRange.startOffset == container.childNodes.length)
				return container
			else if(oRange.endOffset - oRange.startOffset < 2)
				return container.childNodes[oRange.startOffset];
			else
				return false;
		}

		return container;
	}
};


BXHTMLEditor.prototype.GetSelectionObjects = function ()
{
	var oSelection;
	if(this.pEditorDocument.selection && !BX.browser.IsIE9()) // IE, exept IE9
	{
		oSelection = this.pEditorDocument.selection;
		var s = oSelection.createRange();

		if(oSelection.type=="Control")
			return s.commonParentElement();

		return s.parentElement();
	}
	else // FF
	{
		oSelection = this.pEditorWindow.getSelection();
		if(!oSelection)
			return false;
		var oRange;
		var container, temp;
		var res = [];
		for(var i = 0; i < oSelection.rangeCount; i++)
		{
			oRange = oSelection.getRangeAt(i);
			container = oRange.startContainer;
			if(container.nodeType != 3)
			{
				if(container.nodeType == 1 && container.childNodes.length <= 0)
					res[res.length] = container;
				else
					res[res.length] = container.childNodes[oRange.startOffset];
			}
			else
			{
				temp = oRange.commonAncestorContainer;
				while(temp && temp.nodeType == 3)
					temp = temp.parentNode;
				res[res.length] = temp;
			}
		}
		if(res.length > 1)
			return res;
		return res[0];
	}
};

BXHTMLEditor.prototype.OptimizeHTML = function (str)
{
	// TODO: kill links without text and names
	// TODO: Kill multiple line ends

	var
		iter = 0,
		bReplasing = true,
		arTags = ['b', 'em', 'font', 'h\\d', 'i', 'li', 'ol', 'small', 'span', 'strong', 'u', 'ul'],
		replaceEmptyTags = function(){i--; bReplasing = true; return ' ';},
		re, tagName, i, l;

	while(iter++ < 20 && bReplasing)
	{
		bReplasing = false;
		for (i = 0, l = arTags.length; i < l; i++)
		{
			tagName = arTags[i];
			re = new RegExp('<'+tagName+'[^>]*?>\\s*?</'+tagName+'>', 'ig');
			str = str.replace(re, replaceEmptyTags);

			re = new RegExp('<' + tagName + '\\s+?[^>]*?/>', 'ig');
			str = str.replace(re, replaceEmptyTags);

			// Replace <b>text1</b>    <b>text2</b> ===>>  <b>text1 text2</b>
			if (tagName !== 'li')
			{
				re = new RegExp('<((' + tagName + '+?)(?:\\s+?[^>]*?)?)>([\\s\\S]+?)<\\/\\2>\\s*?<\\1>([\\s\\S]+?)<\\/\\2>', 'ig');
				str = str.replace(re, function(str, b1, b2, b3, b4)
					{
						bReplasing = true;
						return '<' + b1 + '>' + b3 + ' ' + b4 + '</' + b2 + '>';
					}
				);
			}
		}
	}
	return str;
};


BXHTMLEditor.prototype.GetSelectionObject = function ()
{
	var res = this.GetSelectionObjects();
	if(res && res.constructor == Array)
	{
		var root = res[0];
		for(var i = 1; i < res.length; i++)
			root = BXFindParentElement(root, res[i]);

		return root;
	}
	return res;
};

BXHTMLEditor.prototype.CreateEditorElement = function (sTagname, arParams, arStyles)
{
	return BXCreateElement(sTagname, arParams, arStyles, this.pEditorDocument);
};

BXHTMLEditor.prototype.CreateCustomElement = function(sTagName, arParams)
{
	var ob = new window[sTagName]();
	ar_CustomElementS.push(ob);
	ob.pMainObj = this;
	ob.pDocument = this.pDocument;
	ob.CreateElement = BXCreateElement;

	if(arParams)
	{
		var sParamName;
		for(sParamName in arParams)

			if(sParamName.toLowerCase() == '_oncreate')
				arParams[sParamName].apply(ob);
			else
				ob[sParamName] = arParams[sParamName];
	}
	if (ob._Create)
		ob._Create();
	return ob;
};


BXHTMLEditor.prototype.AddEventHandler = function (eventName, pEventHandler, pObject)
{
	if(!this.arEventHandlers[eventName])
		this.arEventHandlers[eventName] = [];
	this.arEventHandlers[eventName].push([pEventHandler, pObject]);
};

BXHTMLEditor.prototype.OnEvent = function (eventName, arParams)
{
	if(!this.arEventHandlers[eventName])
		return true;

	var res = true;
	for(var i=0; i < this.arEventHandlers[eventName].length; i++)
	{
		if(this.arEventHandlers[eventName][i][1])
		{
			if(!arParams)
				arParams = [];
			if(!this.arEventHandlers[eventName][i][0].apply(this.arEventHandlers[eventName][i][1], arParams))
				res = false;
		}
		else
		{
			if(!this.arEventHandlers[eventName][i][0](arParams))
				res = false;
		}
	}
	return res;
};

BXHTMLEditor.prototype.FullResize = function()
{
	var ws = BX.GetWindowInnerSize();
	window.__fswindow.style.width = parseInt(ws.innerWidth) + "px";
	window.__fswindow.style.height = parseInt(ws.innerHeight) + "px";

	this.OnEvent('OnFullResize', []);
};

BXHTMLEditor.prototype.ClearPosCache = function ()
{
	CACHE_DISPATCHER['BXTaskbarset_VPos_' + this.name] = null;
	CACHE_DISPATCHER['BXTasktab_VPos_' + this.name] = null;
	CACHE_DISPATCHER['pEditorFrame_' + this.name] = null;
	CACHE_DISPATCHER['pEditorFrame'] = null;
	CACHE_DISPATCHER['BXToolbarSet_pos_0'] = null;
	CACHE_DISPATCHER['BXToolbarSet_pos_1'] = null;
	CACHE_DISPATCHER['BXToolbarSet_pos_2'] = null;
	CACHE_DISPATCHER['BXToolbarSet_pos_3'] = null;
};

BXHTMLEditor.prototype.SetFullscreen = function (bFull)
{
	this.ClearPosCache();
	var _this = this;

	if(bFull)
	{
		var ws = BX.GetWindowInnerSize();
		BX.addClass(this.pWnd, "bxedmain-fullscreen");
		this.pDocument.body.style.overflow = "hidden";
		this.__oldSize = [this.pWnd.style.width, this.pWnd.style.height];

		var innerWidth = parseInt(ws.innerWidth);
		var innerHeight = parseInt(ws.innerHeight);

		if(BX.browser.IsIE() && !IEplusDoctype)
			innerWidth += 18;

		this.pWnd.style.width = innerWidth + "px";
		this.pWnd.style.height = innerHeight + "px";
		window.scrollTo(0, 0);

		window.__fswindow = this.pWnd;
		window._bxonresize = window.onresize || null;
		window.onresize = function(){_this.FullResize();};
	}
	else
	{
		BX.removeClass(this.pWnd, "bxedmain-fullscreen");
		this.pDocument.body.style.overflow = "auto";
		if (!this.__oldSize)
			return;
		this.pWnd.style.width = this.__oldSize[0];
		this.pWnd.style.height = this.__oldSize[1];
		window.__fswindow = null;
		window.onresize = window._bxonresize || null;

		var pWnd = this.arTaskbarSet[3].pWnd;
		if (parseInt(pWnd.offsetHeight) >= 245)
		{
			pWnd.style.height = '245px';
			var pParWnd = this.arTaskbarSet[2].pParentWnd;
			var display = pParWnd.style.display;
			pParWnd.style.display = 'none';
			var _this = this;
			setTimeout(function() {pParWnd.style.display = display; _this.IEplusDoctypePatchSizes();}, 10);
		}
		this._DisplaySourceFrame(true);
	}

	this.arTaskbarSet[2]._SetTmpClass(true);

	this.arTaskbarSet[2].Resize();
	this.arTaskbarSet[3].Resize();

	this.bFullscreen = bFull;
	if(this.pDocument.getElementById('fullscreen'))
		this.pDocument.getElementById('fullscreen').value = (bFull ? 'Y' : 'N');

	if (IEplusDoctype)
	{
		this.IEplusDoctypePatchSizes();
		// IE in standart mode needs to refresh DOM tree
		var pWnd = this.arTaskbarSet[3].arTaskbars[0].pWnd;
		pWnd.parentNode.appendChild(pWnd); // TODO: check this ??????????
	}

	this.SetCursorFF();

	this.OnEvent('OnFullscreen', [bFull]);
};


BXHTMLEditor.prototype.ParseStyles = function ()
{
	this.arStyles = [];
};


BXHTMLEditor.prototype._FuncOnChange = function(obj, type, subtype)
{
	return function(){obj._OnChange(type, subtype);}
};

BXHTMLEditor.prototype.OnChange = function(type, subtype)
{
	if(this.bSkipChanges == true)
		return;

	if(!subtype)
		subtype = "";


	if(this.sOnChangeLastType != type || this.sOnChangeLastSubType != subtype)
	{
		this._OnChange(type, subtype);
		return;
	}

	if(this.pOnChangeTimer)
		clearTimeout(this.pOnChangeTimer);

	this.pOnChangeTimer = setTimeout(this._FuncOnChange(this, type, subtype), 1000);
};

BXHTMLEditor.prototype.IsChanged = function()
{
	if (!this.bFirstClick)
		return false;
	if(this.bNotSaved)
		return true;
	this.SaveContent();

	var firstContent = this.sFirstContent.trim();
	var curContent = this.GetContent().trim();
	if(firstContent.length == curContent.length && firstContent == curContent)
		return false;

	return true;
};


BXHTMLEditor.prototype._OnChange = function(type, subtype)
{
	this.sOnChangeLastType = type;
	this.sOnChangeLastSubType = subtype;

	var curContent = this.pEditorDocument.body.innerHTML;
	if(this.sLastContent.length==curContent.length && this.sLastContent == curContent)
		return;

	var xx = this.sLastContent;
	this.sLastContent = curContent;

	if(BX.browser.IsIE())
	{
		if(type!='Undo' && type!='Redo')
		{
			var lastUndoItem = this.arUndoBuffer.length;
			if(this.iUndoPos + 1 < lastUndoItem)
			{
				this.arUndoBuffer.length = this.iUndoPos + 1;
				lastUndoItem = this.iUndoPos + 1;
			}

			var pos = false;
			if(this.pEditorDocument.selection)
			{
				if(this.pEditorDocument.selection.type == 'Text')
					pos = this.pEditorDocument.selection.createRange().getBookmark();
			}

			this.arUndoBuffer.push({'type': type, 'subtype': subtype, 'content': curContent, 'pos': pos});
			var cnt = lastUndoItem - this.arConfig["undosize"];
			if(cnt>0)
			{
				this.arUndoBuffer.reverse();
				this.arUndoBuffer.length = this.arUndoBuffer.length - cnt;
				this.arUndoBuffer.reverse();
			}

			this.iUndoPos = this.arUndoBuffer.length - 1;
		}
		this.bNotSaved = (this.iUndoPos > 0);
	}
	else
	{
		if(this.iUndoPos < 0)
			this.iUndoPos = 0;
		else
			this.bNotSaved = true;
	}

	this.OnEvent("OnChange");
};

BXHTMLEditor.prototype.SetXXdo = function(type)
{
	var arUndoInfo = this.arUndoBuffer[this.iUndoPos];
	this.pEditorDocument.body.innerHTML = arUndoInfo['content'];
	this._OnChange(type);
	this.sLastContent = this.pEditorDocument.body.innerHTML;

	if(arUndoInfo['pos'])
	{
		if(this.pEditorDocument.selection)
		{
			var oRange = this.pEditorDocument.selection.createRange();
			oRange.moveToBookmark(arUndoInfo['pos']);
			oRange.select();
		}
	}
};

BXHTMLEditor.prototype.UndoStatus = function()
{
	return !(this.iUndoPos < 1 || this.arUndoBuffer.length <= 0);
};

BXHTMLEditor.prototype.Undo = function(pos)
{
	if(!this.UndoStatus())
		return;

	if(this.iUndoPos<pos)
		this.iUndoPos = 0;
	else
		this.iUndoPos = this.iUndoPos - pos;

	this.SetXXdo("Undo");
};

BXHTMLEditor.prototype.RedoStatus = function(pos)
{
	return !(this.iUndoPos + 1 >= this.arUndoBuffer.length || this.arUndoBuffer.length<=0);
};

BXHTMLEditor.prototype.Redo = function(pos)
{
	if(!this.RedoStatus())
		return;

	if(this.iUndoPos + pos >= this.arUndoBuffer.length)
		this.iUndoPos = this.arUndoBuffer.length-1;
	else
		this.iUndoPos = this.iUndoPos + pos;

	this.SetXXdo("Redo");
};

BXHTMLEditor.prototype.Clean = function(pos)
{
	return;
	this.pFrame = null;
	this.pWnd.pMainObj = null;
	this.pWnd = null;
	this.pForm = null;
	this.pComponent2Taskbar = null;
	this.pLoaderFrame = null;

	for (var evname in this.arEventHandlers)
		this.arEventHandlers[evname] = null;
	this.arEventHandlers = null;

	var l = this.arToolbarSet.length;
	for (var i=0;i<l;i++)
		this.arToolbarSet[i] = null;

	var l = this.arTaskbarSet.length;
	for (var i=0;i<l;i++)
		this.arTaskbarSet[i] = null;

	this.lineNumCont = null;
	this.pSourceFrame.onkeydown = null;
	this.pSourceFrame = null;
	this.pEditorWindow = null;
	this.pEditorFrame = null;
	this.pEditorDocument.pMainObj = null;
	this.pEditorDocument = null;
	this.pDocument = null;
	this.pParser = null;

};

BXHTMLEditor.prototype.IEPatchSizesHandler = function(value)
{
	var _this = this;
	setTimeout(function(){_this.IEplusDoctypePatchSizes()}, 100);
}

BXHTMLEditor.prototype.IEplusDoctypePatchSizes = function(value)
{
	return;
	if (!IEplusDoctype)
		return;

	var tbs2 = this.arTaskbarSet[2];
	var tbs3 = this.arTaskbarSet[3];
	if (isNaN(value))
	{
		if (tbs3.pWnd.style.display != 'none')
			value = parseInt(tbs3.pWnd.style.height);
		else
			value = 0;
	}
	else
		value = value - 35;

	if (value == 0) // padding-bottom when hide bottom taskbarset
		value = - 33;

	var edHeight = parseInt((this.bFullscreen) ? BX.GetWindowInnerSize().innerHeight : this.arConfig["height"]);
	var centerRowH = edHeight - value - 114;

	if (isNaN(centerRowH))
		return;
	this.pFrame.rows[1].style.height = centerRowH + "px";


	if (this.sEditorMode == 'html')
	{
		this.pEditorFrame.style.height = centerRowH + "px";
	}
	else if (this.sEditorMode == 'split')
	{
		this.pEditorFrame.style.height = (Math.round(centerRowH / 2) - 3) + "px";
		this.pSourceFrame.style.height = (Math.round(centerRowH / 2) - 4) + "px";
	}
	else if (this.sEditorMode == 'code')
	{
		this.pSourceFrame.style.height = (centerRowH - 6)+ "px";
	}

	if (tbs2.bShowing)
	{
		var tb, titleCell, dataCell;
		var l = tbs2.arTaskbars.length;

		var bH, tH = 25;
		if (l > 1)
		{
			bH = 25;
			tbs2.pWnd.style.height = (centerRowH - 45) + "px";
			tbs2.pBottomColumn.style.height = bH + "px";
		}
		else
			bH = 0;

		var dH = centerRowH - tH - bH - 6;
		for(var i = 0; i < l; i++)
		{
			tb = tbs2.arTaskbars[i].pWnd;
			tb.rows[0].cells[0].style.height = tH + "px"; // title cell
			tb.rows[1].cells[0].style.height = dH + "px"; // data cell
		}
	}


	var o, btt;
};

BXHTMLEditor.prototype.OnSpellCheck = function()
{
	BX.closeWait();
	var alreadyCheck = false;
	if (this.pMainObj.arConfig["spellCheckFirstClient"] == "Y")
		alreadyCheck = SpellCheck_MS(this.pMainObj.pEditorDocument.body);

	var usePspell = this.pMainObj.arConfig["usePspell"];
	//var useCustomSpell = this.pMainObj.arConfig["useCustomSpell"];
	var useCustomSpell = "N";

	if (!alreadyCheck)
	{
		if (usePspell == "Y" || useCustomSpell == "Y")
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("spellcheck", false, 400, {BXLang: BXLang, usePspell: usePspell, useCustomSpell: useCustomSpell}, true);
		}
		else
		{
			alert(BX_MESS.SpellCheckNotInstalled);
		}
	}
};

BXHTMLEditor.prototype.SaveConfig = function(sTarget, data)
{
	if (typeof data != 'object')
		data = {};

	data.edname = this.name;

	switch(sTarget)
	{
		case "tooltips":
			data.tooltips = this.showTooltips4Components ? "Y" : "N";
			break;
		case "visual_effects":
			data.visual_effects = this.visualEffects ? "Y" : "N";
			break;
		case "render_components":
			data.render_components = this.bRenderComponents ? "Y" : "N";
			break;
	}
	return BX.ajax.post(settings_page_path + '&target=' + sTarget, data);
};

BXHTMLEditor.prototype.GetConfig = function(oCallBack)
{
	//Tooltips
	this.showTooltips4Components = SETTINGS[this.name].showTooltips4Components;

	// Visual effects
	this.visualEffects = SETTINGS[this.name].visualEffects;

	oCallBack.func.apply(oCallBack.obj);
};

BXHTMLEditor.prototype.RestoreConfig = function()
{
	return BX.ajax.post(settings_page_path + '&target=unset&edname=' + this.name, {}, function(){alert(BX_MESS.RestoreSettingsMess);});
};

BXHTMLEditor.prototype.GetTaskbarConfig = function(name)
{
	if (SETTINGS[this.name].arTaskbarSettings[name])
		return SETTINGS[this.name].arTaskbarSettings[name];
	else if (arTaskbarSettings_default[name])
		return arTaskbarSettings_default[name];
	else
		return {show : true, set: 2, active: false};
}

BXHTMLEditor.prototype.CheckTaskbar = function(taskbar)
{
	return BXTaskbar && typeof BXTaskbar == 'object' && BXTaskbar.pMainObj && BXTaskbar.name && !BXTaskbar.bDeleted;
};

BXHTMLEditor.prototype.SetBxTag = function(pElement, params)
{
	var id;
	if (params.id || pElement && pElement.id)
	{
		id = params.id || pElement.id;
	}

	if (!id)
	{
		id = 'bxid_' + Math.round(Math.random() * 1000000);
	}
	else
	{
		if (this.bxTags[id])
		{
			if (!params.tag)
				params.tag = this.bxTags[id].tag;
		}
	}

	params.id = id;
	if (pElement)
		pElement.id = params.id;

	this.bxTags[params.id] = params;
	return params.id;
};

BXHTMLEditor.prototype.GetBxTag = function(id)
{
	if (id)
	{
		if (typeof id != "string" && id.id)
			id = id.id;

		if (id && id.length > 0 && this.bxTags[id] && this.bxTags[id].tag)
		{
			this.bxTags[id].tag = this.bxTags[id].tag.toLowerCase();
			return this.bxTags[id];
		}
	}

	return {tag: false};
}

BXHTMLEditor.prototype.Add2BxTag = function(id, params)
{
	if (typeof id != "string")
		id = id.id;

	if (!id)
		return;

	var oTag = this.GetBxTag(id), k;
	for(k in params)
	{
		if (typeof params[k] != 'function')
		{
			oTag.params[k] = params[k];
		}
	}
};

BXHTMLEditor.prototype.CheckSubdialogs = function()
{
	if (window.oBXEditorDialog && window.oBXEditorDialog.isOpen || this.oTransOverlay.bShowed)
		return true;
	return false;
};

BXHTMLEditor.prototype.AuthFailureHandler = function(name, arAuthResult)
{
	if (name != this.name || this._authShowed)
		return;

	var _this = this;
	function auth_callback()
	{
		_this._authShowed = false;
		if (_this.__authFailureHandlerCallback)
			_this.__authFailureHandlerCallback();
	}

	this._authShowed = true;
	var authDialog = new BX.CAuthDialog({
		content_url: '/bitrix/admin/fileman_editor_dialog.php',
		auth_result: arAuthResult,
		callback: BX.delegate(function(){
			if (auth_callback)
				auth_callback()
		}, this)
	});

	authDialog.Show();

	BX.addCustomEvent(authDialog, 'onWindowUnRegister', function()
	{
		_this._authShowed = false;
		if (_this.__authFailureHandlerCallbackClose)
			_this.__authFailureHandlerCallbackClose();
	});
};

BXHTMLEditor.prototype.InsertHtmlEx = function(html, timeout)
{
	if (!timeout)
		timeout = 50;
	var id = 'tmp_bxid_' + Math.round(Math.random() * 1000000);
	this.insertHTML('<a id="' + id + '" href="#" _moz_editor_bogus_node="on">+</a>');
	var pDoc = this.pEditorDocument;
	setTimeout(function(){
		var pTmp = pDoc.getElementById(id);
		if (pTmp)
		{
			pTmp.innerHTML = html;
			setTimeout(function(){
				var pTmp = pDoc.getElementById(id);
				if (pTmp)
				{
					for (var i = pTmp.childNodes.length - 1; i >= 0; i--)
						pTmp.parentNode.insertBefore(pTmp.childNodes[i], pTmp);
					if (pTmp.parentNode)
						pTmp.parentNode.removeChild(pTmp);
				}
			}, timeout);
		}
	}, timeout);
}


function BXContextMenuOnclick(e)
{
	removeEvent(this.pMainObj.pEditorDocument, "click", BXContextMenuOnclick);
	oBXContextMenu.menu.PopupHide();
};

function BXStyles(pMainObj)
{
	this.pMainObj = pMainObj;
	this.arStyles = [];
	this.sStyles = '';

	BXStyles.prototype.Parse = function (styles, template_path)
	{
		this.templatePath = template_path || '';
		this.sStyles = styles;
		this.arStyles = BXStyleParser.Parse(styles);
	};

	BXStyles.prototype.GetStyles = function (sFilter)
	{
		if(this.arStyles[sFilter.toUpperCase()])
			return this.arStyles[sFilter.toUpperCase()];
		return [];
	};

	BXStyles.prototype.SetToDocument = function(pDocument)
	{
		var pHeads = pDocument.getElementsByTagName("HEAD");
		if(pHeads.length != 1)
			return;

		var cur = pDocument.getElementsByTagName("STYLE");
		for(var i = 0; i < cur.length; i++)
			cur[i].parentNode.removeChild(cur[i]);

		var xStyle = pDocument.createElement("STYLE");
		pHeads[0].appendChild(xStyle);
		var styles = this.sStyles;

		//try{
		if(BX.browser.IsIE())
			pDocument.styleSheets[0].cssText = styles;
		else
			xStyle.appendChild(pDocument.createTextNode(styles));
		//}catch(e){}
	};
}

BX.ready(BXEditorLoad);htmleditor2/editor_src.js000064400000004357150240170740011505 0ustar00BXHTMLEditor.prototype.SetCodeEditorContent = function(sContent)
{
	this.pSourceFrame.value = this.SetCodeEditorContent_ex(sContent);
};

BXHTMLEditor.prototype.GetCodeEditorContent = function()
{
	return this.pSourceFrame.value;
	if(this.pSourceDocument.body.innerText)
		return this.pSourceDocument.body.innerText;

	var html = this.pSourceWindow.document.body.ownerDocument.createRange();
	html.selectNodeContents(this.pSourceWindow.document.body);
	return html.toString().replace(/\xA0+/g, ' ');
};


BXHTMLEditor.prototype.SetView = function(sType)
{
	//console.info('BXHTMLEditor.prototype.SetView = ' + sType);
	if (this.sEditorMode == sType)
		return;
	
	this.SaveContent();
	switch(sType)
	{
		case 'code':
			this.pSourceFrame.style.height = "99%";
			this.pEditorFrame.style.display = "none";
			this.pSourceFrame.style.display = "inline";
			if (IEplusDoctype)
			{
				this.pSourceFrame.rows = "50";
				this.pSourceDiv.style.height = "99%";
				this.pSourceDiv.style.display = "block";
			}
			//console.info('code SetView > this.GetContent() = '+ this.GetContent());
			this.SetCodeEditorContent(this.GetContent());
			break;
		case 'split':
			this.pEditorFrame.style.height = "50%";
			if (IEplusDoctype)
			{
				this.pSourceFrame.rows = "40";
				this.pSourceDiv.style.height = "49%";
				this.pSourceDiv.style.display = "block";
			}
			else
			{
				this.pSourceFrame.style.height = "49%";
			}
			
			this.pSourceFrame.style.display = "inline";
			this.pEditorFrame.style.display = "block";
			if(this.sEditorMode == 'code')
				this.SetEditorContent(this.GetContent());
			else if(this.sEditorMode == 'html')
				this.SetCodeEditorContent(this.GetContent());
			break;
		default:
			this.pEditorFrame.style.height = "100%";
			this.pSourceFrame.style.display = "none";
			this.pEditorFrame.style.display = "block";
			if (IEplusDoctype)
				this.pSourceDiv.style.display = "none";
			//console.info('html SetView > this.GetContent() = '+ this.GetContent());
			this.SetEditorContent(this.GetContent());
			sType = "html";
	}
	
	//console.info("SPLIT >> \n this.sEditorMode= " + this.sEditorMode + "\n this.sEditorSplitMode = "+ this.sEditorSplitMode + "\n");
	
	this.sEditorMode = sType;
	this.OnEvent("OnChangeView", [this.sEditorMode, this.sEditorSplitMode]);
};htmleditor2/editor.css000064400000126504150240170740011011 0ustar00div.bx-editor-dialog-cont {overflow: hidden !important;}
div.bx-editor-dialog-cont .table{border-collapse: collapse !important; margin: 0!important; padding: 0!important;}
div.bx-editor-dialog-cont .table td{padding: 0px;}
.bxedmain-cont{overflow: hidden; border: 1px solid #808080 !important; width: 100%; height: 100%;}
.bxedmain-fullscreen{position: absolute !important; top: 0!important; left: 0!important; z-index: 2000!important;}
.bxedmainframe, .bxedmainframe table{border-collapse: collapse !important; margin: 0!important; padding: 0!important;}
.dim100x100{width: 100%; height: 100%;}
.bxedmainframe td, .bxedmainframe table td{padding:0px !important;font-size: 11px !important; background-color: transparent!important; background-image: none; line-height: 1px;}
.bxedmainframe iframe{background-color: #FFFFFF !important;}
.bxedmainframe table, .bxedmainframe td {border-width: none !important;}
.bxedtoolbar {background-color: #CCCCCC;color: #000000;background-image:url(/bitrix/images/fileman/htmledit2/toolbarbg.gif); -moz-user-select: none;}
.bxedtoolbar td, div.global_toolbar_button td{padding:0px !important;background-image: url(/bitrix/images/fileman/htmledit2/toolbarbg.gif) !important;}
table.bxedmainframe .bxedtoolbarset, table.bxedmainframe .bxedtaskbarset{background: url(/bitrix/images/fileman/htmledit2/toolbarsetbg.gif) repeat transparent!important; vertical-align: top; padding: 0 !important;}
.bxedmainframe td .bxedtaskbarset td{background-color: #F4F3F1 !important; background-image: none;}
textarea.bxeditor-textarea{display: none; width: 100%; border-width: 0; background-color: #ffffff;box-shadow:none;border-radius: 0 !important; padding: 0 !important; max-height: none!important; max-width: none!important;line-height: normal;}

#bx-admin-prefix .bxedmainframe .bxedtoolbarset .bxed-toolbar-inner{width: auto;}
.bxedtoolbarset .bxed-toolbar-inner tr td{background: transparent;}

table.bxedtoolbaricons{width: 100%; border-collapse: collapse !important; height: 25px!important;  margin: 0!important; padding: 0!important;}
table.bxedtoolbaricons  td{padding: 0!important; vertical-align: top!important;}
.bxedtoolbartitle{cursor: move;}
.bxedmainframe td.bx-ceditor{width: 100%;height: 100%; vertical-align: top!important; background-color: #FFFFFF!important;}
iframe.bx-editor-iframe{width: 100%;height: 100%; border-width: 0 !important; margin: 0px!important;}

table.bx-ed-alignpicker{border-collapse: collapse!important; margin: 0!important; padding: 0!important;}
table.bx-ed-alignpicker td{padding: 0px!important;}
div.bx-alpick-cont{position: absolute; border: 1px solid #808080; background-color: #E4E2DC !important; display: none; width: 91px; height: 102px; top: -1000px; left: -1000px;}
div.bx-alpick-cont table.bx-alpic-tbl{border-collapse: collapse !important; margin: 3px!important;}
div.bx-alpick-cont table.bx-alpic-tbl td.bx-alpic-default{color: #000000 !important;font-size: 11px !important;font-family: Tahoma, Courier New !important;text-align: center !important;padding:0px !important;border: 1px solid #808080;cursor: pointer!important;}
div.bx-alpick-cont table.bx-alpic-tbl td.bx-alpic-default nobr{display: block!important; margin: 3px 5px!important;}
div.bx-alpick-cont table.bx-alpic-tbl td.bx-alpic-but{color: #000000 !important; font-size: 11px !important; font-family: Tahoma, Courier New !important; text-align: center !important;}
div.bx-alpick-cont table.bx-alpic-tbl td.bx-alpic-but .bxedtbutton{margin: 1px!important;}

.bx-props-taskbar{background-color: #F4F4F4!important;}
.bx-props-taskbar table td{background-color: #F4F4F4!important; line-height: 12px;}

.bxedtaskbar {color: #000000;vertical-align: top; width: 100%;}
.bxedtaskbar-scroll {vertical-align: top; width: 100%; overflow: auto;overflow-x: hidden;}
.bxedtaskbar-scroll-tmp{height: 80px!important; width: 90%; overflow: hidden !important; opacity: 0.3; filter: gray() alpha(opacity=30);}

.bxedtaskbar-root{width: 100%; padding: 10px 1px 1px 10px;}
.bxedtaskbar table {border-collapse: collapse; margin: 0!important; padding: 0!important;}
.bxedtaskbar table td{padding: 0px;}

table.edit-table table td.bxedtaskbarinner, table td.bxedtaskbarinner, td.bxedtaskbarinner {
	font-size: 12px !important;
	font-family: Tahoma, Courier New !important;
	background-color: #f4f3f1 !important;
	color: #000000 !important;
	vertical-align: top !important;
	border-left: 1px solid #808080 !important;
	border-right: 1px solid #808080 !important;
	padding: 1px !important;
}

.bxedtaskbar table.bxgroupblock1 td.iconcell1{padding: 2px 2px 2px 2px !important;width: 0%;}

.bxedtaskbar table.bxgroupblock1 td.titlecell1{padding: 4px 2px 2px 2px !important;vertical-align: top !important;width: 100%;line-height: 12px;}
table.edit-table table td.bxedtaskbarinner td{background-color: #f4f3f1 !important;color: #000000 !important;}
.bxedmainframe .bxedtaskbartitle, .bxedmainframe  .bxedtaskbartitletext{height: 26px; width: 100%;}
.bxedmainframe .bxedtaskbartitletext td{background: url(/bitrix/images/fileman/htmledit2/taskbartitlebkg.gif) repeat transparent !important;}

.bxedmainframe .bxedtaskbartitletext TD.head_text{font-size: 11px !important;font-family: Tahoma, Courier New !important;font-weight: bold !important;color: #000000 !important;padding: 4px 4px 4px 10px !important;line-height: 16px;}

.bxedtaskbartitletext TD.head_button{padding: 0px 2px 0px 2px !important; cursor: default !important;}
td.head-button-menu, td.head-button-hide{width: 25px; text-align: right; background-color: transparent !important; cursor: default !important;}
.bxedmainframe td.head-button-menu{width: 25px !important; vertical-align: top; padding: 3px 0 0 0 !important;}
.bxedmainframe td.head-button-hide{width: 20px !important;vertical-align: top; padding: 3px 2px 0 0 !important;}
.bxedmainframe td.head-button-menu div{background: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif) -60px -81px; width: 22px; height: 18px; float: left; margin: 1px;}
td.head-button-hide div{background: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif) -2px -102px; width: 18px; height: 18px; margin: 1px;}

table.bxedmainframe table.bx-taskbar-tabs .bxedtaskbaricontable {font-size: 12px; font-family: Tahoma, Courier New; background-color:#EFEFEF; color: #5C5C5C; padding: 1px; width: 100%; background-image: url(/bitrix/images/fileman/htmledit2/taskbar_tabs/0-bg.gif); background-repeat: repeat;}
.bxedpopupframe{position: absolute; z-index: 2085; left: -1000px; top: -1000px; background-color: #fff !important; border: 1px solid #808080 !important;}

.bxedtbuttonover{border: #4B4B6F 1px solid !important; background-color: #FFC678 !important;}

.bxedtbutton{height: 20px!important; width: 20px!important; background-position: 0px 1px; margin: 1px 0 1px 1px !important; padding: 0 !important;}

.bxedtbutton-over{}

.bxedtbutton-disabled
{
	border: #e4e2dc 1px solid!important;
	opacity: 0.3!important;
	filter: gray() alpha(opacity=30)!important;
}

div.bxseparator{background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif);background-position: -59px -60px;width: 2px; height: 24px;}
div.bxseparator-ver{background-position: -60px -78px!important; width: 20px!important; height: 2px!important;}


#bx_btn_Fullscreen{background-position: -20px 0!important;}
#bx_btn_Settings{background-position: -40px 0!important;}
#bx_btn_Cut{background-position: -60px 0!important;}
#bx_btn_Copy{background-position: -80px 0!important;}
#bx_btn_Paste{background-position: -100px 0!important;}
#bx_btn_pasteword{background-position: -120px 0!important;}
#bx_btn_pastetext{background-position: -140px 0!important;}
#bx_btn_SelectAll{background-position: -160px 0!important;}
#bx_btn_Undo{background-position: -180px 0!important;}
#bx_btn_Redo{background-position: -200px 0!important;}
#bx_btn_borders{background-position: -220px 0!important;}
#bx_btn_table{background-position: -240px 0!important;}
#bx_btn_anchor{background-position: -260px 0!important;}
#bx_btn_CreateLink{background-position: -280px 0!important;}
#bx_btn_deletelink{background-position: -300px 0!important;}
#bx_btn_image{background-position: -320px 0!important;}
#bx_btn_SpecialChar{background-position: -340px 0!important;}
#bx_btn_spellcheck{background-position: -360px 0!important;}
#bx_btn_insert_flash{background-position: -380px 0!important;}
#bx_btn_insertFile{background-position: -340px -40!important;}

#bx_btn_align_tl{background-position: -80px -60px!important;}
#bx_btn_align_tc{background-position: -100px -60px!important;}
#bx_btn_align_tr{background-position: -119px -60px!important;}
#bx_btn_align_cl{background-position: -80px -81px!important;}
#bx_btn_align_cc{background-position: -100px -81px!important;}
#bx_btn_align_cr{background-position: -119px -81px!important;}
#bx_btn_align_bl{background-position: -80px -101px!important;}
#bx_btn_align_bc{background-position: -100px -101px!important;}
#bx_btn_align_br{background-position: -119px -101px!important;}

#bx_btn__settings{background-position: -60px -100px!important;}
#bx_btn__taskbar_hide{background-position: 0px -100px!important;}
#bx_btn__taskbar_refresh{background-position: -20px -100px!important;}
#bx_btn__taskbar_close{background-position: -40px -100px!important;}

#bx_btn_insertcell_before{background-position: -140px -60px!important;}
#bx_btn_insertcell_after{background-position: -160px -60px!important;}
#bx_btn_deletecell{background-position: -180px -60px!important;}
#bx_btn_mergecells{background-position: -200px -60px!important;}
#bx_btn_merge_right{background-position: -220px -60px!important;}
#bx_btn_merge_bottom{background-position: -240px -60px!important;}
#bx_btn_split_hor{background-position: -260px -60px!important;}
#bx_btn_split_ver{background-position: -280px -60px!important;}
#bx_btn_insertrow_before{background-position: -140px -80px!important;}
#bx_btn_insertrow_after{background-position: -160px -80px!important;}
#bx_btn_mergeallcellsinrow{background-position: -200px -80px!important;}
#bx_btn_deleterow{background-position: -180px -80px!important;}
#bx_btn_insertcolumn_before{background-position: -220px -80px!important;}
#bx_btn_insertcolumn_after{background-position: -240px -80px!important;}
#bx_btn_mergeallcellsincolumn{background-position: -280px -80px!important;}
#bx_btn_deletecolumn{background-position: -260px -80px!important;}
#bx_btn_deletetable{background-position: -120px -40px!important;}
#bx_btn_tableprop{background-position: -241px 0px!important;}

#bx_btn_BackColor{background-position: -280px -21px!important;}
#bx_btn_ForeColor{background-position: -300px -21px!important;}

#bx_btn_Bold{background-position: 0px -20px!important;}
#bx_btn_Italic{background-position: -20px -20px!important;}
#bx_btn_Underline{background-position: -40px -20px!important;}
#bx_btn_Strike{background-position: -361px -38px!important;}
#bx_btn_RemoveFormat{background-position: -60px -20px!important;}
#bx_btn_Optimize{background-position: -80px -20px!important;}

#bx_btn_InsertHorizontalRule{background-position: -100px -20px!important;}
#bx_btn_JustifyLeft{background-position: -120px -20px!important;}
#bx_btn_JustifyCenter{background-position: -140px -20px!important;}
#bx_btn_JustifyRight{background-position: -160px -20px!important;}
#bx_btn_JustifyFull{background-position: -180px -20px!important;}
#bx_btn_InsertOrderedList{background-position: -200px -20px!important;}
#bx_btn_InsertUnorderedList{background-position: -220px -20px!important;}
#bx_btn_Outdent{background-position: -240px -20px!important;}
#bx_btn_Indent{background-position: -260px -20px!important;}

#bx_btn_wysiwyg{background-position: -320px -20px!important;}
#bx_btn_source{background-position: -340px -20px!important;}
#bx_btn_split{background-position: -360px -20px!important;}
#bx_btn_Wrap{background-position: -380px -20px!important;}
#bx_btn_page_break{background-position: -400px -20px!important;}
#bx_btn_break_tag{background-position: -420px -20px!important;}

#bx_btn_save_and_exit{background-position: 0px -40px!important;}
#bx_btn_exit{background-position: -20px -40px!important;}
#bx_btn_new{background-position: -40px -40px!important;}
#bx_btn_save{background-position: -60px -40px!important;}
#bx_btn_saveas{background-position: -80px -40px!important;}
#bx_btn_pageprops{background-position: -100px -40px!important;}

#bx_btn_edit_hbf{background-position: -139px -41px!important;}
#bx_btn_insert_wa{background-position: -220px -40px!important;}
#bx_btn_preview_tmpl{background-position: -200px -40px!important;}

div.tabs_common{height: 21px; width: 9px; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif);}
.bxedmainframe td .bxedtaskbarset td.bx-tsb-tab-act{background-image: url(/bitrix/images/fileman/htmledit2/taskbar_tabs/a-bg.gif)!important;}
.bxedmainframe td .bxedtaskbarset td.bx-tsb-tab{background-image: url(/bitrix/images/fileman/htmledit2/taskbar_tabs/d-bg.gif)!important;}
td span.bx-tsb-title{overflow:hidden !important; cursor:pointer!important; white-space: nowrap!important; display: inline-block; margin: 3px 0 0; line-height: 16px;}

div.bx_btn_tabs_0a{background-position: -209px -100px;}
div.bx_btn_tabs_0d{background-position: -218px -100px;}
div.bx_btn_tabs_a0{background-position: -227px -100px;}
div.bx_btn_tabs_ad{background-position: -236px -100px;}
div.bx_btn_tabs_d0{background-position: -245px -100px;}
div.bx_btn_tabs_da{background-position: -254px -100px;}
div.bx_btn_tabs_dd{background-position: -263px -100px;}

.tskbr_common, .iconkit_c, .tb_icon{background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif)!important; margin: 0!important; padding: 0!important; line-height: 1px !important; border: 0 !important; font-size: 1px !important;}
.bx_btn_tabs_folder_c{background-position: -139px -100px; height: 13px; width: 20px;}
.bx_btn_tabs_folder_o{background-position: -159px -100px;  height: 13px; width: 20px;}
.bx_btn_tabs_plus_big{background-position: -190px -100px;  height: 11px; width: 11px;}
.bx_btn_tabs_minus_big{background-position: -179px -100px; height: 11px; width: 11px;}
.bx_btn_tabs_plus_small{background-position: -191px -111px; height: 9px; width: 9px;}
.bx_btn_tabs_minus_small{background-position: -180px -111px; height: 9px; width: 9px;}

.bxedtbuttonset{
	border: #4B4B6F 1px solid;
	background-color: #FFC678;
}

.bxedtbuttonsetover{
	/*border: #4B4B6F 1px solid;*/
	background-color: #FFA658;
}

/*
.bxedtbuttondisabled{
	border: #e4e2dc 1px solid;
	filter: gray() alpha(opacity=30);
	-moz-opacity: 0.30;
	height: 20px;
	width: 20px;
	background-position: 0 0;
}
*/

table.bxedtbuttonex{border-collapse: collapse!important; height: 20px!important; margin: 1px 1px 0 1px !important; border: 1px solid #E4E2DC;}
table.bxedtbuttonex td{white-space: nowrap !important; background-color: transparent !important; background-image: none !important; vertical-align: top!important;}
table.bxedtbuttonex td .bxedtbutton{height: 20px!important; margin: 0!important;}
table.bxedtbuttonex td.tdbutex_txt div{margin: 6px 4px 0 0!important; font-size: 11px !important; line-height: 11px;}
table.bxedtbuttonex-over{border: 1px solid #4B4B6F!important;}
table.bxedtbuttonex-over td{background-color: #FFC678 !important; background-image: none !important;}

.bxedmainframe div.bx-list, .bxedtoolbar div.bx-list{cursor: default!important; border: 1px solid #A5ACB2!important;background-color: #B6B6B2!important; margin: 2px 5px 0 0!important; padding: 0!important; height: 18px;overflow: hidden !important; background-image: url(/bitrix/images/fileman/htmledit2/toolbarbg.gif)!important; position: relative;}
.bx-list-over{position: absolute; top: 0; left: 0; width: 100%; height: 100%;}

.bxedmainframe div.bx-list table, .bxedtoolbar div.bx-list table{border-collapse: collapse !important;  margin: 0!important; padding: 0!important;}
.bxedmainframe div.bx-list table td, .bxedtoolbar div.bx-list table td{padding: 0 !important; background: #FFFFFF !important; vertical-align: top!important;}
.bxedmainframe div.bx-list div.bx-listtitle, .bxedtoolbar div.bx-list div.bx-listtitle{margin: 3px 4px 0 4px !important; background-color: #FFFFFF; font-size: 11px !important; font-family: Tahoma, Courier New !important; overflow: hidden; white-space: nowrap;line-height: 11px;}
.bxedmainframe div.bx-list table td.bx-listbutton, .bxedtoolbar div.bx-list table td.bx-listbutton{height: 18px !important;width: 14px !important;background:  url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif) -63px -59px no-repeat !important; background-color: #E0DEDA !important;font-size: 1pt !important;border-left: 1px solid #A5ACB2 !important;}
.bxedmainframe div.bx-list-over, .bxedtoolbar div.bx-list-over{border: #4B4B6F 1px solid !important;}
.bxedmainframe div.bx-list-over table td.bx-listbutton, .bxedtoolbar div.bx-list-over table td.bx-listbutton{border-left: 1px solid #4B4B6F !important; background-color: #FFC678 !important;}
.bxedmainframe div.bx-list-disabled table td, .bxedtoolbar div.bx-list-disabled table td, div.bx-list-disabled .bx-listtitle{background-color: #F3F3F3 !important; color: #999999 !important;}

.bxproptagspathinl, .bxproptagspath{font-size: 11px; text-decoration: none; font-family: Tahoma, Courier New; background:#F4F4F4 !important; color: #000000; vertical-align: top; padding: 1px;}
.bxproptagspath .bxproptagspathinl td {padding-right: 1px !important; cursor: pointer !important;}
.bxproptagspath .bxproptagspathinl td.bxactive-tag {background-color:#E4E4E4 !important; font-weight: bold !important;}
.bxproptagspath{border-bottom: 1px solid #CCCCCC;}
td.bxproptagspath a {text-decoration:none;}
.bxproptagsprops{font-size: 11px;font-family: Tahoma, Courier New;background-color:#F4F4F4;color: #000000;vertical-align: top;padding-top: 5px;padding-bottom: 5px;padding-right: 5px;padding-left: 5px;}

.bxedtaskbaricontableact {font-weight: 600;font-size: 12px;font-family: Tahoma, Courier New;background-color:#EFEFEF;color: #5C5C5C;padding: 4px;}
table.componentTitle{width: 100% !important; border-bottom: 1px solid #DCDCDC !important; border-top: 1px solid #DCDCDC !important;
margin-top: 1px !important; margin-bottom: 5px !important; background-color: #FFFFFF !important;}
table.componentTitle tr td{	background-color: #FFFFFF !important;}

table.componentTitle tr td.titlecell{padding: 0px 20px 2px 22px !important;font-family: Tahoma, Courier New !important;text-align: left !important; width: 100% !important;}
table.componentTitle tr td.titlecell span.title{display: inline !important;width: 100%;float: none !important;font-size: 11px  !important;font-weight: 600 !important;}
table.componentTitle tr td.titlecell span.description{font-size: 11px;}
table.componentTitle tr td.bxcontentcell {height: 100%; border: 1px solid #DCDCDC !important;}
table.componentTitle td.helpicon{padding: 5px 3px 0px 0px !important; vertical-align: top !important;}
table.componentTitle td.helpicon img{cursor: help !important; margin: 0!important; padding: 0!important;}
div.scrshot{padding: 5px; float: left; width: 200px; height: 160px;}
div.scrshot img{border: 1px solid #DCDCDC !important;}

table.bxpropgroup {border-collapse: collapse; width: 100%;  margin: 0!important; padding: 0!important;}
table.bxpropgroup tr td{padding: 0px; border-bottom: 1px solid #F4F4F4 !important; font-size: 11px!important;}
table.bxpropgroup tr.bxtskbrprp_title_d td{padding: 2px 2px 2px 5px !important;background-color:#E2E1E0 !important;}

td.bx_snip_preview{width: 0%; padding: 3px !important;}
div.bx_snip_code_preview{width: 100%; height: 500px; overflow: auto; padding: 5px; color: #5e5e5e;}
td.bxcontentcell td.bx_snip_valign{vertical-align: top !important;  padding: 3px !important;}
table.bxpropgroup tr.bxtskbrprp_title_a td{text-align: left !important;padding: 2px 2px 2px 5px !important;background-color:#E2E1E0 !important;}
.bxed-add-snip-cont{padding: 6px 0 10px 13px;}
.bxed-add-snip-cont a{margin-left: 2px; line-height: 12px;}

.bxedmainframe .bxtaskbarprops, .c2dialog_propdiv .bxtaskbarprops{font-size: 11px;text-decoration: none;text-align: left !important;font-family: Tahoma, Courier New; border-collapse: collapse !important; width: 100%;}

.bxedmainframe .bxtaskbarprops td, .c2dialog_propdiv .bxtaskbarprops td{padding: 1px 0!important;}
.bxedmainframe .bxtaskbarprops td label, .c2dialog_propdiv .bxtaskbarprops td label {padding: 0 5px!important;}
.bxedmainframe .bxtaskbarprops td label.bxpr-main, .c2dialog_propdiv .bxtaskbarprops td label.bxpr-main{font-weight: bold!important;}

.bxtaskbarprops input {font-size: 11px !important;text-decoration: none !important;font-family: Tahoma, Courier New !important;}
.bxtaskbarprops input.fl{float: left;}

.bxtaskbarprops select, .propselect {
	background-color:#FFFFFF !important;
	font-size: 11px !important;
	text-decoration: none !important;
	font-family: Tahoma, Courier New !important;
}

table.bxtaskbarcomp{
	font-family:Tahoma,Arial,Helvetica !important;
	font-size:11px !important;
}

table.edit-table table.bxtaskbarcomp, table.bxtaskbarcomp {
	width: 100% !important;
}

table.bxtaskbarcomp table td {padding:0px;}

.bxtaskbarpropscomp td {width: 50%; background-image: url(/bitrix/images/fileman/htmledit2/filter_dot.gif) !important; background-repeat:repeat-x !important; background-position:bottom !important;}
.bxtaskbarpropscomp td label{margin-top: 3px !important; display: block!important;}
.bxtaskbarpropscomp td.bxtaskbarprop-label{text-align: right !important; vertical-align: top;}
.bxtaskbarpropscomp td.bxtaskbarprop-label span{margin: 2px 4px 0 0 !important; display: inline-block;}

.bxpropertysell td{
	background-image: url(/bitrix/images/fileman/htmledit2/filter_dot.gif) !important;
	background-repeat:repeat-x !important;
	background-position:bottom !important;
}

table.bxedcompblock, table.edit-table td.bxedtaskbarinner table.bxedcompblock td{
	background-color: #FFFFFF !important;
	font-family:Verdana, Tahoma, Arial,Helvetica !important;
	font-size:10px !important;
}

table.bxgroupblock0, table.edit-table td.bxedtaskbarinner table.bxgroupblock0 td{
	background-color: #FFFFFF !important;
	font-family:Verdana, Tahoma, Arial,Helvetica !important;
	font-size:10px !important;
}

table.bxgroupblock0 #title, table.bxgroupblock0 td #title {font-family: Tahoma,Arial,Helvetica !important;
font-size: 11px !important;font-weight: 500 !important;white-space: nowrap !important;cursor: default !important;}
.bxedmainframe table.bxgroupblock0  td.datacell0{padding: 10px !important;}
.bxedmainframe table.bxgroupblock0  td.titlecell0{text-align: left; padding: 0!important; font-size: 11px !important; height: 21px; width: 500px;line-height: 15px;}
.bxedmainframe table.bxgroupblock0 td.pluscell0{padding: 0 9px 0 9px !important;}
.bxedmainframe table.bxgroupblock0 td.datacell0 table.bxgroupblock1{border-collapse: collapse;width: 100%;  margin: 0!important; padding: 0!important;}
.bxedmainframe table.bxgroupblock0 img, table.bxgroupblock1 img{margin: 0!important; padding: 0!important;}
.bxedmainframe table.bxgroupblock0 td.datacell0 table.bxgroupblock1 td.datacell1{padding: 2px 2px 2px 20px !important;}
.bxedmainframe table.bxgroupblock0 td.datacell0 table.bxgroupblock1 td.pluscell1{vertical-align: top !important; padding: 3px 2px 0px 2px !important;}
.bxedmainframe table.bxgroupblock0  td.datacell0 table.bxgroupblock1 td.iconcell1{vertical-align: top !important; padding: 2px 1px 2px 1px !important; width: 0%;}
.bxedmainframe table.bxgroupblock0  td.datacell0 table.bxgroupblock1 td.iconcell0{vertical-align: top !important; padding: 2px 1px 2px 20px !important;}

.bxedmainframe table.bxgroupblock0 td.datacell0 table.bxgroupblock1 td.iconfoldercell1 {vertical-align: top !important;padding: 2px 1px 2px 1px !important;}

table.bxgroupblock0  td.datacell0 table.bxgroupblock1 td.titlecell1{padding: 1px 2px 1px 4px !important;font-size: 11px !important;line-height: 12px!important;width: 500px!important;vertical-align:top!important;}

table.bxedcompblock #title, table.bxedcompblock td #title {
	font-family: Tahoma,Arial,Helvetica !important;
	font-size: 11px !important;
	font-weight: 500 !important;
	white-space: nowrap !important;
	cursor: default !important;
}

.bxtaskbarcomp td table.bxcomplist td {
	padding:4px !important;
}

.bxedlistitem, table.bxedlistitem td{
	background-color: #FFFFFF;
	font-family:Tahoma,Arial,Helvetica !important;
	font-size:11px !important;
}

.bxsourceeditor{
	margin: 0px 0px 0px 2px;
	border: 1px solid #B6B6B2;
	background-color: #FFFFFF;
	font-family: Courier New;
	font-size: 10pt;
}

.bxcontextmenuitemover
{
	border: #4B4B6F 1px solid;
	background-color: #BFC6B8;
}

.bxcontextmenuitem
{
	border: #FFFFFF 1px solid;
	background-color: #FFFFFF;
}

.bxcontextmenuitemseparator
{
	padding: 0px !important;
}

.bxcontextmenuitemseparator TD
{
	height: 1px !important;
	border-top:1px solid #B6B6B2 !important;
}

table.bxcontextmenu td .bxcontextmenuitemseparator
{
	padding: 0px 0px 0px 0px !important;
}

table.bxcontextmenu
{
	border: 1px solid #B6B6B2 !important;
	background-color: #FFFFFF !important;
	font-size: 11px !important;
	font-family: Tahoma, Arial, Verdana, Sans-Serif !important;
	width: 100px !important;
	cursor: default !important;
}

table.bxcontextmenu td
{
	padding: 3px 3px 3px 3px !important;
}

table.bxcontextmenu .bxcontextmenuitem td#left
{
	padding: 1px 1px 1px 1px !important;
	border: 1px solid #ffffff !important;
	background-color: #ffeecc !important;
}

table.bxcontextmenu .bxcontextmenuitemover td#left
{
	border: 1px solid #4b4b6f !important;
	padding: 1px 1px 1px 1px !important;
	background-color: #cfd6c8 !important;
}

div.bxcontextmenu
{
	background-color: #ffffff;
}

 .bxspecialcharnormal
{
	width: 17px;
	height: 17px;
	border: 1px solid #ffffff;
	background-color: #FFFFFF;
	font-size: 12px;
	font-family: Tahoma, Arial, Verdana, Sans-Serif;
	vertical-align: middle;
	text-align: center;
}

div.buttonCont input
{
	font-family: Tahoma, Arial, Verdana, Sans-Serif;
	text-align: center;
}

.bxed-dialog table.add_snippet{width: 100% !important; padding: 10px !important; border-collapse: collapse; }
.bxed-dialog table.add_snippet td{padding: 3px 0 3px 10px !important;}
.bxed-dialog table.add_snippet input,table.add_snippet textarea{width: 350px; font-size: 12px!important;}

.transp_tog_h, .transp_tog_v{
	position: absolute!important;
	z-index: 2000!important;
	background-repeat: repeat!important;
	padding: 0 !important;
	margin:  0 !important;
}

.transp_tog_h
{
	background-image: url(/bitrix/images/fileman/htmledit2/transptogh.gif);

}

.transp_tog_v
{
	background-image: url(/bitrix/images/fileman/htmledit2/transptogv.gif);
}

.popupmenu{border:1px solid #B6B6B6; padding:0px !important; background-color:#FCFCFC; background-image:url(/bitrix/themes/.default/images/menu_gutter.gif); background-repeat:repeat-y;}
.popupmenu table.popupitem{width: 150px; margin:1px !important; cursor:default;}
.popupmenu table.popupitemover {border:1px solid #AEB6C2 !important; margin:0px !important; background-color:#CEDAEE !important;}
.popupmenu td.popup_open_cell table.popupitem{border:1px solid #AEB6C2 !important; margin:0px !important; background-color:#CEDAEE !important;}
.popupmenu td.popup_open_cell .popupmenu table.popupitem{border: 0px !important; width: 100%; margin:1px !important; cursor:default; background-color: transparent !important;}
.popupmenu td.popup_open_cell .popupmenu table.popupitemover{border:1px solid #AEB6C2 !important; margin:0px !important; background-color:#CEDAEE !important;}
.popupitemdisabled{filter: gray() alpha(opacity=30); -moz-opacity: 0.30;}

.popupmenu table.popupitem td.gutter {width: 20px; height: 20px;}
.popupmenu table.popupitem td.arrow, .popupmenu table.popupitem td.arrow_ie {width:10px; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif);background-position: -277px -101px; background-repeat: no-repeat;padding-right:3px}
.popupmenu table.popupitemover td.arrow_ie, .popupmenu td.popup_open_cell .popupmenu table.popupitemover{background-position: -275px -101px; }

.popupmenu table.popupitem td.gutter div{width:20px; height:18px; background-position:0 0;}
.popupmenu table.popupitem td.item {padding:0px 5px 0px 9px !important; font-size:11px; white-space: nowrap; text-align:left !important;}
.popupmenu table.popupitem td.default {font-weight:bold;}
.popupmenu table.popupitem td.disabled {color:#939393;}
.popupmenu div.popupseparator {margin:1px 0px 1px 30px; background-color:#B6B6B6; height:1px; overflow:hidden;}

.bxedmainframe tr#bx-css-tt td.tasktabcell{height: 26px !important; background: url(/bitrix/images/fileman/htmledit2/toolbarsetbg.gif) repeat transparent !important; border-top: 1px solid #808080; padding: 0!important;}
.bxedmainframe tr#bx-css-tt td.tasktabcell table{border-collapse: collapse;  margin: 0!important; padding: 0!important;}
.bxedmainframe tr#bx-css-tt td.tasktabcell table td {padding:0; background-color: transparent !important;}
.bxedmainframe tr#bx-css-tt td.tasktabcell table.tasktab{margin-left: 2px !important; cursor: pointer !important; -moz-user-select:none; border-collapse: collapse; padding: 0!important;}
.bxedmainframe tr#bx-css-tt td.tasktabcell table.tasktab td{font-size: 11px !important; padding: 0;}

.bxed-tasktab-cnt {/*margin: 2px 0px 2px 0px;*/}
.bxed-tasktab-cnt .bxed-tasktab {display: inline-block; height: 22px !important; margin: 2px 0 0 3px; cursor: pointer;}

.bxed-tasktab .tasktab-left, .bxed-tasktab .tasktab-right{display: inline-block; width: 4px !important; height: 22px !important; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif)!important;}
.bxed-tasktab .tasktab-center {display: inline-block; height: 22px !important; background-repeat: repeat-x; white-space: nowrap; color:#5C5C5C !important; font-family:Tahoma,Courier New !important; padding: 0px 3px 0px 3px !important; text-align: left !important; vertical-align: top;}

.bxed-tasktab .tasktab-icon {display: inline-block; width: 19px; height: 19px; vertical-align: top; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif); margin: 1px 5px 0 -2px;}
.bxed-taskbar-icon-components {background-position: -280px -40px;}
.bxed-taskbar-icon-snippets {background-position: -260px -39px;}
.bxed-taskbar-icon-properties {background-position: -320px -40px;}
.bxed-tasktab .tasktab-text {display: inline-block !important;margin: 3px 0 0 !important;vertical-align: top !important;line-height: 12px !important; font-size: 12px !important; font-family: Tahoma,Courier New !important;}

/*
td.act div.tb_icon{border: 1px solid #c0c0c0 !important;}
td.def div.tb_icon{margin: 1px !important;}
*/

.bxed-tasktab .tasktab-left {background-position: -348px -99px;}
.bxed-tasktab .tasktab-center {background-image: url(/bitrix/images/fileman/htmledit2/tab_def.gif);}
.bxed-tasktab .tasktab-right {background-position: -353px -99px;}

.bxed-tasktab-pushed .tasktab-left {background-position: -368px -99px;}
.bxed-tasktab-pushed .tasktab-center {background-image: url(/bitrix/images/fileman/htmledit2/tab_pushed.gif);}
.bxed-tasktab-pushed .tasktab-right {background-position: -373px -99px;}

.bxed-tasktab-over .tasktab-left {background-position: -358px -99px !important;}
.bxed-tasktab-over .tasktab-center {background-image: url(/bitrix/images/fileman/htmledit2/tab_over.gif)!important;}
.bxed-tasktab-over .tasktab-right {background-position: -363px -99px!important;}


/*
tr#bx-css-tt table.tasktab tr.tasktab-over td.tasktab_left {background-position: -358px -99px !important;}
tr#bx-css-tt table.tasktab tr.tasktab-over td.tasktab_center {background-image: url(/bitrix/images/fileman/htmledit2/tab_over.gif)!important; color:#5C69B5 !important;}
tr#bx-css-tt table.tasktab tr.tasktab-over td.tasktab_right{background-position: -363px -99px!important;}

tr#bx-css-tt table.tasktab-pushed tr.tasktab-over td.tasktab_center{color:#5C69B5 !important; background-image: url(/bitrix/images/fileman/htmledit2/tab_pushed.gif)!important;}
tr#bx-css-tt table.tasktab-pushed td.tasktab_left, tr#bx-css-tt table.tasktab-pushed tr.tasktab-over td.tasktab_left{background-position: -368px -99px!important;}
tr#bx-css-tt table.tasktab-pushed td.tasktab_center {background-image: url(/bitrix/images/fileman/htmledit2/tab_pushed.gif)!important;}
tr#bx-css-tt table.tasktab-pushed td.tasktab_right,tr#bx-css-tt  table.tasktab-pushed tr.tasktab-over td.tasktab_right{background-position: -373px -99px!important;}

tr#bx-css-tt table.tasktab td.tasktab_left, tr#bx-css-tt  table.tasktab td.tasktab_right{width: 4px !important; height: 22px !important; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif)!important;}
tr#bx-css-tt  table.tasktab td.tasktab_center{height: 22px !important; background-repeat: repeat-x; white-space: nowrap; color:#5C5C5C !important; font-family:Tahoma,Courier New !important; padding: 0px 3px 0px 3px !important; width: 120px; text-align: left !important;}
*/

td.act div.tb_icon{border: 1px solid #c0c0c0; background-color: #c0c0c0; opacity: 0.3; filter: gray() alpha(opacity=30);}
td.act div.tb_icon{border: 1px solid #c0c0c0 !important;}
td.def div.tb_icon{margin: 3px 0 0 !important;}
.tb_icon{width: 19px; height: 19px;}

/*
.tb_icon_snippets {background-position: -260px -39px;}
.tb_icon_components2 {background-position: -280px -40px;}
.tb_icon_properties {background-position: -320px -40px;}
*/


div.visual_minimize{position: absolute; background-color: #c0c0c0; z-index: 4000; opacity: 0.3; filter: gray() alpha(opacity=30); }

div.bx-g-tlbr-but{height: 25px;background-image: url(/bitrix/images/fileman/htmledit2/toolbarbg.gif);padding: 0 !important; float: left;}

div.bx-g-tlbr-but .bxedtbuttonex, div.bx-g-tlbr-but .bxedtbutton, div.bx-g-tlbr-but .bxlist {margin: 1px 1px 0 0!important;}
div.bx-g-tlbr-line-end{height: 25px;width: 5px;background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif);background-position: -334px -96px;float: left;}
div.bx-g-tlbr-line-begin{height: 25px; width: 3px; background-image: url(/bitrix/images/fileman/htmledit2/_global_iconkit.gif); background-position: -330px -96px; float: left; clear:left;}
.bx-g-tlbr-line-ie{height: 0px!important; width: 99%!important; clear:left!important; margin: 0!important; padding: 0!important; background: red!important;}

.bxedmainframe table.bxtaskbarprops td.bxed-flash-prop{vertical-align: top !important; width: 300px;}

img.bx_flash{border: 1px solid #808080 !important; background: url(/bitrix/images/fileman/htmledit2/flash.gif) no-repeat center center #000000 !important;}

.bxedmainframe table.edit-tabs td.tab-selected , .bxedmainframe table.edit-tabs td.tab{vertical-align: middle !important;}

div.c2dialog_cnt{overflow: auto!important; overflow-x: hidden!important; overflow-y: auto!important;}
div.c2dialog_cnt table td{background-image: none!important;}
div.c2dialog_cnt table.componentTitle{border-top-width: 0px !important; margin-top: 0px !important;}
td.c2dialog_cnt table tr.bxtaskbarpropscomp td span {font-size: 11px; margin-right: 3px;}

.editor_dialog{left: -1000px; top: -1000px; position: absolute;}

div.editor_dialog table.edit-tabs td.tab, div.editor_dialog table.edit-tabs td.tab-selected, div.editor_dialog table.edit-tabs td.tab-hover{font-size: 11px !important;padding:4px 0 0 5px !important;}
div.editor_dialog div.edit-form{margin: 0px;}

/* link dialog*/
div.bxed-dialog table.bx-link-dialog-tbl{width: 496px; border-collapse: collapse; margin: 0!important; padding: 0!important;}
div.bxed-dialog table.bx-link-dialog-tbl td{padding: 4px 0!important; background-image: none !important;}
div.bxed-dialog table.bx-link-dialog-tbl tr.bx-link-sep td{height: 5px; padding: 0px !important;}

div.bxed-dialog table.bx-link-dialog-tbl tr.bx-link-type td{height: 30px; border-bottom: 0px solid #ADADAD; background-color: #EEEEEE;}
div.bxed-dialog table.bx-link-dialog-tbl td.bx-par-title{text-align: right; padding: 4px 5px 4px 0!important; width: 40%;}
div.bxed-dialog table.bx-link-dialog-tbl td.bx-par-val{text-align: left; width: 60%;}
div.bxed-dialog table.bx-link-dialog-tbl tr.bx-header td{background-color: #EEEEEE; height: 22px;}
div.bxed-dialog table.bx-link-dialog-tbl tr.bx-header td a.bx-adv-link{text-decoration: none !important; display: block; margin-left: 10px; float: left;}
div.bxed-dialog table.bx-link-dialog-tbl tr.bx-header td a.bx-adv-link span{color:#000000; font-size:90%; display: inline;}
.bx-link-simple table.bx-link-dialog-tbl tr.bx-adv{display: none;}
.bx-link-simple a.bx-adv-link span{display: none!important;}

table.bx--t1 tr.bx-link-t1{display: none;}
table.bx--t2 tr.bx-link-t2{display: none;}
table.bx--t3 tr.bx-link-t3{display: none;}
table.bx--t4 tr.bx-link-t4{display: none;}

 table.bx-only-t3 tr.bx-hide-in-t3{display: none}
 table.bx-only-t4 tr.bx-hide-in-t4{display: none}

/*editor dialog new! new!*/
div.bxed-dialog{overflow: hidden!important; overflow-x: hidden!important; overflow-y: hidden!important;}
div.bxed-dialog input, div.bxed-dialog select {font-size: 13px !important;}
div.bxed-dialog table.edit-form *{font-size: 11px;}

div.bxed-dialog table.edit-tab-title, div.bxed-dialog table.edit-table{display: none;}
div.bxed-dialog div.edit-tab-inner{padding-top: 5px !important;}
div.bxed-dialog div.edit-tab-inner tr.heading_dialog td{height: 22px !important; font-weight: bold!important; color: #819EB3!important; background: transparent!important; font-size: 110%!important;}
div.bxed-dialog table.edit-tab div.edit-tab-inner table td, div.bxed-dialog table td{background-image: none !important;}

div.edit-tab-inner td.bx-par-title{text-align: right; padding-right: 5px; width: 30%;}
div.edit-tab-inner td.bx-par-val{text-align: left; width: 70%;}

/* image dialog */
div.bxed-dialog table.bx-image-dialog-tbl{width: 490px; border-collapse: collapse; margin: 0!important; padding: 0!important;}
div.bxed-dialog table.bx-image-dialog-tbl td.bx-par-title{text-align: right; padding: 0 5px 0 0 !important; width: 40%;}
div.bxed-dialog table.bx-image-dialog-tbl td.bx-par-val{text-align: left; width: 60%; padding-right: 0!important;}
div.bxed-dialog table.bx-image-dialog-tbl div.bx-preview{height:164px; width:270px; overflow: hidden; border: 1px #999999 solid; overflow-y: scroll; overflow-x: auto; color: #999999; background-color: #FFFFFF; padding: 3px!important; margin-top: 2px!important;}

div.bxed-dialog table.bx-img-side{border-collapse: collapse; margin: 0 0 0 5px !important; padding: 0!important;}
div.bxed-dialog table.bx-img-side td{padding: 2px 0 0 0!important;}

div.bxed-dialog table.bx-par-tbl td.bx-par-title{text-align: right; padding: 0 5px 0 0!important; width: 40%;}
div.bxed-dialog table.bx-par-tbl td.bx-par-val{text-align: left; width: 60%;}

table.bx-dialog-table, table.bx-dialog-pasteword{width: 100%; border-collapse: collapse;  margin: 0!important; padding: 0!important;}
div.bxed-dialog-props{overflow: auto!important; padding: 0px!important;}
div.bxed-dialog-props table.bx-par-tbl{width:100%; border-collapse: collapse;  margin: 0!important; padding: 0!important;}
div.bxed-dialog-props td.bx-par-title{text-align: right; padding-right: 5px!important; width: 40%;}
div.bxed-dialog-props td.bx-par-val{text-align: left; width: 60%;}

div.bx-d-char-cont{width: 455px; float: left;}
div.bxed-dialog div.bx-d-char-cont table td{width: 17px; height: 17px; font-size: 11px; text-align: center; vertical-align: middle; border: 1px solid #ffffff; background-color: #FFFFFF; cursor: pointer !important; padding: 0!important;}
div.bxed-dialog div.bx-d-char-cont table td.bx-over{border-color:  #EDEFF6 #4B4B6F #4B4B6F #EDEFF6; border-width: 1px; border-style: solid; background-color: #FFC678; padding: 0!important;}
div.bx-d-prev-char{background-color: #FFFFFF; width: 120px; height: 120px; font-size: 80px; text-align: center; vertical-align: middle; float: left;}
div.bx-d-ent-name{font-size: 16px; text-align: center; background-color: #D5DAE9; width: 120px; padding: 6px 0; float: left;}

.bx-ed-colorpicker{margin: 0!important; padding: 0!important; vertical-align: bottom; background: #F4F4F4!important;}
.bx-ed-colorpicker input{display: inline-block;}

div.bx-colpick-cont{position: absolute; border: 1px solid #808080; background-color: #E4E2DC; display: none; width: 338px;
top: -1000px; left: -1000px; }
table.bx-colpic-tbl{border-collapse: separate !important; margin: 0!important; padding: 0!important;}
table.bx-colpic-tbl{ background-color: #E4E2DC;}
table.bx-colpic-tbl td.bx-col-cell{width: 16px!important; height: 16px!important; border: 1px solid #808080; font-size: 5px !important;}
table.bx-colpic-tbl td.bx-col-cell-over{border: 1px solid #FFC678 !important;}
table.bx-colpic-tbl td.bx-col-cell img{width: 15px!important; height: 15px!important;}
td.bx-color-inp-cell{height: 25px;}
span.bx-colpic-def-but{background-color: #E4E2DC;border: 1px solid #808080;display: block;margin: 1px;font-size: 12px !important; padding: 3px; text-align: center !important; vertical-align: middle !important; cursor: pointer;}
span.bx-colpic-def-but-over{background-color: #FFC678; border: 1px solid #4B4B6F;}
div.bxed-trans-overlay{height:100%; width:100%; left: 0; top: 0; position: absolute; -moz-user-select: none !important; display: none; background-color:#FFFFFF; filter: gray() alpha(opacity=01); -moz-opacity: 0.01; opacity: 0.01;}

.bxedmainframe table .bx-move-col-v{cursor: w-resize; background: url(/bitrix/images/fileman/htmledit2/slider_bg_v.png) transparent repeat !important; width: 6px;}
.bxedmainframe table .bx-move-col-h{cursor: n-resize; background: url(/bitrix/images/fileman/htmledit2/slider_bg_h.png) transparent repeat !important; height: 6px; width: 100%; line-height: 1px !important;}
.bxedmainframe table .bx-move-col-v img{width: 6px!important; height: 1px!important; margin: 0!important; padding: 0!important;}
.bxedmainframe table .bx-move-col-h img{width: 1px!important; height: 6px!important; margin: 0!important; padding: 0!important;}

.bxedmainframe table td.bx-taskbar-tabs{height: 26px !important; background-color: #FFFFFF !important;}

table.bx-taskbar-tabs{ margin: 0 0 5px 0!important; padding: 0!important; border-collapse: collapse;}
table.bx-taskbar-tabs td{padding: 0px;}
table.bxedmainframe .bx-comp2-hint, .c2dialog_cnt .bx-comp2-hint{
margin: 2px 0 0 5px!important; padding: 0!important;

background: url(/bitrix/themes/.default/public/popup/hint.gif) no-repeat!important;
width: 12px!important; height: 12px!important;
}

/*hide unused in dialogs sections from admin tabcontrol*/
.bxed-dialog .adm-detail-title, .bxed-dialog .adm-detail-content-item-block, .bxed-dialog .adm-detail-content-btns-wrap{display: none!important;}
.bxed-dialog .adm-detail-content{padding: 0!important;}

.bxed-dialog input[type="text"], .c2dialog_cnt input[type="text"], .bxedmainframe input[type="text"]{height: 20px!important;}

.bxed-dialog select[multiple], .bxed-dialog select,
.c2dialog_cnt select[multiple], .c2dialog_cnt select,
.bxedmainframe select[multiple], .bxedmainframe select[size]
{height: auto !important;min-height: 20px !important;}

.bxed-dialog select, .bxed-dialog select[size="1"],
.c2dialog_cnt select, .c2dialog_cnt select[size="1"],
.bxedmainframe select, .bxedmainframe select[size="1"]
{height: 20px!important;padding: 0 !important;}

.bxed-dialog input[type="submit"], .bxed-dialog input[type="button"],
.c2dialog_cnt input[type="submit"], .c2dialog_cnt input[type="button"],
.bxedmainframe input[type="submit"], .bxedmainframe input[type="button"]
{padding: 0 13px 7px;height: 20px !important;}



.bx-but-group {position: absolute; top: 0; left: 0; border: 1px solid red; width: 20px!important; display: none;}

table.bx-toolbar-tbl{border-collapse: collapse; margin: 0!important; padding: 0!important;}
table.bx-toolbar-tbl td{padding: 0;}
table.bxedtoolbartitletext {border-collapse: collapse; font-family: Verdana,Tahoma,Courier New;width: 100%;color: #FFFFFF; width: 100%; margin: 0!important; padding: 0!important;}
table.bxedtoolbartitletext  tr td{font-size: 9px !important;background-image: url(/bitrix/images/fileman/htmledit2/toolbartitle_bg.gif) !important;background-repeat:repeat-x !important;padding: 0;}
table.bxedtoolbartitletext  tr td .bx-toolbar-x{width: 6px!important; height: 6px!important; background-position: -340px -100px!important; margin: 1px 0 0 0 !important;}
htmleditor2/toolbarbuttons.js000064400000226432150240170740012431 0ustar00var arButtons = [];
arButtons['separator'] = 'separator';
arButtons['Fullscreen']	= ['BXButton',
	{
		id : 'Fullscreen',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.Fullscreen,
		title : BX_MESS.Fullscreen,
		codeEditorMode : true,
		handler : function()
		{
			this.pMainObj.SetFullscreen(!this.pMainObj.bFullscreen);
			this.Check(this.pMainObj.bFullscreen);
		}
	}
];

arButtons['Settings'] = ['BXButton',
	{
		id : 'Settings',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.TBSettings,
		title: BX_MESS.TBSettings,
		codeEditorMode: true,
		handler: function()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("settings", false, 500, {bUseTabControl: true, lightMode: lightMode, PHPGetParams: '&light_mode=' + (lightMode ? 'Y' : 'N')});
		}
	}
];

arButtons['Cut'] = ['BXButton',
	{
		id : 'Cut',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.Cut,
		cmd: 'Cut',
		hideCondition: function() {return !BX.browser.IsIE();}
	}
];

arButtons['Copy'] = ['BXButton',
	{
		id : 'Copy',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.Copy,
		cmd: 'Copy',
		hideCondition: function() {return !BX.browser.IsIE();}
	}
];

arButtons['Paste'] =['BXButton',
	{
		id : 'Paste',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.Paste,
		cmd: 'Paste',
		hideCondition: function() {return !BX.browser.IsIE();}
	}
];

arButtons['pasteword'] = ['BXButton',
	{
		id : 'pasteword',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.PasteAsWord,
		handler : function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("pasteword");
		}
	}
];

arButtons['pastetext'] = ['BXButton',
	{
		id : 'pastetext',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.PasteAsText,
		handler : function ()
			{
				if(BX.browser.IsIE())
				{
					if (clipboardData.getData("Text"))
						this.pMainObj.PasteAsText(clipboardData.getData("Text"));
				}
				else
				{
					this.bNotFocus = true;
					this.pMainObj.OpenEditorDialog("pasteastext", false, 450);
				}
			}
	}
];

arButtons['SelectAll'] = ['BXButton',
	{
		id : 'SelectAll',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.SelectAllTitle,
		cmd: 'SelectAll'
	}
];

if(BX.browser.IsIE())
{
	arButtons['Undo'] = ['BXButton',
	{
		id : 'Undo',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.Undo,
		OnChangeContent : function(){this.Disable(!this.pMainObj.UndoStatus());},
		OnCreate : function(){this.pMainObj.AddEventHandler("OnChange", this.OnChangeContent, this);},
		handler : function(){this.pMainObj.Undo(1);}
	}
	];

	arButtons['Redo'] = ['BXButton',
	{
		id : 'Redo',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.Redo,
		OnChangeContent: function(){this.Disable(!this.pMainObj.RedoStatus());},
		OnCreate: function(){this.pMainObj.AddEventHandler("OnChange", this.OnChangeContent, this);},
		handler: function(){this.pMainObj.Redo(1);}
	}
	];
}
else
{
	arButtons['Undo'] = ['BXButton',
	{
		id : 'Undo',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.Undo,
		cmd : 'Undo'
	}
	];

	arButtons['Redo'] = ['BXButton',
	{
		id : 'Redo',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.Redo,
		cmd : 'Redo'
	}
	];
}

arButtons['borders'] = ['BXButton',
	{
		name : BX_MESS.BordersTitle,
		id : 'borders',
		iconkit : '_global_iconkit.gif',
		handler : function ()
			{
				this.pMainObj.ShowTableBorder(!this.pMainObj.bTableBorder);
				this.Check(this.pMainObj.bTableBorder);
			},
		OnCreate : function ()
			{
				var _this = this;
				setTimeout(function(){_this.Check(_this.pMainObj.bTableBorder);}, 10);
				return true;
			}
	}
];

arButtons['table'] = ['BXButton',
	{
		id : 'table',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBInsTable,
		title : BX_MESS.TBInsTable,
		handler : function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("table", false, 500);
		}
	}
];

arButtons['anchor'] = ['BXButton',
	{
		id : 'anchor',
		iconkit : '_global_iconkit.gif',
		name: 'Anchor',
		title: BX_MESS.TBAnchor,
		handler: function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("anchor", null, 400);
		}
	}
];

arButtons['CreateLink'] = ['BXButton',
	{
		id : 'CreateLink',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBLink,
		title : BX_MESS.TBLink,
		handler : function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("editlink", null, 520);
		}
	}
];

arButtons['deletelink'] = ['BXButton',
	{
		id : 'deletelink',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBDelLink,
		cmd : 'Unlink',
		handler : function()
		{
			var pElement = BXFindParentByTagName(this.pMainObj.GetSelectionObject(), 'A');
			if(pElement)
			{
				this.pMainObj.SelectElement(pElement);
				this.pMainObj.executeCommand('Unlink');
			}
		}
	}
];

arButtons['image'] = ['BXButton',
	{
		id : 'image',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBImg,
		handler : function ()
		{
			this.bNotFocus = true;
			var p = this.pMainObj.GetSelectionObject();
			if (!p || p.tagName != 'IMG')
				p = false;
			this.pMainObj.OpenEditorDialog("image", p, 500);
		}
	}
];

arButtons['SpecialChar'] = ['BXButton',
	{
		id : 'SpecialChar',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.SpecialCharTitle,
		handler : function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("specialchar", false, 610, {pMainObj:this.pMainObj});
		}
	}
];

arButtons['Bold'] = ['BXButton',
	{
		id : 'Bold',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBBold,
		title : BX_MESS.TBBold + " (Ctrl + B)",
		cmd : 'Bold'
	}
];

arButtons['Italic']	= ['BXButton',
	{
		id : 'Italic',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBItalic,
		title : BX_MESS.TBItalic + " (Ctrl + I)",
		cmd : 'Italic'
	}
];

arButtons['Underline'] = ['BXButton',
	{
		id : 'Underline',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBUnderline,
		title : BX_MESS.TBUnderline + " (Ctrl + U)",
		cmd : 'Underline'
	}
];

arButtons['Strike'] = ['BXButton',
	{
		id : 'Strike',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBStrike,
		handler : function ()
		{
			var
				pElement = this.pMainObj.GetSelectedNode(true),
				bFind = false, st;

			while(!bFind)
			{
				if (!pElement)
					break;

				if (pElement.nodeType == 1 && (pElement.style.textDecoration == "line-through" ||  pElement.nodeName.toLowerCase() == 'strike'))
					bFind = true;
				else
					pElement = pElement.parentNode;
			}

			if (bFind)
			{
				pElement.style.textDecoration = "";
				this.pMainObj.RidOfNode(pElement, pElement.nodeName.toLowerCase() == 'strike');
				this.Check(false);
			}
			else
			{
				this.pMainObj.WrapSelectionWith("span", {style: {textDecoration : "line-through"}});
				this.pMainObj.OnEvent("OnSelectionChange");
			}
		},
		OnSelectionChange: function ()
		{
			var
				pElement = this.pMainObj.GetSelectedNode(true),
				bFind = false, st;

			while(!bFind)
			{
				if (!pElement)
					break;

				if (pElement.nodeType == 1 && (BX.style(pElement, 'text-decoration', null) == "line-through" || pElement.nodeName.toLowerCase() == 'strike'))
				{
					bFind = true;
					break;
				}
				else
					pElement = pElement.parentNode;
			}

			this.Check(bFind);
		}
	}
];

arButtons['RemoveFormat'] = ['BXButton',
	{
		id : 'RemoveFormat',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.RemoveFormat,
		cmd : 'RemoveFormat'
	}
];

arButtons['Optimize'] = ['BXButton',
		{
			id : 'Optimize',
			iconkit : '_global_iconkit.gif',
			name : BX_MESS.Optimize,
			handler : function ()
			{
				var pMainObj = this.pMainObj;
				pMainObj.CollapseSelection();
				pMainObj.insertHTML('<a href="#" id="' + pMainObj.SetBxTag(false, {tag: "cursor"}) + '">|</a>');
				pMainObj.OnEvent('ClearResourcesBeforeChangeView');
				pMainObj.SaveContent();

				var content = pMainObj.GetContent();
				content = pMainObj.OptimizeHTML(content); // optimize
				content = pMainObj.pParser.SystemParse(content); // Parse
				pMainObj.pEditorDocument.body.innerHTML = content;

				setTimeout(function()
				{
					try{
						var pCursor = pMainObj.pEditorDocument.getElementById(pMainObj.lastCursorId);
						if (pCursor && pCursor.parentNode)
						{
							pMainObj.SelectElement(pCursor);
							pCursor.parentNode.removeChild(pCursor);
							pMainObj.SetFocus();
							pMainObj.insertHTML('');
						}
					}catch(e){}
				}, 100);
			}
		}
	];

// CELL
arButtons['insertcell_before'] = ['BXButton', {
	id : 'insertcell_before',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsCellBefore,
	handler: function () {this.pMainObj.TableOperation('cell', 'insert_before', arguments[0]);}
}];
arButtons['insertcell_after'] = ['BXButton', {
	id : 'insertcell_after',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsCellAfter,
	handler: function () {this.pMainObj.TableOperation('cell', 'insert_after', arguments[0]);}
}];
arButtons['deletecell'] = ['BXButton', {
	id : 'deletecell',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBDellCell,
	handler: function () {this.pMainObj.TableOperation('cell', 'delete', arguments[0]);}
}];
arButtons['mergecells'] = ['BXButton', {
	id : 'mergecells',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBMergeCell,
	handler: function () {this.pMainObj.TableOperation('cell', 'merge', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length < 2)
			return true;
		return false;
	}
}];
arButtons['merge_right'] = ['BXButton', {
	id : 'merge_right',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBMergeRight,
	handler: function () {this.pMainObj.TableOperation('cell', 'mergeright', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length != 1 || !arCells[0].parentNode.cells[arCells[0].cellIndex + 1])
			return true;
		return false;
	}
}];
arButtons['merge_bottom'] = ['BXButton', {
	id : 'merge_bottom',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBMergeBottom,
	handler: function () {this.pMainObj.TableOperation('cell', 'mergebottom', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length != 1)
			return true;

		var oTR = arCells[0].parentNode;
		if (!oTR.parentNode.rows[oTR.rowIndex + 1])
			return true;
		return false;
	}
}];
arButtons['split_hor'] = ['BXButton', {
	id : 'split_hor',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBSplitCellHor,
	handler: function () {this.pMainObj.TableOperation('cell', 'splithorizontally', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length != 1)
			return true;
		return false;
	}
}];
arButtons['split_ver'] = ['BXButton', {
	id : 'split_ver',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBSplitCellVer,
	handler: function () {this.pMainObj.TableOperation('cell', 'splitvertically', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length != 1)
			return true;
		return false;
	}
}];
// ROW
arButtons['insertrow_before'] = ['BXButton', {
	id : 'insertrow_before',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsRowUpper,
	handler: function () {this.pMainObj.TableOperation('row', 'insertbefore', arguments[0]);}
}];
arButtons['insertrow_after'] = ['BXButton', {
	id : 'insertrow_after',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsRowLower,
	handler: function () {this.pMainObj.TableOperation('row', 'insertafter', arguments[0]);}
}];
arButtons['mergeallcellsinrow'] = ['BXButton', {
	id : 'mergeallcellsinrow',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBMergeRowCells,
	handler: function () {this.pMainObj.TableOperation('row', 'mergecells', arguments[0]);}
}];
arButtons['deleterow'] = ['BXButton', {
	id : 'deleterow',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBDelRow,
	handler: function () {
		this.pMainObj.TableOperation('row', 'delete', arguments[0]);}
}];
// COLUMN
arButtons['insertcolumn_before'] = ['BXButton', {
	id : 'insertcolumn_before',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsColLeft,
	handler: function () {this.pMainObj.TableOperation('column', 'insertleft', arguments[0]);}
}];
arButtons['insertcolumn_after'] = ['BXButton', {
	id : 'insertcolumn_after',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBInsColRight,
	handler: function () {this.pMainObj.TableOperation('column', 'insertright', arguments[0]);}
}];
arButtons['mergeallcellsincolumn'] = ['BXButton', {
	id : 'mergeallcellsincolumn',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBMergeColCells,
	handler: function () {this.pMainObj.TableOperation('column', 'mergecells', arguments[0]);},
	disablecheck: function (oTable, pMainObj)
	{
		return false;
		var arCells = pMainObj.getSelectedCells();
		if (arCells.length != 1 || arCells[0].parentNode.rowIndex == arCells[0].parentNode.parentNode.rows.length - 1)
			return true;
		return false;
	}
}];
arButtons['deletecolumn'] = ['BXButton', {
	id : 'deletecolumn',
	iconkit : '_global_iconkit.gif',
	name: BX_MESS.TBDelCol,
	handler: function () {this.pMainObj.TableOperation('column', 'delete', arguments[0]);}
}];

arButtons['deltable'] = ['BXButton',
	{
		id : 'deletetable',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.DeleteTable,
		title: BX_MESS.DeleteTable,
		handler: function ()
		{
			this.pMainObj.bSkipChanges = false;
			var pElement = BXFindParentByTagName(this.pMainObj.GetSelectionObject(), 'TABLE');
			if (pElement && pElement.nodeName.toUpperCase() == 'TABLE')
				pElement.parentNode.removeChild(pElement);
			this.pMainObj.OnChange("table", "deltable");
		}
	}];

arButtons['tableprop'] = ['BXButton',
	{
		id : 'tableprop',
		iconkit : '_global_iconkit.gif',
		name: BX_MESS.TBTableProp,
		title: BX_MESS.TBTableProp,
		handler: function ()
		{
			this.bNotFocus = true;
			var p = BXFindParentByTagName(this.pMainObj.GetSelectionObject(), 'TABLE');
			if (p) this.pMainObj.OpenEditorDialog("table", p, 450, {check_exists: true});
		}
	}];


arButtons['InsertHorizontalRule'] = ['BXButton',
	{
		id : 'InsertHorizontalRule',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBHr,
		handler: function()
		{
			if (BX.browser.IsIE())
				this.pMainObj.pMainObj.executeCommand('InsertHorizontalRule');
			else
				this.pMainObj.insertHTML('<img style="padding: 2px; width: 100%; height: 2px;" src="' + image_path + '/break_page.gif" id="' + this.pMainObj.SetBxTag(false, {tag: "hr", params: {value: "<hr/>"}}) + '"/>');
		}
	}
];

// arButtons['Justify'] = ['BXGroupedButton',
	// {
		// id: 'Justify',
		// buttons: [
			// {
				// id : 'JustifyLeft',
				// name : BX_MESS.TBJLeft,
				// cmd : 'JustifyLeft'
			// },
			// {
				// id : 'JustifyCenter',
				// name : BX_MESS.TBJCent,
				// cmd : 'JustifyCenter'
			// },
			// {
				// id : 'JustifyRight',
				// name : BX_MESS.TBJRig,
				// cmd : 'JustifyRight'
			// },
			// {
				// id : 'JustifyFull',
				// name : BX_MESS.TBJFull,
				// cmd : 'JustifyFull'
			// }
		// ]
	// }
// ];

arButtons['JustifyLeft'] = ['BXButton',
	{
		id : 'JustifyLeft',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBJLeft,
		cmd : 'JustifyLeft'
	}
];

arButtons['JustifyCenter'] = ['BXButton',
	{
		id : 'JustifyCenter',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBJCent,
		cmd : 'JustifyCenter'
	}
];

arButtons['JustifyRight'] = ['BXButton',
	{
		id : 'JustifyRight',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBJRig,
		cmd : 'JustifyRight'
	}
];

arButtons['JustifyFull'] = ['BXButton',
	{
		id : 'JustifyFull',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBJFull,
		cmd : 'JustifyFull'
	}
];

arButtons['InsertOrderedList'] = ['BXButton',
	{
		id : 'InsertOrderedList',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBOList,
		cmd : 'InsertOrderedList'
	}
];

arButtons['InsertUnorderedList'] = ['BXButton',
	{
		id : 'InsertUnorderedList',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBUnOList,
		cmd : 'InsertUnorderedList'
	}
];

arButtons['Outdent'] = ['BXButton',
	{
		id : 'Outdent',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.TBOutdent,
		title : BX_MESS.TBOutdent + "(Shift + Tab)",
		cmd : 'Outdent'
	}
];

arButtons['Indent'] = ['BXButton',
	{
		id : 'Indent',
		iconkit : '_global_iconkit.gif',
		title : BX_MESS.TBIndent + "(Tab)",
		name : BX_MESS.TBIndent,
		cmd : 'Indent'
	}
];

arButtons['BackColor'] = ['BXEdColorPicker',
	{
		id : 'BackColor',
		title : BX_MESS.Background_Color,
		disableOnCodeView: true,
		OnChange : function (color)
		{
			if(BX.browser.IsIE())
			{
				this.pMainObj.executeCommand('BackColor', color);
			}
			else
			{
				try{
					this.pMainObj.pEditorDocument.execCommand("styleWithCSS", false, true);
					if (!color)
						this.pMainObj.executeCommand('removeFormat'); //BXClearMozDirtyInRange(this.pMainObj);
					else
						this.pMainObj.executeCommand('hilitecolor', color);

					this.pMainObj.pEditorDocument.execCommand("styleWithCSS", false, false);
				}catch(e){_alert('Error: toolbarbuttons.js: arButtons["BackColor"]');}
			}
		}
	}
];

arButtons['ForeColor'] = ['BXEdColorPicker',
	{
		id : 'ForeColor',
		title : BX_MESS.Foreground_Color,
		disableOnCodeView : true,
		OnChange : function (color)
		{
			if (!color && !BX.browser.IsIE())
				this.pMainObj.executeCommand('removeFormat');
			else
				this.pMainObj.executeCommand('ForeColor', color);
		}
	}
];


var __BXSrcBtn = function (mode, split_mode)
{
	this.Check(mode==this.t);
	this._OnChangeView(mode, split_mode);
}

arButtons['wysiwyg'] = ['BXButton',
	{
		id : 'wysiwyg',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBWysiwyg,
		t : 'html',
		OnChangeView : __BXSrcBtn,
		handler : function () {this.pMainObj.SetView('html');}
	}
];

arButtons['source'] = ['BXButton',
	{
		id : 'source',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBSrc,
		t : 'code',
		OnChangeView : __BXSrcBtn,
		handler : function () {this.pMainObj.SetView('code');}
	}
];

arButtons['split'] = ['BXButton',
	{
		id : 'split',
		iconkit : '_global_iconkit.gif',
		codeEditorMode : true,
		name : BX_MESS.TBSplitmode,
		t : 'split',
		OnChangeView : __BXSrcBtn,
		handler : function () {this.pMainObj.SetView('split');}
	}
];


arButtons['Wrap'] = ['BXButton',
	{
		id : 'Wrap',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.WrapTitle,
		codeEditorMode : true,
		hideInHtmlEditorMode : true,
		//hideInFF : true,
		hideCondition: function() {return (navigator.appName=='Netscape');},
		defaultState : true,
		handler : function ()
		{
			if (!this.pWnd.checked)
			{
				this.pMainObj.pSourceFrame.wrap = 'soft';
				this.Check(true);
			}
			else
			{
				this.pMainObj.pSourceFrame.wrap = 'OFF';
				this.Check(false);
			}
			this.pMainObj.pSourceFrame.focus();
		}
	}
];

arButtons['HeadingList'] =
	['BXEdList',
		{
			id: 'HeadingList',
			field_size: 75,
			width: 210,
			title: '(' + BX_MESS.Format + ')',
			disableOnCodeView: true,
			bAdminConfigure: true,
			//bSetGlobalStyles: false,
			values:
			[
				{value: 'p', name: 'Normal'},
				{value: 'h1', name: 'Heading 1'},
				{value: 'h2', name: 'Heading 2'},
				{value: 'h3', name: 'Heading 3'},
				{value: 'h4', name: 'Heading 4'},
				{value: 'h5', name: 'Heading 5'},
				{value: 'h6', name: 'Heading 6'},
				{value: 'pre', name: 'Preformatted'}
			],
			OnSelectionChange: function (){
					var sel = 0;
					var frm = this.pMainObj.queryCommand('FormatBlock');
					if(frm)
					{
						var re = /[1-6]/;
						var r = frm.match(re);
						if(r>0)
							sel = r;
						else if(frm == 'pre')
							sel = 7;
					}

					this.Select(sel);
				},
			OnChange: function (selected){this.pMainObj.executeCommand('FormatBlock', (selected['value'].length>0?'<' + selected['value']+'>':'<p>'));},
			OnDrawItem: function (item)
			{
				if (!styleList_render_style)
					return item['name'];
				return (item['value'].length <= 0 ? item['name'] : '<'+item['value']+'>'+item['name']+'</'+item['value']+'>');
			}
		}
	];

arButtons['FontName'] =
	['BXEdList',
		{
			id: 'FontName',
			field_size: 75,
			title: '('+BX_MESS.Font+')',
			disableOnCodeView: true,
			values:
			[
				{value: 'Times New Roman', name: 'Times New Roman'},
				{value: 'Courier', name: 'Courier'},
				{value: 'Arial', name: 'Arial'},
				{value: 'Tahoma', name: 'Tahoma'},
				{value: 'Verdana', name: 'Verdana'},
				{value: 'Georgia', name: 'Georgia'}
			],
			OnSelectionChange: function (){
					this.SelectByVal(this.pMainObj.queryCommand('FontName'));
				},
			OnChange: function (selected){this.pMainObj.executeCommand('FontName', selected['value']);},
			//text-overflow : ellipsis;
			OnDrawItem: function (item){return '<span style="white-space: nowrap; font-family:'+item['name']+';font-size: 10pt;">'+item['name']+'</span>';}
		}
	];

arButtons['FontSize'] =
	['BXEdList',
		{
			id: 'FontSize',
			width: 250,
			field_size: 75,
			title: '(' + BX_MESS.Size + ')',
			disableOnCodeView: true,
			values:
			[
				{value: '1', name: 'xx-small'},
				{value: '2', name: 'x-small'},
				{value: '3', name: 'small'},
				{value: '4', name: 'medium'},
				{value: '5', name: 'large'},
				{value: '6', name: 'x-large'},
				{value: '7', name: 'xx-large'}
			],
			OnSelectionChange: function (){
					this.SelectByVal(this.pMainObj.queryCommand('FontSize'));
				},
			OnChange: function (selected){this.pMainObj.executeCommand('FontSize', selected['value']);},
			OnDrawItem: function (item){return '<font size="'+item['value']+'">'+item['name']+'</font>';}
		}
	];

arButtons['FontStyle'] = ['BXStyleList',
	{
		id: 'FontStyle',
		width: 200,
		field_size: 130,
		title: '(' + BX_MESS.Style + ')',
		disableOnCodeView: true,
		filter: ['DEFAULT'],
		prevType : false,
		deleteIfNoItems : true,
		OnChangeElement: function (arSelected)
		{
			if (this.pElement.tagName.toUpperCase() == 'BODY')
				this.pElement.innerHTML = '<span class="'+arSelected["value"]+'">'+this.pElement.innerHTML+'</span>';
			else
				SAttr(this.pElement, 'className', arSelected["value"]);
		},
		OnChangeText: function (arSelected)
		{
			var pElement = this.pMainObj.GetSelectedNode(true);
			if(arSelected["value"] == '')
				this.RemoveClass(pElement);
			else
				this.OptimizeSelection(
				{
					nodes: this.pMainObj.WrapSelectionWith("span", {props: {className: arSelected["value"]}}),
					className: arSelected["value"]
				});
		},
		OnSelectionChange: function ()
		{
			var pElement = this.pMainObj.GetSelectedNode();
			if(pElement && pElement.nodeType == 1)
			{
				if(this.prevType != pElement.tagName.toUpperCase())
				{
					this.prevType = pElement.tagName.toUpperCase();
					this.tag_name = pElement.tagName.toUpperCase();
					this.filter = [pElement.tagName.toUpperCase(), 'DEFAULT'];
					this.FillList();
				}

				this.pElement = pElement;
				this.OnChange = this.OnChangeElement;
				this.SelectByVal(this.pElement.className);
			}
			else
			{
				this.OnChange = this.OnChangeText;
				if(this.prevType != 'DEFAULT')
				{
					this.prevType = 'DEFAULT';
					this.filter = ['DEFAULT'];
					this.tag_name = '';
					this.FillList();
				}

				this.SelectByVal();
				if(pElement)
				{
					if(BX.browser.IsIE() && pElement.parentElement && (pElement = pElement.parentElement()))
						pElement = pElement.childNodes[0];

					while(pElement = pElement.parentNode)
					{
						if(pElement.nodeType == 1 && pElement.tagName.toUpperCase() == 'TABLE')
							break;
						if(pElement.nodeType == 1 && pElement.className)
						{
							if(pElement.tagName.toUpperCase() != 'SPAN' && pElement.tagName.toUpperCase() != 'FONT')
								break;
							this.SelectByVal(pElement.className);
							break;
						}
					}
				}
			}
		}
	}
];

arButtons['Template'] =
	['BXEdList',
		{
			id: 'Template',
			width: 240,
			maxHeight: 250,
			field_size: 150,
			title: '('+BX_MESS.Template+')',
			values: window.arBXTemplates,
			bSetFontSize: true,
			bSetGlobalStyles: true,
			OnCreate: function ()
			{
				this.pMainObj.pTemplateListbox = this;
			},
			OnInit: function ()
			{
				this.SelectByVal(this.pMainObj.templateID);
			},
			OnChange: function (selected)
			{
				this.pMainObj.LoadTemplateParams(selected['value']);
				if (this.pMainObj.pComponent2Taskbar)
					checkComp2Template(this.pMainObj);
			}
		}
	];

// FLASH, BREAK, .....
arButtons['page_break'] = [
	'BXButton',
	{
		id : 'page_break',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.PAGE_BREAK,
		handler : function ()
		{
			this.pMainObj.insertHTML('<img style="width: 100%; height: 4px;" src="' + image_path + '/break_page.gif" id="' + this.pMainObj.SetBxTag(false, {tag: "break_page"}) + '"/>');
		}
	}
];

arButtons['break_tag'] = [
	'BXButton',
	{
		id : 'break_tag',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.BREAK_TAG,
		handler : function ()
		{
			this.pMainObj.insertHTML("<img src=\"" + image_path + "/break_tag.gif\" id=\"" + this.pMainObj.SetBxTag(false, {tag: 'break'}) + "\"/>");
		}
	}
];

arButtons['insert_flash'] = [
	'BXButton',
	{
		id : 'insert_flash',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.FLASH,
		handler : function () {this.bNotFocus = true; this.pMainObj.OpenEditorDialog("flash", false, 500, {bUseTabControl: true, pMainObj: this.pMainObj});}
	}
];

arButtons['edit_flash'] = [
	'BXButton',
	{
		id : 'insert_flash',
		iconkit : '_global_iconkit.gif',
		name : BX_MESS.FLASH_MOV,
		handler : function ()
		{
			this.bNotFocus = true;
			this.pMainObj.OpenEditorDialog("flash", false, 500, {bUseTabControl: true, pMainObj: this.pMainObj});
		}
	}
];

arButtons['_taskbar_close'] = ['BXButton', {id : '_taskbar_close', iconkit : '_global_iconkit.gif', name :  BX_MESS.Close, title : BX_MESS.Close_toolbar, handler : function (arParams){arParams.pTaskbar.Close();}}];

arButtons['_taskbar_refresh'] = ['BXButton',{id : '_taskbar_refresh', iconkit : '_global_iconkit.gif', name : BX_MESS.RefreshData, title : BX_MESS.RefreshData, handler: function(arParams){arParams.pTaskbar.ClearCache();}}];

arButtons['_taskbar_hide'] = ['BXButton', {id : '_taskbar_hide', iconkit : '_global_iconkit.gif', name : BX_MESS.Hide, title : BX_MESS.Hide_toolbar, handler : function (arParams){arParams.pTaskbar.pTaskbarSet.Hide();}}];

arButtons['_settings'] = ['BXButton', {id : '_settings', iconkit : '_global_iconkit.gif', name : BX_MESS.Settings, title : BX_MESS.Settings_toolbar, handler :function (arParams) {this.pMainObj.OpenEditorDialog("settings", false, 600, {bUseTabControl: true, lightMode: lightMode, PHPGetParams: '&light_mode=' + (lightMode ? 'Y' : 'N')});}}];

var arCMButtons = [];
if (BX.browser.IsIE())
	arCMButtons["DEFAULT"] = [arButtons['Cut'], arButtons['Copy'], arButtons['Paste']];
else
	arCMButtons["DEFAULT"] = []; // FF - operations 'copy', 'cut' and 'paste' are unallowed

arCMButtons["A"] = [arButtons['CreateLink'], arButtons['deletelink']];
arCMButtons["IMG"] = [arButtons['image']];
arCMButtons["FLASH"] = [arButtons['edit_flash']];

arCMButtons["TABLE"] = [
	{
		isgroup : true,
		id : 'table_cell',
		name : BX_MESS.TBInsCell,
		elements : [
			arButtons['insertcell_before'],
			arButtons['insertcell_after'],
			arButtons['deletecell'],
			arButtons['mergecells'],
			arButtons['merge_right'],
			arButtons['merge_bottom'],
			arButtons['split_hor'],
			arButtons['split_ver']
		]
	},
	{
		isgroup : true,
		id : 'table_row',
		name : BX_MESS.TBInsRow,
		elements : [
			arButtons['insertrow_before'],
			arButtons['insertrow_after'],
			arButtons['deleterow'],
			arButtons['mergeallcellsinrow']
		]
	},
	{
		isgroup : true,
		id : 'table_column',
		name : BX_MESS.TBInsColumn,
		elements : [
			arButtons['insertcolumn_before'],
			arButtons['insertcolumn_after'],
			arButtons['deletecolumn'],
			arButtons['mergeallcellsincolumn']
		]
	},
	arButtons['deltable'],
	arButtons['tableprop']
];

arCMButtons["_TASKBAR_DEFAULT"] = [arButtons['_taskbar_hide'], arButtons['_settings'], arButtons['_taskbar_close']];
arCMButtons["_TASKBAR_PROPERTIES"] = [arButtons['_taskbar_hide'], arButtons['_settings']];
arCMButtons["_TASKBAR_CACHED"] = [arButtons['_taskbar_hide'], arButtons['_taskbar_refresh'], arButtons['_settings'], arButtons['_taskbar_close']];

if (!window.arToolbars)
	arToolbars = {};

arToolbars['standart'] = [
	BX_MESS.TBSStandart,
	[
	arButtons['Fullscreen'], 'separator',
	arButtons['Settings'], arButtons['separator'],
	arButtons['Cut'], arButtons['Copy'], arButtons['Paste'], arButtons['pasteword'], arButtons['pastetext'], arButtons['SelectAll'], arButtons['separator'],
	arButtons['Undo'], arButtons['Redo'], arButtons['separator'],
	arButtons['borders'], 'separator',
	arButtons['table'], arButtons['anchor'], arButtons['CreateLink'], arButtons['deletelink'], arButtons['image'],  'separator',
	arButtons['SpecialChar'],
	arButtons['page_break'],
	arButtons['break_tag'],
	arButtons['insert_flash']
	]
];

arToolbars['style'] = [
	BX_MESS.TBSStyle,
		[arButtons['FontStyle'], arButtons['HeadingList'], arButtons['FontName'], arButtons['FontSize'], arButtons['separator'],
			arButtons['Bold'], arButtons['Italic'], arButtons['Underline'], arButtons['Strike'], 'separator',
			arButtons['RemoveFormat'], arButtons['Optimize']
		]
	];

arToolbars['formating'] = [
	BX_MESS.TBSFormat,
			[arButtons['InsertHorizontalRule'], arButtons['separator'],
				//arButtons['Justify'], arButtons['separator'],
				arButtons['JustifyLeft'], arButtons['JustifyCenter'], arButtons['JustifyRight'], arButtons['JustifyFull'], arButtons['separator'],
				arButtons['InsertOrderedList'], arButtons['InsertUnorderedList'],arButtons['separator'],
				arButtons['Outdent'], arButtons['Indent'], arButtons['separator'],
				arButtons['BackColor'], arButtons['ForeColor']
			]
	];

arToolbars['source'] = [
		BX_MESS.TBSEdit,
		[arButtons['wysiwyg'], arButtons['source'], arButtons['split'], arButtons['Wrap']]
	];

arToolbars['template'] = [
	BX_MESS.TBSTemplate,
	[arButtons['Template']]
	];

var arDefaultTBPositions = {
		standart: [0, 0, 0],
		template: [0, 0, 2],
		source: [1, 0, 0],
		style: [0, 1, 0],
		formating: [0, 1, 1]
	};


pPropertybarHandlers['table'] = function (bNew, pTaskbar, pElement)
{
	if(bNew)
	{
		pTaskbar.arElements = [];
		var tProp;
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
		if(arBarHandlersCache['table'])
		{
			var tProp = arBarHandlersCache['table'][0];
			pTaskbar.arElements = arBarHandlersCache['table'][1];
		}
		else
		{
			tProp = pTaskbar.pMainObj.pDocument.createElement("TABLE");
			tProp.className = "bxtaskbarprops";
			tProp.style.width = "100%";
			//tProp.style.height = "100%";
			tProp.cellSpacing = 0;
			tProp.cellPadding = 1;
			var row = tProp.insertRow(-1);

			var cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropSize}));

			cell = row.insertCell(-1); cell.noWrap = true;
			pTaskbar.arElements['width'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'size':'5', 'title': BX_MESS.TPropW, 'type': 'text'}));
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':'x'}));
			pTaskbar.arElements['height'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'size':'5', 'title': BX_MESS.TPropH, 'type': 'text'}));


			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropBord}));

			cell = row.insertCell(-1);
			pTaskbar.arElements['border'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'type': 'text', 'size': '5'}));
			////
			row = tProp.insertRow(-1);
			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropStyle}));
			cell = row.insertCell(-1);
			//1
			var pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXStyleList',
				{
					id: 'tableStyleList',
					width: 200,
					field_size: 80,
					title: '(' + BX_MESS.Style + ')',
					tag_name: 'TABLE',
					filter: ['TABLE', 'DEFAULT'],
					disableOnCodeView: true,
					OnChangeElement: function (arSelected)
					{
						SAttr(this.pElement, 'className', arSelected["value"]);
					},
					OnChangeText: function (arSelected)
					{
						var pElement = this.pMainObj.GetSelectedNode(true);
						if(arSelected["value"] == '')
							this.RemoveClass(pElement);
						else
							this.OptimizeSelection(
							{
								nodes: this.pMainObj.WrapSelectionWith("span", {props: {className: arSelected["value"]}}),
								className: arSelected["value"]
							});
					},
					OnSelectionChange: function ()
					{
						var pElement = this.pMainObj.GetSelectedNode();
						if(pElement && pElement.nodeType == 1)
						{
							if(this.prevType != pElement.tagName.toUpperCase())
							{
								this.prevType = pElement.tagName.toUpperCase();
								this.tag_name = pElement.tagName.toUpperCase();
								this.filter = [pElement.tagName.toUpperCase(), 'DEFAULT'];
								this.FillList();
							}

							this.pElement = pElement;
							this.OnChange = this.OnChangeElement;
							this.SelectByVal(this.pElement.className);
						}
						else
						{
							this.OnChange = this.OnChangeText;
							if(this.prevType != 'DEFAULT')
							{
								this.prevType = 'DEFAULT';
								this.filter = ['DEFAULT'];
								this.tag_name = '';
								this.FillList();
							}

							this.SelectByVal();
							if(pElement)
							{
								if(BX.browser.IsIE() && pElement.parentElement && (pElement = pElement.parentElement()))
									pElement = pElement.childNodes[0];

								while(pElement = pElement.parentNode)
								{
									if(pElement.nodeType == 1 && pElement.tagName.toUpperCase() == 'TABLE')
										break;
									if(pElement.nodeType == 1 && pElement.className)
									{
										if(pElement.tagName.toUpperCase() != 'SPAN' && pElement.tagName.toUpperCase() != 'FONT')
											break;
										this.SelectByVal(pElement.className);
										break;
									}
								}
							}
						}
					}
				});
			pTaskbar.arElements['cssclass'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);
			pObjTemp = null;

			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropBG}));
			pObjTemp = null;

			cell = row.insertCell(-1);
			pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXEdColorPicker', {with_input: true});
			pTaskbar.arElements['bgcolor'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);
			pObjTemp = null;

			////
			row = tProp.insertRow(-1);
			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':'CellPadding: '}));

			cell = row.insertCell(-1);
			pTaskbar.arElements['cellpadding'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'type': 'text', 'size': '5'}));

			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropAlign}));

			cell = row.insertCell(-1);
			pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXTAlignPicker', {'type': 'table'});
			pTaskbar.arElements['talign'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);

			row = tProp.insertRow(-1);
			cell = row.insertCell(-1); cell.align = 'right';
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':'CellSpacing: '}));

			cell = row.insertCell(-1);
			pTaskbar.arElements['cellspacing'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'type': 'text', 'size': '5'}));
			cell = row.insertCell(-1);
			cell = row.insertCell(-1);

			arBarHandlersCache['table'] = [tProp, pTaskbar.arElements];
		}
		tProp.id = 'tProp_leak';
		pTaskbar.pCellProps.appendChild(tProp);
		cell = null;
		row = null;
		tProp = null;
	}

	pTaskbar.arElements['width'].value = GAttr(pElement, 'width');
	pTaskbar.arElements['height'].value = GAttr(pElement, 'height');
	pTaskbar.arElements['border'].value = GAttr(pElement, 'border');
	pTaskbar.arElements['cellpadding'].value = GAttr(pElement, 'cellPadding');
	pTaskbar.arElements['cellspacing'].value = GAttr(pElement, 'cellSpacing');
	pTaskbar.arElements['bgcolor'].SetValue(pElement.bgColor);
	pTaskbar.arElements['talign'].SetValue(pElement.align);
	pTaskbar.arElements['cssclass'].SelectByVal(pElement.className);

	var fChange = function (){
		SAttr(pElement, 'width', pTaskbar.arElements['width'].value);
		SAttr(pElement, 'height', pTaskbar.arElements['height'].value);
		SAttr(pElement, 'border', pTaskbar.arElements['border'].value);
		SAttr(pElement, 'cellPadding', pTaskbar.arElements['cellpadding'].value);
		SAttr(pElement, 'cellSpacing', pTaskbar.arElements['cellspacing'].value);
	};

	pTaskbar.arElements['height'].onchange = fChange;
	pTaskbar.arElements['width'].onchange = fChange;
	pTaskbar.arElements['border'].onchange = fChange;
	pTaskbar.arElements['cellpadding'].onchange = fChange;
	pTaskbar.arElements['cellspacing'].onchange = fChange;
	pTaskbar.arElements['bgcolor'].OnChange = function (color) {pElement.bgColor = color;};
	pTaskbar.arElements['talign'].OnChange = function (alH) {pElement.align = alH;};
	pTaskbar.arElements['cssclass'].OnChange = function (className) {pElement.className=className.value;};
}

pPropertybarHandlers['td'] = function (bNew, pTaskbar, pElement)
{
	if(bNew)
	{
		pTaskbar.arElements = [];

		var tProp;
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
		if(arBarHandlersCache['td'])
		{
			tProp = arBarHandlersCache['td'][0];
			pTaskbar.arElements = arBarHandlersCache['td'][1];
		}
		else
		{
			tProp = pTaskbar.pMainObj.pDocument.createElement("TABLE");
			tProp.className = "bxtaskbarprops";
			tProp.style.width = "100%";
			tProp.cellSpacing = 0;
			tProp.cellPadding = 1;
			var row = tProp.insertRow(-1);

			var cell = row.insertCell(-1); cell.align = 'right';
			oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropStyle});
			cell.appendChild(oSpan);
			oSpan = null;

			cell = row.insertCell(-1);

			//2
			var pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXStyleList',
				{
					id: 'tdStyleList',
					width: 200,
					field_size: 80,
					title: '(' + BX_MESS.Style + ')',
					tag_name: 'TD',
					filter: ['TD', 'DEFAULT'],
					disableOnCodeView: true,
					OnChangeElement: function (arSelected) {SAttr(this.pElement, 'className', arSelected["value"]);},
					OnChangeText: function (arSelected)
					{
						var pElement = this.pMainObj.GetSelectedNode(true);
						if(arSelected["value"] == '')
							this.RemoveClass(pElement);
						else
							this.OptimizeSelection(
							{
								nodes: this.pMainObj.WrapSelectionWith("span", {props: {className: arSelected["value"]}}),
								className: arSelected["value"]
							});
					},
					OnSelectionChange: function ()
					{
						var pElement = this.pMainObj.GetSelectedNode();
						if(pElement && pElement.nodeType == 1)
						{
							if(this.prevType != pElement.tagName.toUpperCase())
							{
								this.prevType = pElement.tagName.toUpperCase();
								this.tag_name = pElement.tagName.toUpperCase();
								this.filter = [pElement.tagName.toUpperCase(), 'DEFAULT'];
								this.FillList();
							}

							this.pElement = pElement;
							this.OnChange = this.OnChangeElement;
							this.SelectByVal(this.pElement.className);
						}
						else
						{
							this.OnChange = this.OnChangeText;
							if(this.prevType != 'DEFAULT')
							{
								this.prevType = 'DEFAULT';
								this.filter = ['DEFAULT'];
								this.tag_name = '';
								this.FillList();
							}

							this.SelectByVal();
							if(pElement)
							{
								if(BX.browser.IsIE() && pElement.parentElement && (pElement = pElement.parentElement()))
									pElement = pElement.childNodes[0];

								while(pElement = pElement.parentNode)
								{
									if(pElement.nodeType == 1 && pElement.tagName.toUpperCase() == 'TABLE')
										break;
									if(pElement.nodeType == 1 && pElement.className)
									{
										if(pElement.tagName.toUpperCase() != 'SPAN' && pElement.tagName.toUpperCase() != 'FONT')
											break;
										this.SelectByVal(pElement.className);
										break;
									}
								}
							}
						}
					}
				});
			pTaskbar.arElements['cssclass'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);

			cell = row.insertCell(-1); cell.align = 'right';
			var oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropSize});
			cell.appendChild(oSpan);
			oSpan = null;

			cell = row.insertCell(-1);
			var oInput = pTaskbar.pMainObj.CreateElement("INPUT", {'size':'5', 'title': BX_MESS.TPropW, 'type': 'text'});
			pTaskbar.arElements['width_val'] = cell.appendChild(oInput);
			oInput = null;
			var oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':'x'});
			cell.appendChild(oSpan);
			oSpan = null;
			var oInput = pTaskbar.pMainObj.CreateElement("INPUT", {'size':'5', 'title': BX_MESS.TPropH, 'type': 'text'});
			pTaskbar.arElements['height_val'] = cell.appendChild(oInput);
			oInput = null;

			row = tProp.insertRow(-1);
			cell = row.insertCell(-1); cell.align = 'right';
			var oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropAlign});
			cell.appendChild(oSpan);
			oSpan = null;

			cell = row.insertCell(-1);
			pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXTAlignPicker');
			pTaskbar.arElements['talign'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);
			pObjTemp = null;

			cell = row.insertCell(-1); cell.align = 'right';
			var oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropBG});
			cell.appendChild(oSpan);
			oSpan = null;

			cell = row.insertCell(-1);
			pObjTemp = pTaskbar.pMainObj.CreateCustomElement('BXEdColorPicker', {'with_input': true});
			pTaskbar.arElements['bgcolor'] = pObjTemp;
			cell.appendChild(pObjTemp.pWnd);
			pObjTemp = null;

			row = tProp.insertRow(-1);
			cell = row.insertCell(-1); cell.align = 'right';
			var oSpan = pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML': BX_MESS.TPropNoWrap+':'});
			cell.appendChild(oSpan);
			oSpan = null;

			cell = row.insertCell(-1);
			var oInput = pTaskbar.pMainObj.CreateElement("INPUT", {'title': BX_MESS.TPropNoWrap, 'type': 'checkbox'});
			pTaskbar.arElements['nowrap'] = cell.appendChild(oInput);
			oInput = null;

			arBarHandlersCache['td'] = [tProp, pTaskbar.arElements];
		}
		tProp.id = 'tProp_td_leak';
		pTaskbar.pCellProps.appendChild(tProp);

		pObjTemp = null;
		cell = null;
		row = null
		tProp = null;
	}

	pTaskbar.arElements['width_val'].value = pElement.width;
	pTaskbar.arElements['height_val'].value = pElement.height;
	pTaskbar.arElements['nowrap'].checked = pElement.noWrap;
	pTaskbar.arElements['bgcolor'].SetValue(pElement.bgColor);
	pTaskbar.arElements['talign'].SetValue(pElement.align, pElement.vAlign);
	pTaskbar.arElements['cssclass'].SelectByVal(pElement.className);

	var fChange = function ()
	{
		pElement.width = pTaskbar.arElements['width_val'].value;
		pElement.height = pTaskbar.arElements['height_val'].value;
		pElement.noWrap = pTaskbar.arElements['nowrap'].checked;
	};

	pTaskbar.arElements['height_val'].onchange = fChange;
	pTaskbar.arElements['width_val'].onchange = fChange;
	pTaskbar.arElements['nowrap'].onclick = fChange;
	pTaskbar.arElements['bgcolor'].OnChange = function (color) {pElement.bgColor = color;};
	pTaskbar.arElements['talign'].OnChange = function (alH, alV) {pElement.align = alH; pElement.vAlign = alV;};
	pTaskbar.arElements['cssclass'].OnChange = function (className) {pElement.className = className.value;};
}

pPropertybarHandlers['a'] = function (bNew, pTaskbar, pElement)
{
	var tProp, row, cell;

	if(bNew)
	{
		pTaskbar.arElements = [];
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
		if(arBarHandlersCache['a'])
		{
			tProp = arBarHandlersCache['a'][0];
			pTaskbar.arElements = arBarHandlersCache['a'][1];
		}
		else
		{
			tProp = BX.create('TABLE', {props: {className : "bxtaskbarprops"}});
			row = tProp.insertRow(-1);

			// Url
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_a_url" class="bxpr-main">' + BX_MESS.TPropURL + ':</label>'});
			pTaskbar.arElements.href = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '40', title: BX_MESS.TPropURL, type: 'text', id: "bxp_a_url"}}));

			// Target
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_a_target">' + BX_MESS.TPropTarget + ':</label>'});
			pTaskbar.arElements.target = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("SELECT", {props: {title: BX_MESS.TPropTarget, id: "bxp_a_target"}}));
			var arOpt = [
				['', '- ' + BX_MESS.NoVal + ' -'],
				['_blank', BX_MESS.TPropTargetBlank],
				['_parent', BX_MESS.TPropTargetParent],
				['_self', BX_MESS.TPropTargetSelf],
				['_top', BX_MESS.TPropTargetTop]
			], i, l = arOpt.length;

			for(i = 0; i < l; i++)
				pTaskbar.arElements.target.options.add(new Option(arOpt[i][1], arOpt[i][0], false, false));

			row = tProp.insertRow(-1);
			// Title
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_a_title" class="bxpr-main">' + BX_MESS.TPropTitle + ':</label>'});
			pTaskbar.arElements.title = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '40', type: 'text', title: BX_MESS.TPropTitle, id: "bxp_a_title"}}));

			// Class
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropStyle + '</label>'});
			pTaskbar.arElements.cssclass = pTaskbar.pMainObj.CreateCustomElement('BXStyleList',
			{
				id: 'linkStyleList',
				width: 200,
				field_size: 120,
				title: '(' + BX_MESS.Style + ')',
				tag_name: 'A',
				filter: ['A', 'DEFAULT'],
				disableOnCodeView: true,
				OnChange: function (arSelected)
				{
					SAttr(this.pElement, 'className', arSelected["value"]);
				}
			});
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.arElements.cssclass.pWnd);

			row = tProp.insertRow(-1);
			// Noindex
			pTaskbar.arElements.noindex = BX.adjust(row.insertCell(-1), {props: {align: 'right'}}).appendChild(BX.create("INPUT", {props: {type: 'checkbox', title: BX_MESS.LinkNoindex, id: "bxp_a_noindex"}}));
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}, html: '<label for="bxp_a_noindex">' + BX_MESS.LinkNoindex + '</label>'});

			// Id
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_a_id">ID:</label>'});
			pTaskbar.arElements.id = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.TPropTitle, id: "bxp_a_id"}}));

			row = tProp.insertRow(-1);
			row.insertCell(-1);
			row.insertCell(-1);
			// Rel
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_a_rel">' + BX_MESS.Rel + ':</label>'});
			pTaskbar.arElements.rel = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.Rel, id: "bxp_a_rel"}}));

			arBarHandlersCache['a'] = [tProp, pTaskbar.arElements];
		}

		pTaskbar.pCellProps.appendChild(tProp);
	}

	var oTag = pTaskbar.pMainObj.GetBxTag(pElement);
	if (oTag.tag != 'a' || !oTag.params)
		return;

	pTaskbar.arElements.href.value = oTag.params.href || '';
	pTaskbar.arElements.target.value = oTag.params.target || '';
	pTaskbar.arElements.title.value = oTag.params.title || '';
	pTaskbar.arElements.id.value = oTag.params.id || '';
	pTaskbar.arElements.noindex.checked = !!oTag.params.noindex;
	if (oTag.params.noindex)
	{
		oTag.params.rel = "nofollow";
		pTaskbar.arElements.rel.disabled = true;
	}
	else
	{
		pTaskbar.arElements.rel.disabled = false;
	}
	pTaskbar.arElements.rel.value = oTag.params.rel || '';

	pTaskbar.arElements.cssclass.pElement = pElement;
	setTimeout(function()
	{
		//pTaskbar.arElements.cssclass.SelectByVal(oTag.params['class'], true);
		pTaskbar.arElements.cssclass.SelectByVal(pElement.className || "", true);
	}, 10);

	var arEls = ['href', 'title', 'id', 'rel', 'target'];

	pTaskbar.arElements.href.onchange =
	pTaskbar.arElements.title.onchange =
	pTaskbar.arElements.id.onchange =
	pTaskbar.arElements.rel.onchange =
	pTaskbar.arElements.noindex.onclick =
	pTaskbar.arElements.target.onchange = function ()
	{
		oTag.params.href = pTaskbar.arElements.href.value;
		oTag.params.title = pTaskbar.arElements.title.value;
		oTag.params.id = pTaskbar.arElements.id.value;
		oTag.params.target = pTaskbar.arElements.target.value;
		oTag.params.noindex = !!pTaskbar.arElements.noindex.checked;
		if (oTag.params.noindex)
		{
			pTaskbar.arElements.rel.value = "nofollow";
			pTaskbar.arElements.rel.disabled = true;
		}
		else
		{
			if (pTaskbar.arElements.rel.value == "nofollow" && this != pTaskbar.arElements.rel)
				pTaskbar.arElements.rel.value = "";
			pTaskbar.arElements.rel.disabled = false;
		}
		oTag.params.rel = pTaskbar.arElements.rel.value;

		for (i = 0; i < l; i++)
			if (!pTaskbar.pMainObj.pParser.isPhpAttribute(oTag.params[arEls[i]]))
				SAttr(pElement, arEls[i], oTag.params[arEls[i]]);

		pTaskbar.pMainObj.SetBxTag(pElement, oTag);
	};
};

pPropertybarHandlers['anchor'] = function (bNew, pTaskbar, pElement)
{
	if(bNew)
	{
		pTaskbar.arElements = [];
		var tProp;
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
		if(arBarHandlersCache['anchor'])
		{
			tProp = arBarHandlersCache['anchor'][0];
			pTaskbar.arElements = arBarHandlersCache['anchor'][1];
		}
		else
		{
			tProp = pTaskbar.pMainObj.CreateElement("TABLE");
			tProp.className = "bxtaskbarprops";
			tProp.style.width = "100%";
			tProp.cellSpacing = 0;
			tProp.cellPadding = 1;
			var row, cell;

			row = tProp.insertRow(-1); cell = row.insertCell(-1); cell.align = 'right'; cell.width="50%";
			cell.appendChild(pTaskbar.pMainObj.CreateElement("SPAN", {'innerHTML':BX_MESS.TPropName}));

			cell = row.insertCell(-1); cell.width="50%";
			pTaskbar.arElements['name'] = cell.appendChild(pTaskbar.pMainObj.CreateElement("INPUT", {'size':'40', 'title': BX_MESS.TPropAnchorName, 'type': 'text'}));

			arBarHandlersCache['anchor'] = [tProp, pTaskbar.arElements];
		}

		pTaskbar.pCellProps.appendChild(tProp);
	}

	var bxTag = pTaskbar.pMainObj.GetBxTag(pElement);
	pTaskbar.arElements['name'].value = pTaskbar.pMainObj.pParser.GetAnchorName(bxTag.params.value);

	pTaskbar.arElements['name'].onchange = function ()
	{
		var bxTag = pTaskbar.pMainObj.GetBxTag(pElement);
		bxTag.params.value = pTaskbar.pMainObj.pParser.GetAnchorName(bxTag.params.value, pTaskbar.arElements.name.value);
		pTaskbar.pMainObj.SetBxTag(false, bxTag);
	};
};

pPropertybarHandlers['img'] = function (bNew, pTaskbar, pElement)
{
	var tProp, row, cell;
	if(bNew)
	{
		pTaskbar.arElements = [];
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
		var arBarHandlersCache = [];

		if(arBarHandlersCache['img'])
		{
			tProp = arBarHandlersCache['img'][0];
			pTaskbar.arElements = arBarHandlersCache['img'][1];
		}
		else
		{
			tProp = BX.create('TABLE', {props: {className : "bxtaskbarprops"}});
			row = tProp.insertRow(-1);

			// Src
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_src" class="bxpr-main">'+BX_MESS.TPropImgPath+'</label>'});
			pTaskbar.arElements.src = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '40', title: BX_MESS.TPropImgPath2, type: 'text', id: "bxp_img_src"}}));

			// hspace
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_hspace">' + BX_MESS.TPropImgHSpace + '</label>'});

			pTaskbar.arElements.hspace = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '6', title: BX_MESS.TPropImgHSpace, type: 'text', id: "bxp_img_hspace"}}));

			row = tProp.insertRow(-1);
			// Width and height
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_width" class="bxpr-main">' + BX_MESS.TPropSize + '</label>'});
			var r = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("TABLE", {props: {className: "bx-sp-props-tbl"}})).insertRow(-1);
			var cell1 = r.insertCell(-1);
			pTaskbar.arElements.width = cell1.appendChild(BX.create("INPUT", {props: {size: '5', title: BX_MESS.TPropW, type: 'text', id: "bxp_img_width"}}));
			cell1.appendChild(BX.create("SPAN", {text : 'x', style: {margin: "0 3px"}}));
			pTaskbar.arElements.height = cell1.appendChild(BX.create("INPUT", {props: {size: '5', title: BX_MESS.TPropH, type: 'text', id: "bxp_img_height"}}));

			pTaskbar.arElements.saveProp = r.insertCell(-1).appendChild(BX.create("INPUT", {props: {title: BX_MESS.TPropW, type: 'checkbox', id: "bxp_img_save_prop", checked: true}, style: {marginLeft: "10px"}}));

			r.insertCell(-1).appendChild(BX.create("LABEL", {text: BX_MESS.SaveProp})).setAttribute("for", "bxp_img_save_prop");

			// Vspace
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_vspace">' + BX_MESS.TPropImgVSpace + '</label>'});
			pTaskbar.arElements.vspace = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '6', title: BX_MESS.TPropImgVSpace, type: 'text', id: "bxp_img_vspace"}}));

			row = tProp.insertRow(-1);
			// Title
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_title" class="bxpr-main">' + BX_MESS.TPropImgTitle + ':</label>'});
			pTaskbar.arElements.title = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '40', title: BX_MESS.TPropImgTitle, type: 'text', id: "bxp_img_title"}}));

			// Style
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropStyle + '</label>'});
			pTaskbar.arElements.cssclass = pTaskbar.pMainObj.CreateCustomElement('BXStyleList',
				{
					id: 'imgStyleList',
					width: 200,
					field_size: 120,
					title: '(' + BX_MESS.Style + ')',
					tag_name: 'IMG',
					filter: ['IMG', 'DEFAULT'],
					disableOnCodeView: true,
					OnChange: function(arSelected)
					{
						SAttr(this.pElement, 'className', arSelected["value"]);
					}
				}
			);
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.arElements.cssclass.pWnd);

			row = tProp.insertRow(-1);
			// Alt
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_alt">' + BX_MESS.TPropImgAlt + ':</label>'});
			pTaskbar.arElements.alt = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '40', title: BX_MESS.TPropImgAlt, type: 'text', id: "bxp_img_alt"}}));

			// Align
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropAlign + '</label>'});
			pTaskbar.arElements.talign = pTaskbar.pMainObj.CreateCustomElement('BXTAlignPicker',
				{
					type: 'image',
					OnChange: function (align)
					{
						pElement.align = align;
					}
				}
			);
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.arElements.talign.pWnd);

			row = tProp.insertRow(-1);
			// Border
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_img_border">' + BX_MESS.TPropImgBorder + ':</label>'});
			pTaskbar.arElements.border = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {size: '4', title: BX_MESS.TPropImgBorder, type: 'text', id: "bxp_img_border"}}));

			// Empty cells
			row.insertCell(-1);
			row.insertCell(-1);

			arBarHandlersCache['img'] = [tProp, pTaskbar.arElements];
		}
		pTaskbar.pCellProps.appendChild(tProp);
	}

	var oTag = pTaskbar.pMainObj.GetBxTag(pElement);
	if (oTag.tag != 'img' || !oTag.params)
		return;

	var arEls = ['src', 'alt', 'title', 'hspace', 'vspace', 'border', 'width', 'height'], i, l = arEls.length;

	pTaskbar.arElements.src.value = oTag.params.src || '';
	pTaskbar.arElements.alt.value = oTag.params.alt || '';
	pTaskbar.arElements.title.value = oTag.params.title || '';
	pTaskbar.arElements.hspace.value = oTag.params.hspace || '';
	pTaskbar.arElements.vspace.value = oTag.params.vspace || '';
	pTaskbar.arElements.border.value = oTag.params.border || '';
	pTaskbar.arElements.talign.SetValue(oTag.params.align);

	pTaskbar.arElements.cssclass.pElement = pElement;
	pTaskbar.arElements.cssclass.SelectByVal(pElement.className || "", true);

	var
		w1 = parseInt(pElement.style.width) || parseInt(pElement.width) || parseInt(pElement.offsetWidth),
		h1 = parseInt(pElement.style.height) || parseInt(pElement.height) || parseInt(pElement.offsetHeight);

	pTaskbar.arElements.width.value = w1;
	pTaskbar.arElements.height.value = h1;

	if (w1 && h1)
		pTaskbar.iRatio = w1 / h1;
	else
		pTaskbar.iRatio = 1;

	var fChange = function ()
	{
		oTag.params.src = pTaskbar.arElements.src.value;
		oTag.params.alt = pTaskbar.arElements.alt.value;
		oTag.params.title = pTaskbar.arElements.title.value;
		oTag.params.hspace = pTaskbar.arElements.hspace.value;
		oTag.params.vspace = pTaskbar.arElements.vspace.value;
		oTag.params.border = pTaskbar.arElements.border.value;

		var w = parseInt(pTaskbar.arElements.width.value);
		if (isNaN(w))
		{
			pElement.removeAttribute('width');
			pElement.style.width = "";
		}
		else
		{
			pElement.removeAttribute('width');
			if (parseInt(pElement.style.width) > 0)
				pElement.style.width = w + "px";
			else
				SAttr(pElement, 'width', w);
		}

		var h = parseInt(pTaskbar.arElements.height.value);
		if (isNaN(h))
		{
			pElement.removeAttribute('height');
			pElement.style.height = "";
		}
		else
		{
			pElement.removeAttribute('height');
			if (parseInt(pElement.style.height) > 0)
				pElement.style.height = h + "px";
			else
				SAttr(pElement, 'height', h);
		}

		for (i = 0; i < l; i++)
		{
			if (oTag.params[arEls[i]] && !pTaskbar.pMainObj.pParser.isPhpAttribute(oTag.params[arEls[i]]) && arEls[i] !== 'width' && arEls[i] !== 'height')
				SAttr(pElement, arEls[i], oTag.params[arEls[i]]);
		}

		pTaskbar.pMainObj.SetBxTag(pElement, oTag);
	}

	for (i = 0; i < l; i++)
		if (pTaskbar.arElements[arEls[i]])
			pTaskbar.arElements[arEls[i]].onchange = fChange;

	// Save proportion feature
	pTaskbar.arElements.saveProp.onclick = function()
	{
		if (this.checked)
			pTaskbar.arElements.width.onchange();
	};

	pTaskbar.arElements.width.onchange = function()
	{
		var wval = parseInt(this.value);
		if (isNaN(wval))
			return;
		pTaskbar.arElements.width.value = wval;
		if (pTaskbar.arElements.saveProp.checked && pTaskbar.iRatio)
			pTaskbar.arElements.height.value = Math.round(wval / pTaskbar.iRatio);
		fChange();
	};

	pTaskbar.arElements.height.onchange = function()
	{
		var hval = parseInt(this.value);
		if (isNaN(hval))
			return;

		pTaskbar.arElements.height.value = hval;
		if (pTaskbar.arElements.saveProp.checked)
			pTaskbar.arElements.width.value = parseInt(hval * pTaskbar.iRatio);

		fChange();
	};

	pTaskbar.arElements.cssclass.onchange = function (sel) {pElement.className = sel['value'];};
	pTaskbar.arElements.talign.OnChange = function (align) {pElement.align = align;};
};

pPropertybarHandlers['comments'] =
pPropertybarHandlers['script'] =
pPropertybarHandlers['php'] =
pPropertybarHandlers['code'] = // For .Net
pPropertybarHandlers['aspx_comment'] = // For .Net
pPropertybarHandlers['.net component'] = // For .Net
function (bNew, pTaskbar, pElement)
{
	if(bNew)
	{
		pTaskbar.arElements = {};
		pTaskbar.arElements.text = pTaskbar.pCellProps.appendChild(BX.create("TEXTAREA", {props: {cols: '60'}, style:{width: "100%", height: "120px"}}));

		if (IEplusDoctype)
			pTaskbar.arElements.text.rows = "20";
	}

	var bxTag = pTaskbar.pMainObj.GetBxTag(pElement);

	pTaskbar.arElements.text.value = bxTag.params.value;
	pTaskbar.arElements.text.onchange = function ()
	{
		var bxTag = pTaskbar.pMainObj.GetBxTag(pElement);
		bxTag.params.value = pTaskbar.arElements.text.value;
		pTaskbar.pMainObj.SetBxTag(false, bxTag);
	};
};

pPropertybarHandlers['default'] = function (bNew, pTaskbar, pElement)
{
	if(!bNew)
		return;

	pTaskbar.arElements = [];
	var tProp, row;
	var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;
	if(arBarHandlersCache['default'])
	{
		tProp = arBarHandlersCache['default'][0];
		pTaskbar.arElements = arBarHandlersCache['default'][1];
	}
	else
	{
		tProp = BX.create('TABLE', {props: {className : "bxtaskbarprops"}});
		row = tProp.insertRow(-1);

		// Style
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropStyle + '</label>'});

		pTaskbar.arElements.cssclass = pTaskbar.pMainObj.CreateCustomElement('BXStyleList',
			{
				id: 'defaultStyleList',
				width: 200,
				field_size: 80,
				title: '(' + BX_MESS.Style + ')',
				filter: ['DEFAULT'],
				disableOnCodeView: true,
				OnChangeElement : function (arSelected)
				{
					SAttr(this.pElement, 'className', arSelected["value"]);
				},
				OnChangeText : function (arSelected)
				{
					var pElement = this.pMainObj.GetSelectedNode(true);
					if(arSelected["value"] == '')
						this.RemoveClass(pElement);
					else
						this.OptimizeSelection(
						{
							nodes: this.pMainObj.WrapSelectionWith("span", {props: {className: arSelected["value"]}}),
							className: arSelected["value"]
						});
				},
				OnSelectionChange: function ()
				{
					var pElement = this.pMainObj.GetSelectedNode();
					if(pElement && pElement.nodeType == 1)
					{
						if(this.prevType != pElement.tagName.toUpperCase())
						{
							this.prevType = pElement.tagName.toUpperCase();
							this.tag_name = pElement.tagName.toUpperCase();
							this.filter = [pElement.tagName.toUpperCase(), 'DEFAULT'];
							this.FillList();
						}

						this.pElement = pElement;
						this.OnChange = this.OnChangeElement;
						this.SelectByVal(this.pElement.className);
					}
					else
					{
						this.OnChange = this.OnChangeText;
						if(this.prevType != 'DEFAULT')
						{
							this.prevType = 'DEFAULT';
							this.filter = ['DEFAULT'];
							this.tag_name = '';
							this.FillList();
						}

						this.SelectByVal();
						if(pElement)
						{
							if(BX.browser.IsIE() && pElement.parentElement && (pElement = pElement.parentElement()))
								pElement = pElement.childNodes[0];

							while(pElement = pElement.parentNode)
							{
								if(pElement.nodeType == 1 && pElement.tagName.toUpperCase() == 'TABLE')
									break;
								if(pElement.nodeType == 1 && pElement.className)
								{
									if(pElement.tagName.toUpperCase() != 'SPAN' && pElement.tagName.toUpperCase() != 'FONT')
										break;
									this.SelectByVal(pElement.className);
									break;
								}
							}
						}
					}
				}
			});
		BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.arElements.cssclass.pWnd);

		// B I U S
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropBIU + '</label>'});
		cell = BX.adjust(row.insertCell(-1), {props: {align: 'left'}});
		// Bold
		cell.appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['Bold'][0], arButtons['Bold'][1]).pWnd);
		// Italic
		cell.appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['Italic'][0], arButtons['Italic'][1]).pWnd);
		// Underline
		cell.appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['Underline'][0], arButtons['Underline'][1]).pWnd);
		// Strike
		cell.appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['Strike'][0], arButtons['Strike'][1]).pWnd);

		row = tProp.insertRow(-1);
		// Font
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.Font + ':</label>'});
		BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['FontName'][0], arButtons['FontName'][1]).pWnd);

		// Font size
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.Size + ':</label>'});
		BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['FontSize'][0], arButtons['FontSize'][1]).pWnd);

		row = tProp.insertRow(-1);
		// Font Color
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropColor + '</label>'});
		BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['ForeColor'][0], arButtons['ForeColor'][1]).pWnd);

		// Background Color
		BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label>' + BX_MESS.TPropBG + '</label>'});
		BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(pTaskbar.pMainObj.CreateCustomElement(arButtons['BackColor'][0], arButtons['BackColor'][1]).pWnd);

		arBarHandlersCache['default'] = [tProp, pTaskbar.arElements];
	}
	pTaskbar.pCellProps.appendChild(tProp);
}

function _DOMHandler(oDocument)
{
	var
		ar = oDocument.getElementsByTagName('DIV'),
		pMainObj = oDocument.pMainObj,
		iLen = ar.length, j;

	for (j = 0; j < iLen; j++)
	{
		try {
			if (ar[j].style.pageBreakAfter == 'always')
			{
				var oImg = BX.adjust(oDocument.createElement("IMG"), {props: {src: image_path + "/break_page.gif"}, style: {height: "4px", width: "100%"}});
				pMainObj.SetBxTag(oImg, {tag: "break_page"});
				ar[j].parentNode.insertBefore(oImg, ar[j]);
				ar[j].parentNode.removeChild(ar[j]);
			}
		}catch(e){continue;}
	}
}
oBXEditorUtils.addDOMHandler(_DOMHandler);

function Flash_Reload(oPreviewCont, src, height, width)
{
	var flash_preview = BX("flash_preview_iframe");
	if (flash_preview)
		flash_preview.parentNode.removeChild(flash_preview);
	oPreviewCont.appendChild(BX.create("IFRAME", {props: {id: "flash_preview_iframe", src: flash_preview_path + "?path=" + BX.util.urlencode(src) + "&width=" + width + "px&height=" + height + "px"}, style: {width: "97%", height: "97%"}}));
}

pPropertybarHandlers['flash'] = function (bNew, pTaskbar, pElement)
{
	var tProp, row, cell, r, tProp1, arOpt;

	if(bNew)
	{
		pTaskbar.arElements = [];
		var arBarHandlersCache = pTaskbar.pMainObj.arBarHandlersCache;

		if(arBarHandlersCache['flash'])
		{
			var tProp = arBarHandlersCache['flash'][0];
			pTaskbar.arElements = arBarHandlersCache['flash'][1];
			pTaskbar.prCell = arBarHandlersCache['flash'][2];
		}
		else
		{
			tProp = BX.create('TABLE', {props: {className : "bxtaskbarprops"}});
			row = tProp.insertRow(-1);

			pTaskbar.prCell = BX.adjust(row.insertCell(-1), {props: {className: 'bxed-flash-prop'}});
			tProp1 = row.insertCell(-1).appendChild(BX.create('TABLE'));

			// Path
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_path" class="bxpr-main">' + BX_MESS.PATH2SWF + ':</label>'});
			pTaskbar.arElements.src = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.PATH2SWF, id: "bxp_swf_path", size: '50'}}));

			// Width & Height
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_width" class="bxpr-main">' + BX_MESS.TPropSize + '</label>'});
			var r = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("TABLE", {props: {className: "bx-sp-props-tbl"}})).insertRow(-1);
			var cell1 = r.insertCell(-1);
			pTaskbar.arElements.width = cell1.appendChild(BX.create("INPUT", {props: {size: '5', title: BX_MESS.TPropW, type: 'text', id: "bxp_swf_width"}}));
			cell1.appendChild(BX.create("SPAN", {text : 'x', style: {margin: "0 3px"}}));
			pTaskbar.arElements.height = cell1.appendChild(BX.create("INPUT", {props: {size: '5', title: BX_MESS.TPropH, type: 'text', id: "bxp_swf_height"}}));
			//pTaskbar.arElements.saveProp = r.insertCell(-1).appendChild(BX.create("INPUT", {props: {title: BX_MESS.TPropW, type: 'checkbox', id: "bxp_swf_save_prop"}, style: {marginLeft: "10px"}}));
			//r.insertCell(-1).appendChild(BX.create("LABEL", {text: BX_MESS.SaveProp})).setAttribute("for", "bxp_img_save_prop");

			// Id
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_id">' + BX_MESS.SWF_ID + ':</label>'});
			pTaskbar.arElements.id = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.SWF_ID, id: "bxp_swf_id", size: '50'}}));

			// Title
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_title">' + BX_MESS.SWF_TITLE + ':</label>'});
			pTaskbar.arElements.title = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.SWF_TITLE, id: "bxp_swf_title", size: '50'}}));

			// Class
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_className">' + BX_MESS.SWF_CLASSNAME + ':</label>'});
			pTaskbar.arElements.className = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.SWF_CLASSNAME, id: "bxp_swf_className", size: '50'}}));

			// Style
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_style">' + BX_MESS.TPropStyle + ':</label>'});
			pTaskbar.arElements.style = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("INPUT", {props: {type: 'text', title: BX_MESS.TPropStyle, id: "bxp_swf_style", size: '50'}}));

			// Quality
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_quality">' + BX_MESS.SWF_QUALITY + ':</label>'});
			pTaskbar.arElements.quality = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("SELECT", {props: {title: BX_MESS.SWF_QUALITY, id: "bxp_swf_quality"}}));

			arOpt = [
				['', '- ' + BX_MESS.NoVal + ' -'],
				['low', 'low'],
				['medium', 'medium'],
				['high', 'high'],
				['autolow', 'autolow'],
				['autohigh', 'autohigh'],
				['best', 'best']
			], i, l = arOpt.length;

			for(i = 0; i < l; i++)
				pTaskbar.arElements.quality.options.add(new Option(arOpt[i][1], arOpt[i][0], false, false));

			// WMode
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_wmode">' + BX_MESS.SWF_WMODE + ':</label>'});
			pTaskbar.arElements.wmode = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("SELECT", {props: {title: BX_MESS.SWF_WMODE, id: "bxp_swf_wmode"}}));

			arOpt = [
				['', '- ' + BX_MESS.NoVal + ' -'],
				['window', 'window'],
				['opaque', 'opaque'],
				['transparent', 'transparent']
			], i, l = arOpt.length;

			for(i = 0; i < l; i++)
				pTaskbar.arElements.wmode.options.add(new Option(arOpt[i][1], arOpt[i][0], false, false));

			// Scale
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_scale">' + BX_MESS.SWF_SCALE + ':</label>'});
			pTaskbar.arElements.scale = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("SELECT", {props: {title: BX_MESS.SWF_SCALE, id: "bxp_swf_scale"}}));

			arOpt = [
				['', '- ' + BX_MESS.NoVal + ' -'],
				['showall', 'showall'],
				['noborder', 'noborder'],
				['exactfit', 'exactfit']
			], i, l = arOpt.length;

			for(i = 0; i < l; i++)
				pTaskbar.arElements.scale.options.add(new Option(arOpt[i][1], arOpt[i][0], false, false));

			// Salign
			row = tProp1.insertRow(-1);
			BX.adjust(row.insertCell(-1), {props: {align: 'right'}, html: '<label for="bxp_swf_salign">' + BX_MESS.SWF_SALIGN + ':</label>'});
			pTaskbar.arElements.salign = BX.adjust(row.insertCell(-1), {props: {align: 'left'}}).appendChild(BX.create("SELECT", {props: {title: BX_MESS.SWF_SALIGN, id: "bxp_swf_salign"}}));

			arOpt = [
				['', '- ' + BX_MESS.NoVal + ' -'],
				['left', 'left'],
				['top', 'top'],
				['right', 'right'],
				['bottom', 'bottom'],
				['top left', 'top left'],
				['top right', 'top right'],
				['bottom left', 'bottom left'],
				['bottom right', 'bottom right']
			], i, l = arOpt.length;

			for(i = 0; i < l; i++)
				pTaskbar.arElements.salign.options.add(new Option(arOpt[i][1], arOpt[i][0], false, false));

			// Autoplay
			row = tProp1.insertRow(-1);
			pTaskbar.arElements.autoplay = BX.adjust(row.insertCell(-1), {props: {align: 'right'}}).appendChild(BX.create("INPUT", {props: {type: 'checkbox', title: BX_MESS.SWF_AUTOPLAY, id: "bxp_swf_autoplay"}}));
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}, html: '<label for="bxp_swf_autoplay">' + BX_MESS.SWF_AUTOPLAY + '</label>'});

			// Loop
			row = tProp1.insertRow(-1);
			pTaskbar.arElements.loop = BX.adjust(row.insertCell(-1), {props: {align: 'right'}}).appendChild(BX.create("INPUT", {props: {type: 'checkbox', title: BX_MESS.SWF_LOOP, id: "bxp_swf_loop"}}));
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}, html: '<label for="bxp_swf_loop">' + BX_MESS.SWF_LOOP + '</label>'});

			// Showmenu
			row = tProp1.insertRow(-1);
			pTaskbar.arElements.showmenu = BX.adjust(row.insertCell(-1), {props: {align: 'right'}}).appendChild(BX.create("INPUT", {props: {type: 'checkbox', title: BX_MESS.SWF_SHOW_MENU, id: "bxp_swf_showmenu"}}));
			BX.adjust(row.insertCell(-1), {props: {align: 'left'}, html: '<label for="bxp_swf_showmenu">' + BX_MESS.SWF_SHOW_MENU + '</label>'});

			arBarHandlersCache['flash'] = [tProp, pTaskbar.arElements, pTaskbar.prCell];
		}
		pTaskbar.pCellProps.appendChild(tProp);
	}

	var oTag = pTaskbar.pMainObj.GetBxTag(pElement);
	if (oTag.tag != 'flash' || !oTag.params)
		return;

	var k, i, el;
	for (i in oTag.params)
	{
		k = (i.toLowerCase() == 'class') ? 'className' : i;
		if (!pTaskbar.arElements[k])
			continue

		if (pTaskbar.arElements[k].type.toLowerCase() == 'checkbox' && oTag.params[i])
			pTaskbar.arElements[k].checked = true;
		else
			pTaskbar.arElements[k].value = oTag.params[i];
	}
	pTaskbar.arElements.width.value = (parseInt(pElement.width) || parseInt(pElement.style.width));
	pTaskbar.arElements.height.value = (parseInt(pElement.height) || parseInt(pElement.style.height));

	Flash_Reload(pTaskbar.prCell, oTag.params.src, 250, 250);

	var fChange = function()
	{
		var
			i = this.id.substr('bxp_swf_'.length),
			k = (i.toLowerCase() == 'classname') ? 'class' : i;

		if (pTaskbar.arElements[i].type.toLowerCase() == 'checkbox')
		{
			oTag.params[k] = pTaskbar.arElements[i].checked || null;
		}
		else
		{
			if (k == 'width' || k == 'height')
			{
				pElement.style.width = (parseInt(pTaskbar.arElements.width.value) || 50) + 'px';
				pElement.style.height = (parseInt(pTaskbar.arElements.height.value) || 25) + 'px';
			}
			else if(k == 'src' && pTaskbar.arElements.src.value)
			{
				Flash_Reload(pTaskbar.prCell, pTaskbar.arElements.src.value, 250, 250);
			}
			oTag.params[k] = pTaskbar.arElements[i].value || null;
		}

		pTaskbar.pMainObj.SetBxTag(pElement, oTag);
	};

	for (i in pTaskbar.arElements)
	{
		el = pTaskbar.arElements[i];
		if (el.type.toLowerCase() == 'checkbox')
			el.onclick = fChange;
		else
			el.onchange = fChange;
	}
};

if (!window.lightMode || window._showAllButtons)
{
	oBXEditorUtils.appendButton("page_break", arButtons['page_break'], "standart");
	oBXEditorUtils.appendButton("break_tag", arButtons['break_tag'], "standart");
	oBXEditorUtils.appendButton("insert_flash", arButtons['insert_flash'], "standart");
}

// *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
// Light mode Toolbars:
if (window.lightMode || window._showAllButtons)
{
	var arGlobalToolbar = [

		/* arButtons['Fullscreen'], */
		arButtons['Settings'],
		arButtons['Cut'], arButtons['Copy'], arButtons['Paste'], arButtons['pasteword'], arButtons['pastetext'], arButtons['SelectAll'],
		arButtons['Undo'], arButtons['Redo'],
		arButtons['borders'], 'separator',
		arButtons['table'], arButtons['anchor'], arButtons['CreateLink'], arButtons['deletelink'], arButtons['image'],
		arButtons['SpecialChar'],
		arButtons['insert_flash'],
		arButtons['InsertHorizontalRule'], 'separator',
		arButtons['InsertOrderedList'], arButtons['InsertUnorderedList'], 'separator',
		arButtons['Outdent'], arButtons['Indent'], 'separator',
		arButtons['JustifyLeft'], arButtons['JustifyCenter'], arButtons['JustifyRight'], arButtons['JustifyFull'],

		'new_line',

		arButtons['wysiwyg'],
		arButtons['source'],
		arButtons['split'],
		arButtons['Wrap'],

		arButtons['FontStyle'], arButtons['HeadingList'], arButtons['FontName'], arButtons['FontSize'], 'separator',
		arButtons['Bold'], arButtons['Italic'], arButtons['Underline'], arButtons['Strike'], 'separator',
		arButtons['RemoveFormat'], arButtons['Optimize'], 'separator',
		arButtons['BackColor'], arButtons['ForeColor']
	];
}htmleditor2/table_operations.js000064400000034656150240170740012707 0ustar00BXHTMLEditor.prototype.TableOperation = function (obType, operType, arParams)
{
	try{
		this._OnChange("tableOperation", "");

		switch (obType)
		{
			case 'cell': // CELL
				this.TableOperation_cell(operType, arParams);
				break;
			case 'row': // ROW
				this.TableOperation_row(operType, arParams);
				break;
			case 'column': // COLUMN
				this.TableOperation_column(operType, arParams);
				break;
		}
		if(this.bTableBorder)
		{
			this.bTableBorder = false;
			this.ShowTableBorder(true);
		}

		this._OnChange("tableOperation", "");
	}
	catch(e){_alert('Error: TableOperation: obType = ' + obType, operType);}
};


BXHTMLEditor.prototype.TableOperation_cell = function (operType, arParams)
{
	var pElement = arParams.pElement || this.GetSelectionObject();
	switch (operType)
	{
		case 'insert_before':
		case 'insert_after':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD) return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			var cellInd = oTD.cellIndex;
			if (operType == 'insert_after')
				cellInd++;
			var newCell = oTR.insertCell(cellInd);
			newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
			newCell.rowSpan = oTD.rowSpan;
			return;
		case 'delete':
			var arrCells = this.getSelectedCells();
			var cellLen = arrCells.length;
			if (cellLen == 0)
				break;

			var oTR, oTable = arrCells[0].parentNode.parentNode;
			for(var i = 0; i < cellLen; i++)
			{
				oTR = arrCells[i].parentNode;
				oTR.removeChild(arrCells[i]);
				if (oTR.cells.length == 0)
					oTable.removeChild(oTR);
			}

			if (oTable.rows.length == 0)
				oTable.parentNode.removeChild(oTable);
			return;
		case 'merge':
			var arrCells = this.getSelectedCells();
			var cellLen = arrCells.length;
			if (cellLen < 2)
				break;

			var zeroCellInd = arrCells[0].cellIndex;
			var zeroRowInd = arrCells[0].parentNode.rowIndex;
			var newCellContent = '';

			var arRowSpan = {};
			var arColSpan = {};
			var bVert = false;
			var bHor = false;

			for(var i = cellLen - 1; i >= 0; i--)
			{
				newCellContent += arrCells[i].innerHTML;
				oTR = arrCells[i].parentNode;
				if (i != 0)
				{
					if (oTR.rowIndex != zeroRowInd)
						var bVert = true;
					else
						var bHor = true;
				}

				arRowSpan[oTR.rowIndex] = arrCells[i].rowSpan;
				arColSpan[arrCells[i].cellIndex] = arrCells[i].colSpan;
				oTR.removeChild(arrCells[i]);
			}
			var newCell = oTR.insertCell(zeroCellInd);
			newCell.innerHTML = newCellContent;
			if (bHor)
			{
				var newCellColSpan = 0;
				for (var i in arColSpan)
					newCellColSpan += arColSpan[i];
				if (newCellColSpan > 1)
					newCell.colSpan = newCellColSpan;
			}
			if (bVert)
			{
				var newCellRowSpan = 0;
				for (var i in arRowSpan)
					newCellRowSpan += arRowSpan[i];
				if (newCellRowSpan > 1)
					newCell.rowSpan = newCellRowSpan;
			}
			return;
		case 'mergeright':
			var arrCells = this.getSelectedCells();
			if (arrCells.length != 1)
				break;
			var oTR = arrCells[0].parentNode;
			var rCell = oTR.cells[arrCells[0].cellIndex + 1];
			if (rCell)
			{
				arrCells[0].innerHTML += rCell.innerHTML;
				arrCells[0].colSpan += rCell.colSpan;
				oTR.removeChild(rCell);
			}
			return;
		case 'mergebottom':
			var arrCells = this.getSelectedCells();
			if (arrCells.length != 1)
				break;
			var oTR = arrCells[0].parentNode;
			var realInd = 0;
			for(var i = 0; i <= arrCells[0].cellIndex; i++)
				realInd += oTR.cells[i].colSpan;

			var
				newRealInd = 0,
				newTRInd = oTR.rowIndex + arrCells[0].rowSpan,
				newTR = oTR.parentNode.rows[newTRInd];

			i = 0;
			while (newRealInd < realInd && i < newTR.cells.length)
				newRealInd += newTR.cells[i++].colSpan;
			var newCell = newTR.cells[--i];
			arrCells[0].innerHTML += newCell.innerHTML;
			arrCells[0].rowSpan += newCell.rowSpan;
			newTR.removeChild(newCell);
			return;
		case 'splithorizontally':
			var arrCells = this.getSelectedCells();
			if (arrCells.length != 1)
				break;

			var oTR = arrCells[0].parentNode;
			var oTable = oTR.parentNode;
			var realInd = 0;
			for(var i = 0; i <= arrCells[0].cellIndex; i++)
				realInd += oTR.cells[i].colSpan;

			var colSpan = arrCells[0].colSpan;
			if (colSpan > 1)
			{
				arrCells[0].colSpan--;
			}
			else
			{
				for(var j = 0; j < oTable.rows.length; j++)
				{
					if (j == oTR.rowIndex)
						continue;
					var newRealInd = 0;
					var newTR = oTable.rows[j];

					i = 0;
					while (newRealInd < realInd && i < newTR.cells.length)
						newRealInd += newTR.cells[i++].colSpan;

					var newCell = newTR.cells[--i];
					newCell.colSpan += 1;
				}
			}
			var newCell = oTR.insertCell(arrCells[0].cellIndex + 1);
			newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
			newCell.rowSpan = arrCells[0].rowSpan;
			return;
		case 'splitvertically':
			var arrCells = this.getSelectedCells();
			if (arrCells.length != 1)
				break;

			var oTR = arrCells[0].parentNode;
			var oTable = oTR.parentNode;

			var arTMX = this.CreateTableMatrix(oTable);
			var arInd = this.GetIndexes(arrCells[0], arTMX);
			var maxCellCount = arTMX[0].length; //max count of cell in table

			var curRowIndex = oTR.rowIndex;
			var curCellIndex = arrCells[0].cellIndex;
			var arIndLen = arInd.length;

			var curFullRowInd = arInd[0].r;
			var curFullCellInd = arInd[0].c;
			var bOneW = true;
			var bOneH = true;

			for(var i = 1; i < arIndLen; i++)
			{
				if (arInd[i].r != curFullRowInd)
					bOneH = false;
				if (arInd[i].c != curFullCellInd)
					bOneW = false;
			}

			if (!bOneH) // If cell has rowspan > 1
			{
				var _tr = oTable.rows[curRowIndex + --arrCells[0].rowSpan];
				var _arInd, rci, realCellInd = false;
				r:
				for(var c = 0; c < _tr.cells.length; c++)
				{
					_arInd = this.GetIndexes(_tr.cells[c], arTMX);
					for(var i = 0, _arIndLen = _arInd.length; i < _arIndLen; i++)
					{
						rci = _arInd[i].c;
						if (rci > curCellIndex)
							realCellInd = 0;
						else if (rci + 1 == curCellIndex)
							realCellInd = _tr.cells[c].cellIndex + 1;

						if (realCellInd !== false)
							break r;
					}
				}

				_ftd = _tr.cells[0];
				var _td = _tr.insertCell(realCellInd);
				_td.innerHTML = '<br _moz_editor_bogus_node="on">';
				if (!bOneW)
					_td.colSpan = arrCells[0].colSpan;
			}
			else // if rowSpan == 1 and we have to split this cell
			{
				var newRow = oTable.insertRow(oTR.rowIndex + 1);
				var newCell = newRow.insertCell(-1);
				newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
				if (!bOneW)
					newCell.colSpan = arrCells[0].colSpan;

				var oRow, oCell;
				var cellCount = 0;
				for(var r = 0; r <= curFullRowInd; r++)
				{
					oRow = oTable.rows[r];
					for(var c = 0; c < oRow.cells.length; c++)
					{
						oCell = oRow.cells[c];
						if (r == curRowIndex && c == curCellIndex)
							continue;

						var fullRowInd = r; // oRow.rowIndex
						if (oCell.rowSpan > 1)
							fullRowInd += oCell.rowSpan - 1;

						if (fullRowInd >= curFullRowInd)
							oCell.rowSpan++;
					}
				}
			}
			return;
	}
};

BXHTMLEditor.prototype.TableOperation_row = function(operType, arParams)
{
	var pElement = arParams.pElement || this.GetSelectionObject();
	switch (operType)
	{
		case 'insertbefore':
		case 'insertafter':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			var rowInd = oTR.rowIndex;
			if (operType == 'insertafter')
				rowInd++;

			var newRow = oTable.insertRow(rowInd);
			var cellsCount = oTR.cells.length;

			for(var i = 0; i < cellsCount; i++)
			{
				var newCell = newRow.insertCell(i);
				newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
				newCell.colSpan = oTR.cells[i].colSpan;
			}
			return;
		case 'mergecells':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var cellsCount = oTR.cells.length;
			if (cellsCount < 2)
				return;
			var zeroColSpan = oTR.cells[0].colSpan;
			var zeroInnerHTML = oTR.cells[0].innerHTML;
			for(var i = 1; i < cellsCount; i++)
			{
				zeroColSpan += oTR.cells[1].colSpan;
				zeroInnerHTML += oTR.cells[1].innerHTML;
				oTR.removeChild(oTR.cells[1]);
			}
			oTR.cells[0].innerHTML = zeroInnerHTML;
			oTR.cells[0].colSpan = zeroColSpan;
			return;
		case 'delete':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			oTable.removeChild(oTR);
			if (oTable.rows.length == 0)
				oTable.parentNode.removeChild(oTable);
			return;
	}
};

BXHTMLEditor.prototype.TableOperation_column = function(operType, arParams)
{
	var pElement = arParams.pElement || this.GetSelectionObject();
	switch (operType)
	{
		case 'insertleft':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD) return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			var cellInd = oTD.cellIndex;
			var rowInd = oTR.rowIndex;

			var arTMX = this.CreateTableMatrix(oTable);
			var arInd = this.GetIndexes(oTD, arTMX);

			var newCell = oTR.insertCell(cellInd);
			newCell.innerHTML = '<br _moz_editor_bogus_node="on">';

			var curCellIndex = oTD.cellIndex;
			var arIndLen = arInd.length;
			var curFullCellInd = arInd[0].c;

			var r, ind, i, c;
			for (var j = 0, l1 = oTable.rows.length; j < l1; j++)
			{
				r = oTable.rows[j];
				if (r.rowIndex == rowInd)
					continue;

				ind = 0;
				if (curFullCellInd != 0)
				{
					i = 0;
					for(var i=0, l2 = r.cells.length; i < l2; i++)
					{
						c = r.cells[i];
						arInd = this.GetIndexes(c, arTMX);
						if (arInd[0].c >= curFullCellInd)
						{
							ind = c.cellIndex;
							break;
						}
						ind = i + 1;
					}
				}

				var newCell = r.insertCell(ind);
				newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
			}
			return;
		case 'insertright':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			var cellInd = oTD.cellIndex;
			var rowInd = oTR.rowIndex;

			var arTMX = this.CreateTableMatrix(oTable);
			var arInd = this.GetIndexes(oTD, arTMX);
			var newCell = oTR.insertCell(cellInd + 1);
			newCell.innerHTML = '<br _moz_editor_bogus_node="on">';

			var curCellIndex = oTD.cellIndex;
			var arIndLen = arInd.length;
			var curFullCellInd = arInd[0].c;

			var r, ind, i, c;
			for (var j = 0, l1 = oTable.rows.length; j < l1; j++)
			{
				r = oTable.rows[j];
				if (r.rowIndex == rowInd)
					continue;

				ind = 0;
				i = 0;
				for(var i=0, l2 = r.cells.length; i < l2; i++)
				{
					c = r.cells[i];
					arInd = this.GetIndexes(c, arTMX);
					if (arInd[0].c >= curFullCellInd + 1)
					{
						ind = c.cellIndex;
						break;
					}
					ind = i + 1;
				}
				var newCell = r.insertCell(ind);
				newCell.innerHTML = '<br _moz_editor_bogus_node="on">';
			}
			return;
		case 'mergecells':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;

			var arTMX = this.CreateTableMatrix(oTable);
			var arInd = this.GetIndexes(oTD, arTMX);

			var zeroCell = arTMX[0][arInd[0].c];
			var _innerHTML = zeroCell.innerHTML;
			var c;
			for (var j = 1, l = arTMX.length; j < l; j++)
			{
				c = arTMX[j][arInd[0].c];
				_innerHTML += c.innerHTML;
				c.parentNode.removeChild(c);
			}
			zeroCell.rowSpan = arTMX.length;
			zeroCell.innerHTML = _innerHTML;
			return;
		case 'delete':
			var oTD = BXFindParentByTagName(pElement, 'TD');
			if (!oTD)
				return;
			var oTR = oTD.parentNode;
			var oTable = oTR.parentNode;
			var arTMX = this.CreateTableMatrix(oTable);
			var arInd = this.GetIndexes(oTD, arTMX);

			var c, r;
			for (var j = 0, l = arTMX.length; j < l; j++)
			{
				c = arTMX[j][arInd[0].c];
				if (!c) continue;
				r = c.parentNode;
				if (!r) continue;
				_innerHTML += c.innerHTML;
				r.removeChild(c);
				if (r.cells.length == 0)
					oTable.removeChild(r);
			}

			if (oTable.rows.length == 0)
				oTable.parentNode.removeChild(oTable);
			return;
	}
};

//r- row; i-index;
BXHTMLEditor.prototype.CreateTableMatrix = function(oTable)
{
	var aRows = oTable.rows;
	// Row and Column counters.
	var r = -1;

	var arMatrix = new Array();

	for (var i = 0; i < aRows.length; i++)
	{
		r++;
		if (!arMatrix[r])
			arMatrix[r] = [];

		var c = -1;

		for (var j = 0; j < aRows[i].cells.length; j++)
		{
			var oCell = aRows[i].cells[j];

			c++;
			while (arMatrix[r][c])
				c++;

			var iColSpan = isNaN(oCell.colSpan) ? 1 : oCell.colSpan;
			var iRowSpan = isNaN(oCell.rowSpan) ? 1 : oCell.rowSpan;

			for(var rs = 0; rs < iRowSpan; rs++)
			{
				if (!arMatrix[r + rs])
					arMatrix[r + rs] = [];

				for (var cs = 0; cs < iColSpan; cs++)
					arMatrix[r + rs][c + cs] = aRows[i].cells[j];
			}

			c += iColSpan - 1;
		}
	}
	return arMatrix;
};

BXHTMLEditor.prototype.GetIndexes  = function(oCell, arMatrix)
{
	var arR, arC, arIndexes = [];
	for (var i = 0; i < arMatrix.length; i++)
		for (var j = 0, l = arMatrix[i].length; j < l; j++)
			if (arMatrix[i][j] == oCell)
				arIndexes.push({'r' : i, 'c' : j});
	return arIndexes;
};

//Return array of cells, which/( of which) was selected
BXHTMLEditor.prototype.getSelectedCells = function()
{
	var arrCells = [];

	if (BX.browser.IsIE())
	{
		// IE
		var oParent, oRange = this.pEditorDocument.selection.createRange();
		var oParent = BXFindParentByTagName(this.GetSelectionObject(), 'TR');
		if (oParent)
		{
			// Loops throw all cells checking if the cell is, or part of it, is inside the selection
			// and then add it to the selected cells collection.
			for( var i = 0; i < oParent.cells.length; i++ )
			{
				var oCellRange = this.pEditorDocument.selection.createRange();
				oCellRange.moveToElementText(oParent.cells[i]);

				if (oRange.inRange(oCellRange) ||
					(oRange.compareEndPoints('StartToStart', oCellRange) >= 0 &&  oRange.compareEndPoints('StartToEnd',oCellRange) <= 0) ||
					(oRange.compareEndPoints('EndToStart', oCellRange) >= 0 &&  oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ))
					arrCells.push(oParent.cells[i]);
			}
		}
	}
	else
	{
		//Gecko, Opera
		var oSelection = this.pEditorWindow.getSelection();
		if (oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
		{
			var c = BXFindParentByTagName(oSelection.anchorNode, 'TD');
			if (c)
				return [c];
		}
		for(var i = 0, l = oSelection.rangeCount; i < l; i++)
		{
			var oRange = oSelection.getRangeAt(i);
			if (oRange.startContainer.nodeName == 'TD' || oRange.startContainer.nodeName == 'TH')
				arrCells.push(oRange.startContainer);
			else if(oRange.startContainer.nodeName=='TR')
				arrCells.push(oRange.startContainer.childNodes[oRange.startOffset]);
		}
	}
	return arrCells;
};htmleditor2/controls.js000064400000121172150240170740011206 0ustar00//Colors of borders and backgrounds for diferent button states
var borderColorNormal = "#e4e2dc";
var borderColorOver = "#4B4B6F";
var borderColorSet = "#4B4B6F";
var borderColorSetOver = "#4B4B6F";

var bgroundColorOver = "#FFC678";
var bgroundColorSet = "#FFC678";
var bgroundColorSetOver = "#FFA658";

// BXButton - class
function BXButton()
{
	this._prevDisabledState = false;
}

BXButton.prototype = {
_Create: function ()
{
	if(this.OnCreate && this.OnCreate()==false)
		return false;

	var obj = this;

	if (this.id && this.iconkit)
	{
		this.pWnd = this.CreateElement("IMG", {src: one_gif_src, alt: (this.title ? this.title : this.name), title: (this.title?this.title:this.name), width: '20', height: '20', id: "bx_btn_"+obj.id});
		this.pWnd.className = 'bxedtbutton';
		this.pWnd.style.backgroundImage = "url(" + image_path + "/" + this.iconkit + ")";
	}
	else
	{
		this.pWnd = this.CreateElement("IMG", {'src' : this.src, 'alt' : (this.title ? this.title : this.name), 'title': (this.title ? this.title : this.name), 'width' : '20', 'height' : '20'});
		this.pWnd.className = 'bxedtbutton';
	}

	if (this.show_name)
	{
		var _icon = this.pWnd;
		this.pWnd = BX.create("TABLE", {props: {className: "bxedtbuttonex", title: this.title ? this.title: this.name, id: "bx_btnex_" + obj.id}});

		this.pWnd.checked = false;
		this.pWnd.disabled = false;

		var r = this.pWnd.insertRow(-1);
		r.insertCell(-1).appendChild(_icon);
		BX.adjust(r.insertCell(-1), {props: {className: 'tdbutex_txt'}, html: "<div>" + this.name + "</div>"});
	}
	else
	{
		this.pWnd.style.borderColor  = borderColorNormal;
		this.pWnd.style.borderWidth = "1px";
		this.pWnd.style.borderStyle = "solid";
	}

	if(!this.no_actions || this.no_actions != true) // for context menu
	{
		this.pWnd.onmouseover = function(e)
		{
			if(!this.disabled)
			{
				if (this.nodeName.toLowerCase() == 'table')
				{
					BX.addClass(this, 'bxedtbuttonex-over');
					if (BX.browser.IsOpera())
						this.border = "1px solid #4B4B6F"; // Special for Opera
				}
				else
				{
					this.style.borderColor = borderColorOver;
					this.style.border = "#4B4B6F 1px solid";
					this.style.backgroundColor = this.checked ? bgroundColorSetOver : bgroundColorOver;
				}
			}
		};

		this.pWnd.onmouseout = function(e)
		{
			if(!this.disabled)
			{
				if (this.nodeName.toLowerCase() == 'table')
				{
					BX.removeClass(this, 'bxedtbuttonex-over');
					if (BX.browser.IsOpera())
						this.border = "1px solid #E4E2DC"; // Special for Opera
				}
				else
				{
					this.style.borderColor = this.checked ? borderColorSet : borderColorNormal;
					this.style.backgroundColor = this.checked ? bgroundColorSet : 'transparent';
				}
			}
		};
		if (this.defaultState)
			this.Check(true);

		addCustomElementEvent(this.pWnd, 'click', this.OnClick, this);
		this.pMainObj.AddEventHandler("OnSelectionChange", this._OnSelectionChange, this);
		this.pMainObj.AddEventHandler("OnChangeView", this.OnChangeView, this);
	}
},

_OnChangeView: function (mode, split_mode)
{
	mode = (mode == 'split' ? split_mode : mode);
	if(mode == 'code' && !this.codeEditorMode || (mode=='html' && this.hideInHtmlEditorMode))
	{
		this._prevDisabledState = this.pWnd.disabled;
		this.Disable(true);
	}
	else if(mode == 'code' && this.codeEditorMode || (this.hideInHtmlEditorMode && mode != 'html'))
		this.Disable(false);
	else if(!this.codeEditorMode)
		this.Disable(this._prevDisabledState);
},

OnChangeView: function (mode, split_mode)
{
	this._OnChangeView(mode, split_mode);
},

Disable: function (bFlag)
{
	if(bFlag == this.pWnd.disabled)
		return false;
	this.pWnd.disabled = bFlag;
	if(bFlag)
	{
		BX.addClass(this.pWnd, 'bxedtbutton-disabled');
		if (this.id && this.iconkit)
		{
			//this.pWnd.className = 'bxedtbuttondisabled';
			//this.pWnd.style.backgroundImage = "url(" + image_path + "/" + this.iconkit + ")";
		}
		else
		{
			//this.pWnd.className = 'bxedtbuttondisabled';
		}
		//this.pWnd.style.filter = 'gray() alpha(opacity=30)';
	}
	else
	{
		BX.removeClass(this.pWnd, 'bxedtbutton-disabled');
		//this.pWnd.style.filter = '';
		//this.pWnd.className = 'bxedtbutton';
		if(this.pWnd.checked)
		{
			this.pWnd.style.borderColor = borderColorSet;
			this.pWnd.style.backgroundColor = bgroundColorSet;
		}
		else
		{
			this.pWnd.style.backgroundColor ="";
			this.pWnd.style.borderColor = borderColorNormal;
		}
	}
},

Check: function (bFlag)
{
	if(bFlag == this.pWnd.checked)
		return false;
	this.pWnd.checked = bFlag;
	if(!this.pWnd.disabled)
	{
		if(this.pWnd.checked)
		{
			this.pWnd.style.borderColor = borderColorSet;
			this.pWnd.style.backgroundColor = bgroundColorSet;
		}
		else
		{
			this.pWnd.style.backgroundColor ="";
			this.pWnd.style.borderColor = borderColorNormal;
		}
	}
},

OnMouseOver: function (e)
{
	if(!this.disabled)
	{
		this.style.borderColor = borderColorOver;
		this.style.border = "#4B4B6F 1px solid";
		if(this.checked)
			this.style.backgroundColor = bgroundColorSetOver;
		else
			this.style.backgroundColor = bgroundColorOver;
	}
},

OnMouseOut: function (e)
{
	if(!this.disabled)
	{
		if(this.checked)
		{
			this.style.borderColor = borderColorSet;
			this.style.backgroundColor = bgroundColorSet;
		}
		else
		{
			this.style.backgroundColor ="";
			this.style.borderColor = borderColorNormal;
		}
	}
},

OnClick: function (e)
{
	if(this.pWnd.disabled) return false;
	this.pMainObj.SetFocus();
	var res = false;
	if(this.handler)
		if(this.handler(this.pMainObj) !== false)
			res = true;

	if(!res)
		res = this.pMainObj.executeCommand(this.cmd);

	if(!this.bNotFocus)
		this.pMainObj.SetFocus();

	return res;
},

_OnSelectionChange: function()
{
	if(this.OnSelectionChange)
		this.OnSelectionChange();
	else if(this.cmd)
	{
		var res;

		if(this.cmd=='Unlink' && !BXFindParentByTagName(this.pMainObj.GetSelectionObject(), 'A'))
			res = 'DISABLED';
		else
			res = this.pMainObj.queryCommandState(this.cmd);

		if(res == 'DISABLED')
			this.Disable(true);
		else if(res == 'CHECKED')
		{
			this.Disable(false);
			this.Check(true);
		}
		else
		{
			this.Disable(false);
			this.Check(false);
		}
	}
}
};

function BXButtonSeparator(){}
BXButtonSeparator.prototype._Create = function ()
{
	this.pWnd = this.CreateElement("DIV", {className: 'bxseparator'});
	this.OnToolbarChangeDirection = function(bVertical)
	{
		if(bVertical)
			BX.addClass(this.pWnd, 'bxseparator-ver');
		else
			BX.removeClass(this.pWnd, 'bxseparator-ver');
	};
}

// BXEdList - class
function BXEdList()
{
	this.iSelectedIndex = -1;
	this.disabled = false;
	this.bCreated = false;
	this.bOpened = false;
	this.zIndex = 2090;

	this.CSS = "div.bx-list-cont {background-color: #fff; display: none; overflow: auto; overflow-x: hidden; overflow-y: auto; text-overflow: ellipsis;}" +
"div.bx-list-cont-vis-ef{overflow: hidden!important;}" +
"div.bx-list-cont table.bx-list-popup-tbl{width: 100%!important; border-collapse: collapse !important;}" +
"div.bx-list-cont table.bx-list-popup-tbl td{padding: 0!important;}" +
"div.bx-list-cont .bx-list-item{background: #fff; padding: 0px !important; border: 1px solid #fff; padding: 3px 4px !important; margin: 1px 0!important; cursor: default!important; font-family: Verdana,Tahoma,Courier New !important;}" +
"div.bx-list-cont .bx-list-item-over{border: 1px solid #4B4B6F; background-color: #FFC678 !important;}" +
"div.bx-list-cont .bx-list-item *{padding: 0!important; margin: 0!important; font-family: Verdana,Tahoma,Courier New !important;}" +
"div.bx-list-cont table.bx-list-item{border-collapse: collapse!important; width:100%!important; padding: 0!important;}" +
"div.bx-list-cont table.bx-list-item td{padding: 3px 4px !important;}" +
"div.bx-list-cont a.bx-list-conf-link{display: block!important; font-size: 11px!important; margin: 5px!important; color: #000!important; cursor: pointer!important;}" +
"div.bx-list-cont  td.bx-list-conf-cell{background: #FFF!important; border-top: 2px solid #808080!important;}" +
"div.bx-list-cont  td.bx-list-conf-cell a{color: #000!important; font-weight: normal!important; text-decoration: underline!important; font-size: 14px!important; cursor: pointer!important; display: block!important; margin: 5px 10px;}";
}

BXEdList.prototype = {
_Create: function ()
{
	if(this.OnCreate && this.OnCreate()==false)
		return false;

	if (this.maxHeight)
		this.maxHeight = parseInt(this.maxHeight);

	this.width = parseInt(this.width) || 160;
	this.height = parseInt(this.height) || 250;
	this.field_size = parseInt(this.field_size) || 75;

	if(this.OnSelectionChange)
		this.pMainObj.AddEventHandler("OnSelectionChange", this.OnSelectionChange, this);

	if(this.disableOnCodeView)
		this.pMainObj.AddEventHandler("OnChangeView", this.OnChangeView, this);

	this.pWnd = BX.create("DIV", {props: {className: 'bx-list'}});

	if (BX.browser.IsIE() && !BX.browser.IsDoctype())
		this.pWnd.style.height = "20px";

	this.pWnd.appendChild(BX.create("IMG", {props: {src: one_gif_src, className: 'bx-list-over'}}));

	var
		pTable = this.pWnd.appendChild(BX.create("TABLE")),
		r = pTable.insertRow(-1);

	if (this.field_size)
		this.pWnd.style.width = pTable.style.width = this.field_size + "px";

	this.pTitleCell = r.insertCell(-1);
	this.pTitle = this.pTitleCell.appendChild(BX.create("DIV", {props: {className: "bx-listtitle", unselectable: "on"}, text: this.title || "", style: {width: (this.field_size - 24) + "px"}}));

	BX.adjust(r.insertCell(-1), {props: {className: 'bx-listbutton', unselectable: "on"}, html: '&nbsp;'});
	this.pWnd.onmouseover = BX.proxy(this.OnMouseOver, this);
	this.pWnd.onmouseout = BX.proxy(this.OnMouseOut, this);
	this.pWnd.onclick = BX.proxy(this.OnClick, this);

	this.Create();

	if (this.values)
		this.SetValues(this.values);

	if(this._OnInit && typeof this._OnInit == 'function')
		this._OnInit();

	if(this.OnInit && this.OnInit() == false)
		return false;

	return true;
},

Create: function ()
{
	if (!BXPopupWindow.bCreated)
		BXPopupWindow.Create();

	this.pPopupNode = BXPopupWindow.pDocument.body.appendChild(BX.create("DIV", {props: {className: "bx-list-cont"}, style: {zIndex: this.zIndex}}, BXPopupWindow.pDocument));

	this.bCreated = true;
	this.pPopupNode.style.width = this.width + "px";
	this.pPopupNode.style.height = this.height + "px";

	this.pDropDownList = this.pPopupNode.appendChild(BX.create("TABLE", {props: {className: "bx-list-popup-tbl", unselectable: 'on'}}, BXPopupWindow.pDocument));
},

OnClick: function (e)
{
	if(this.disabled)
		return false;

	if (this.bOpened)
		return this.Close();

	this.Open();
	this.ShowPopup(true);
},

ShowPopup: function(bOpen)
{
	var pFrame = BXPopupWindow.pFrame;
	if (bOpen)
	{
		pFrame.height = "1px";
		pFrame.width = this.field_size + "px";
	}

	var
		_this = this,
		curHeight = bOpen ? 1 : parseInt(pFrame.height),
		curWidth = bOpen ? this.field_size : parseInt(pFrame.width),
		count = 0,
		timeInt = BX.browser.IsIE() ? 1 : 8,
		maxHeight = 0,
		maxWidth = this.width,
		dx = 20,
		dy = BX.browser.IsIE() ? 20 : 10;

	if (this.Interval)
		clearInterval(this.Interval);

	BX.addClass(_this.pPopupNode, "bx-list-cont-vis-ef");

	this.Interval = setInterval(function()
		{
			if (bOpen)
			{
				if (maxHeight == 0)
				{
					maxHeight = parseInt(_this.pDropDownList.offsetHeight);
					if (_this.maxHeight && maxHeight >= _this.maxHeight)
						maxHeight = _this.maxHeight;
				}

				curHeight += Math.round(dy * count);
				curWidth += Math.round(dx * count);

				if (curWidth > maxWidth)
					curWidth = maxWidth;

				if (curHeight > maxHeight)
				{
					BX.removeClass(_this.pPopupNode, "bx-list-cont-vis-ef");
					clearInterval(_this.Interval);

					if (BX.browser.IsIE())
						_this.pDropDownList.style.width = (parseInt(_this.pDropDownList.offsetWidth) - 2) + "px";

					curHeight = parseInt(_this.pDropDownList.offsetHeight);
					if (_this.maxHeight && curHeight >= _this.maxHeight)
						curHeight = _this.maxHeight;
				}
			}
			else
			{
				curHeight -= Math.round(dy * count);
				curWidth -= Math.round(dx * count);
				if (curWidth < _this.field_size)
					curWidth = _this.field_size;

				if (curHeight < 0)
				{
					BX.removeClass(_this.pPopupNode, "bx-list-cont-vis-ef");
					_this._Close();
					curHeight = 0;
					clearInterval(_this.Interval);
				}
			}

			pFrame.width = _this.pPopupNode.style.width = curWidth + 'px';
			pFrame.height = _this.pPopupNode.style.height = curHeight + 'px';
			count++;
		},
		timeInt
	);
},

Open: function ()
{
	var
		pOverlay = this.pMainObj.oTransOverlay.Show(),
		pos = BX.pos(this.pWnd),
		_this = this;

	BX.bind(document, "keyup", BX.proxy(this.OnKey, this));
	BX.bind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));

	oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
	pOverlay.onclick = function(){_this.Close()};

	if(this.bSetGlobalStyles)
		BXPopupWindow.SetStyles(this.CSS);
	else
		BXPopupWindow.SetStyles(this.CSS + "\n\n" + this.pMainObj.oStyles.sStyles, false);

	BXPopupWindow.Show({
		top: pos.top + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? 17 : 19),
		left: pos.left + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? -2 : 0),
		node: this.pPopupNode,
		width: this.width,
		height: this.height
	});
	this.bOpened = true;
},

Close: function ()
{
	this.ShowPopup(false);
},

_Close: function ()
{
	BXPopupWindow.Hide();
	this.pPopupNode.style.display = 'none';
	this.pMainObj.oTransOverlay.Hide();

	BX.unbind(document, "keyup", BX.proxy(this.OnKey, this));
	BX.unbind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));
	this.bOpened = false;
},

OnKey: function (e)
{
	if(!e)
		e = window.event;
	if(e.keyCode == 27 && this.bOpened)
		this.Close();
},

SetValues: function (values)
{
	if (typeof values == 'object')
		this.values = values;

	BX.cleanNode(this.pDropDownList);

	var c, item, _this = this, i, l = this.values.length;
	for(i = 0; i < l; i++)
	{
		this.values[i].index = i;
		c = this.pDropDownList.insertRow(-1).insertCell(-1);
		item = c.appendChild(BX.create("DIV", {props: {className: "bx-list-item", title: this.values[i].name}}, BXPopupWindow.pDocument));
		item.innerHTML = this.OnDrawItem ? this.OnDrawItem(this.values[i]) : this.values[i].name;
		item.value = this.values[i];
		if(this.bSetFontSize)
			item.style.fontSize = "12px";

		item.onmouseover = function (e){BX.addClass(this, "bx-list-item-over");};
		item.onmouseout = function (e){BX.removeClass(this, "bx-list-item-over");};
		item.onclick = function ()
		{
			if (oPrevRange)
				BXSelectRange(oPrevRange, _this.pMainObj.pEditorDocument, _this.pMainObj.pEditorWindow);
			_this.Close();
			_this._OnChange(this.value);
			_this.FireChangeEvent();
		};
	}

	if (this.bAdminConfigure && false)
	{
		c = this.pDropDownList.insertRow(-1).insertCell(-1);
		c.className = "bx-list-conf-cell";
		var pConf = c.appendChild(BX.create("A", {props: {className: "bx-list-conf-link", title: BX_MESS.ListConfigTitle, href: "javascript:void(0);"}, text: BX_MESS.ListConfig}, BXPopupWindow.pDocument));
		pConf.onclick = function()
		{
			_this.Close();
		}
	}
},

_OnChangeView: function (mode, split_mode)
{
	mode = (mode=='split'?split_mode:mode);
	this.Disable(mode=='code');
},

OnChangeView: function (mode, split_mode)
{
	this._OnChangeView(mode, split_mode);
},

Disable: function(flag)
{
	if(this.disabled == flag)
		return false;
	this.disabled = flag;

	if(flag)
		BX.addClass(this.pWnd, "bx-list-disabled");
	else
		BX.removeClass(this.pWnd, "bx-list-disabled");
},

FireChangeEvent: function()
{
	if(this.OnChange)
		this.OnChange(this.arSelected);
},

_OnChange: function (selected)
{
	this.Select(selected["index"]);
},

SetValue: function(val)
{
	if(!this.pTitle)
		return;

	this.pTitle.innerHTML = val || this.title || '';
},

OnMouseOver: function(e)
{
	if(!this.disabled)
		BX.addClass(this.pWnd, "bx-list-over");
},

OnMouseOut: function(e)
{
	if(!this.disabled)
		BX.removeClass(this.pWnd, "bx-list-over");
},

Select: function(v)
{
	if(this.iSelectedIndex == v || v >= this.values.length)
		return;

	var sel = this.values[v];
	this.iSelectedIndex = v;
	this.arSelected = sel;
	this.SetValue(sel["name"]);
},

SelectByVal: function(val, bAddIfNotList)
{
	if(val)
	{
		var i, l = this.values.length;
		for(i = 0; i < l; i++)
		{
			if(this.values[i].value == val)
				return this.Select(i);
		}

		if (bAddIfNotList)
		{
			var ind = this.values.length;
			this.values.push({name: val, value: val});
			this.SetValues(this.values);
			if (this.CreateListRow)
				this.additionalClass = val;
			return this.Select(ind);
		}
	}
	else
	{
		this.SetValue(this.title || '');
		this.iSelectedIndex = -1;
	}
},

OnToolbarChangeDirection: function (bVertical)
{
	if(bVertical)
	{
		this.pWnd.style.width = "18px";
		this.pTitleCell.style.visibility = "hidden";
	}
	else
	{
		this.pWnd.style.width = this.field_size;
		this.pTitleCell.style.visibility = "inherit";
	}
	//this.pWnd.className = 'bx-list';
}
};

// BXStyleList - class
function BXStyleList(){}
BXStyleList.prototype = new BXEdList;

BXStyleList.prototype._OnInit = function()
{
	this.pMainObj.AddEventHandler("OnTemplateChanged", this.FillList, this);
	this.FillList();
}

BXStyleList.prototype.FillList = function()
{
	var i, j, arStyles, l;

	BX.cleanNode(this.pDropDownList);

	if(!this.filter)
		this._SetFilter();

	this.values = [];
	if(!this.tag_name)
		this.tag_name = '';

	//"clear style" item
	this.CreateListRow('', BX_MESS.DeleteStyleOpt, {value: '', name: BX_MESS.DeleteStyleOptTitle});

	var
		style_title, counter = 0,
		arStyleTitle = this.pMainObj.arTemplateParams["STYLES_TITLE"];

	// other styles
	for(i = 0, l = this.filter.length; i < l;  i++)
	{
		arStyles = this.pMainObj.oStyles.GetStyles(this.filter[i]);
		for(j = 0; j < arStyles.length; j++)
		{
			if(arStyles[j].className == '')
				continue;

			if(this.pMainObj.arTemplateParams && arStyleTitle && arStyleTitle[arStyles[j].className])
				style_title = arStyleTitle[arStyles[j].className] ;
			else if(!this.pMainObj.arConfig["bUseOnlyDefinedStyles"])
			 	style_title = arStyles[j].className;
			else
			 	continue;

			this.CreateListRow(arStyles[j].className, style_title, {value: arStyles[j].className, name: style_title});
			counter++;
		}
	}

	if (this.additionalClass)
		this.CreateListRow(this.additionalClass, this.additionalClass, {value: this.additionalClass, name: this.additionalClass});

	if (this.deleteIfNoItems)
		this.pWnd.style.display = (counter == 0) ? "none" : "block";
};

BXStyleList.prototype.CreateListRow = function(className, name, value)
{
	value.index = this.values.length;

	var
		_this = this,
		c = this.pDropDownList.insertRow(-1).insertCell(-1),
		itemTable = c.appendChild(BX.create("TABLE", {props: {className: "bx-list-item", title: name, unselectable: "on"}}, BXPopupWindow.pDocument)),
		itemRow = itemTable.insertRow(-1),
		itemCell = itemRow.insertCell(-1);

	itemCell.innerHTML = name;
	if(this.bSetFontSize)
		itemCell.style.fontSize = "12px";

	if (this.pMainObj.bRenderStyleList)
	{
		switch(this.tag_name.toUpperCase())
		{
			case "TD":
				itemCell.className = className;
				break;
			case "TABLE":
				itemTable.className = className;
				break;
			case "TR":
				itemRow.className = className;
				break;
			default:
				itemCell.innerHTML = '<span class="' + className + '">'+name+'</span>';
		}
	}

	itemTable.value = value;
	itemTable.onmouseover = function (e){BX.addClass(this, "bx-list-item-over");};
	itemTable.onmouseout = function (e){BX.removeClass(this, "bx-list-item-over");};
	itemTable.onclick = function (e)
	{
		_this.Close();
		_this._OnChange(this.value);
		_this.FireChangeEvent();

		if(this.value.value=='')
			_this.SelectByVal();
	};

	this.values.push(value);
};

BXStyleList.prototype.OnChange = function(arSelected)
{
	this.pMainObj.WrapSelectionWith("SPAN", {props: {className: arSelected["value"]}});
};

BXStyleList.prototype._SetFilter = function()
{
	this.filter = ["DEFAULT"];
};

BXStyleList.prototype.OptimizeSelection = function(params)
{
	var
		arNodes = params.nodes,
		node, i, l = arNodes.length;


	for(i = 0; i < l; i++)
	{
		node = arNodes[i];

		// Check parrent nodes
		if (node.parentNode)
		{
		}

		// Check child nodes
		this.CleanChildsClass(node);
	}
},

BXStyleList.prototype.RemoveClass = function(pElement, params)
{
	if(!pElement)
		return;

	var bFind = false, tag;

	while(!bFind)
	{
		if (!pElement)
			break;

		if (pElement.nodeType == 1)
		{
			tag = pElement.nodeName.toLowerCase();
			if (tag == 'span' || tag == 'font' && pElement.className)
			{
				bFind = true;
				break;
			}
		}
		pElement = pElement.parentNode;
	}

	if (bFind)
	{
		pElement.className = '';
		pElement.removeAttribute('class');
		if (this.CheckNodeAttributes(pElement))
			BXCutNode(pElement);

		// Clean childs
		this.CleanChildsClass(pElement);
	}
},

BXStyleList.prototype.CleanChildsClass = function(node)
{
	CheckChilds(node, {func: function(node)
	{
		if (node.nodeType != 1)
			return;
		var tag = node.nodeName.toLowerCase();
		if (tag == 'span' || tag == 'font' && node.className != "")
		{
			node.className = '';
			node.removeAttribute('class');
			if (this.CheckNodeAttributes(node))
				BXCutNode(node);
		}
	}
	, obj: this});
},

BXStyleList.prototype.CheckNodeAttributes = function(node)
{
	var bClean = node.attributes.length <= 0;
	if (!bClean)
	{
		var
			bAtrExists = false, val, name, j,
			n = node.attributes.length,
			checkableAttributes = {
				title: true,
				id: true,
				name: true,
				style: true
			};

		for (j = 0; j < n; j++)
		{
			val = BX.util.trim(node.attributes[j].value);
			name = node.attributes[j].name.toString().toLowerCase();
			if (checkableAttributes[name] && val != "" && val != "null")
			{
				bAtrExists = true;
				break;
			}
		}

		if (!bAtrExists)
			bClean = true;
	}
	return bClean;
}


function BXTransOverlay(arParams)
{
	this.id = 'lhe_trans_overlay';
	this.zIndex = arParams.zIndex || 100;
}

BXTransOverlay.prototype = {
Create: function ()
{
	this.bCreated = true;
	this.bShowed = false;
	var windowSize = BX.GetWindowScrollSize();
	this.pWnd = document.body.appendChild(BX.create("DIV", {props: {id: this.id, className: "bxed-trans-overlay"}, style: {zIndex: this.zIndex, width: windowSize.scrollWidth + "px", height: windowSize.scrollHeight + "px"}}));

	this.pWnd.ondrag = BX.False;
	this.pWnd.onselectstart = BX.False;
},

Show: function(arParams)
{
	if (!this.bCreated)
		this.Create();
	this.bShowed = true;

	var windowSize = BX.GetWindowScrollSize();

	this.pWnd.style.display = 'block';
	this.pWnd.style.width = windowSize.scrollWidth + "px";
	this.pWnd.style.height = windowSize.scrollHeight + "px";

	if (!arParams)
		arParams = {};

	if (arParams.zIndex)
		this.pWnd.style.zIndex = arParams.zIndex;

	BX.bind(window, "resize", BX.proxy(this.Resize, this));
	return this.pWnd;
},

Hide: function ()
{
	if (!this.bShowed)
		return;
	this.bShowed = false;
	this.pWnd.style.display = 'none';
	BX.unbind(window, "resize", BX.proxy(this.Resize, this));
	this.pWnd.onclick = null;
},

Resize: function ()
{
	if (this.bCreated)
		this.pWnd.style.width = BX.GetWindowScrollSize().scrollWidth + "px";
}
};

function BXEdColorPicker()
{
	this.disabled = false;
	this.bCreated = false;
	this.bOpened = false;
	this.zIndex = 2090;

	this.arColors = [
		'#FF0000', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#FF00FF', '#FFFFFF', '#EBEBEB', '#E1E1E1', '#D7D7D7', '#CCCCCC', '#C2C2C2', '#B7B7B7', '#ACACAC', '#A0A0A0', '#959595',
		'#EE1D24', '#FFF100', '#00A650', '#00AEEF', '#2F3192', '#ED008C', '#898989', '#7D7D7D', '#707070', '#626262', '#555', '#464646', '#363636', '#262626', '#111', '#000000',
		'#F7977A', '#FBAD82', '#FDC68C', '#FFF799', '#C6DF9C', '#A4D49D', '#81CA9D', '#7BCDC9', '#6CCFF7', '#7CA6D8', '#8293CA', '#8881BE', '#A286BD', '#BC8CBF', '#F49BC1', '#F5999D',
		'#F16C4D', '#F68E54', '#FBAF5A', '#FFF467', '#ACD372', '#7DC473', '#39B778', '#16BCB4', '#00BFF3', '#438CCB', '#5573B7', '#5E5CA7', '#855FA8', '#A763A9', '#EF6EA8', '#F16D7E',
		'#EE1D24', '#F16522', '#F7941D', '#FFF100', '#8FC63D', '#37B44A', '#00A650', '#00A99E', '#00AEEF', '#0072BC', '#0054A5', '#2F3192', '#652C91', '#91278F', '#ED008C', '#EE105A',
		'#9D0A0F', '#A1410D', '#A36209', '#ABA000', '#588528', '#197B30', '#007236', '#00736A', '#0076A4', '#004A80', '#003370', '#1D1363', '#450E61', '#62055F', '#9E005C', '#9D0039',
		'#790000', '#7B3000', '#7C4900', '#827A00', '#3E6617', '#045F20', '#005824', '#005951', '#005B7E', '#003562', '#002056', '#0C004B', '#30004A', '#4B0048', '#7A0045', '#7A0026'
];
}

BXEdColorPicker.prototype = {
	_Create: function ()
	{
		this.pWnd = BX.create("DIV", {props: {className: 'bx-ed-colorpicker'}});
		var _this = this;

		if(this.OnSelectionChange)
			this.pMainObj.AddEventHandler("OnSelectionChange", this.OnSelectionChange, this);

		if(this.disableOnCodeView)
			this.pMainObj.AddEventHandler("OnChangeView", this.OnChangeView, this);

		if(this.with_input)
		{
			this.pInput = this.pWnd.appendChild(BX.create("INPUT", {props: {size: 7}}));
			if (_this.OnChange)
				this.pInput.onchange = function(){_this.OnChange(this.value);};
		}

		if (!this.id)
			this.id = 'BackColor';

		this.pIcon = this.pWnd.appendChild(BX.create("IMG", {props: {id: 'bx_btn_' + this.id, title: this.title, src: one_gif_src, className: "bxedtbutton"}, style:  {border: '1px solid '+borderColorNormal, backgroundImage: "url(" + image_path + "/_global_iconkit.gif)"}}));

		this.pIcon.onclick = function(e){_this.OnClick(e, this)};
		this.pIcon.onmouseover = function (e){if(!_this.disabled){BX.addClass(this, "bxedtbuttonover");}};
		this.pIcon.onmouseout = function (e){if(!_this.disabled){BX.removeClass(this, "bxedtbuttonover");}};
	},

	Create: function ()
	{
		var _this = this;
		this.pColCont = document.body.appendChild(BX.create("DIV", {props: {className: "bx-colpick-cont"}, style: {zIndex: this.zIndex}}));

		var
			row, cell, colorCell,
			tbl = BX.create("TABLE", {props: {className: 'bx-colpic-tbl'}}),
			i, l = this.arColors.length;

		row = tbl.insertRow(-1);
		cell = row.insertCell(-1);
		cell.colSpan = 8;

		var defBut = cell.appendChild(BX.create("SPAN", {props: {className: 'bx-colpic-def-but'}, text: BX_MESS.CPickDef}));
		colorCell = BX.adjust(row.insertCell(-1), {props: {colSpan: 8, className: 'bx-color-inp-cell'}, style: {backgroundColor: this.arColors[38]}});

		defBut.onmouseover = function()
		{
			this.className = 'bx-colpic-def-but bx-colpic-def-but-over';
			colorCell.style.backgroundColor = 'transparent';
		};
		defBut.onmouseout = function(){this.className = 'bx-colpic-def-but';};
		defBut.onclick = function(e){_this.Select(false);}

		for(i = 0; i < l; i++)
		{
			if (Math.round(i / 16) == i / 16) // new row
				row = tbl.insertRow(-1);

			cell = BX.adjust(row.insertCell(-1), {props: {className: 'bx-col-cell', id: 'bx_color_' + i}, html: '<img src="' + one_gif_src + '" />', style: {backgroundColor: this.arColors[i]}});

			cell.onmouseover = function (e)
			{
				this.className = 'bx-col-cell bx-col-cell-over';
				colorCell.style.backgroundColor = _this.arColors[this.id.substring('bx_color_'.length)];
			};
			cell.onmouseout = function (e){this.className = 'bx-col-cell';};
			cell.onclick = function(e){_this.Select(_this.arColors[this.id.substring('bx_color_'.length)]);};
		}

		this.pColCont.appendChild(tbl);
		this.bCreated = true;
	},

	OnClick: function (e, pEl)
	{
		if(this.disabled)
			return false;

		if (!this.bCreated)
			this.Create();

		if (this.bOpened)
			return this.Close();

		this.Open();
	},

	Open: function ()
	{
		var
			pOverlay = this.pMainObj.oTransOverlay.Show(),
			pos = BX.align(BX.pos(this.pIcon), 325, 155),
			_this = this;

		BX.bind(document, "keyup", BX.proxy(this.OnKey, this));
		BX.bind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));

		oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
		pOverlay.onclick = function(){_this.Close()};

		this.pColCont.style.display = 'block';
		this.pColCont.style.top = pos.top + 'px';
		this.pColCont.style.left = pos.left + 'px';
		this.bOpened = true;
	},

	Close: function ()
	{
		this.pColCont.style.display = 'none';
		this.pMainObj.oTransOverlay.Hide();

		BX.unbind(document, "keyup", BX.proxy(this.OnKey, this));
		BX.unbind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));

		this.bOpened = false;
	},

	OnMouseOver: function (e)
	{
		if(!this.disabled)
		{
			this.pIcon.style.borderColor = borderColorOver;
			this.pIcon.style.border = "#4B4B6F 1px solid";
			this.pIcon.style.backgroundColor = bgroundColorOver;
		}
	},

	OnMouseOut: function (e)
	{
		if(!this.disabled)
		{
			this.pIcon.style.backgroundColor = "";
			this.pIcon.style.borderColor = borderColorNormal;
		}
	},

	OnKey: function(e)
	{
		if(!e)
			e = window.event
		if(e.keyCode == 27)
			this.Close();
	},

	Select: function (color)
	{
		if (!color)
			color = '';

		if(this.pInput)
			this.pInput.value = color;

		BXSelectRange(oPrevRange, this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
		if(this.OnChange)
			this.OnChange(color);

		this.Close();
	},

	OnChangeView: function (mode, split_mode)
	{
		mode = (mode == 'split' ? split_mode : mode);
		this.Disable(mode == 'code');
	},

	Disable: function(bFlag)
	{
		if(bFlag == this.disabled)
			return false;

		this.disabled = this.pIcon.disabled = bFlag;
		if(bFlag)
			BX.addClass(this.pIcon, 'bxedtbutton-disabled');
		else
			BX.removeClass(this.pIcon, 'bxedtbutton-disabled');
	},

	SetValue: function(val)
	{
		if(this.pInput)
			this.pInput.value = val;
	}
};

// BXTAlignPicker - class
function BXTAlignPicker()
{
	this.disabled = false;
	this.bCreated = false;
	this.bOpened = false;
	this.zIndex = 2090;

	this.arIcon = ["tl", "tc", "tr", "cl", "cc", "cr", "bl", "bc", "br"];
	this.arIconH = ["left", "center", "right"];
	this.arIconV = ["top", "middle", "bottom"];
	this.arIconName = [
		BX_MESS.TAlign1, BX_MESS.TAlign2, BX_MESS.TAlign3,
		BX_MESS.TAlign4, BX_MESS.TAlign5, BX_MESS.TAlign6,
		BX_MESS.TAlign7, BX_MESS.TAlign8, BX_MESS.TAlign9];
}

BXTAlignPicker.prototype = {
_Create: function ()
{
	this.pWnd = BX.create("TABLE", {props: {className: 'bx-ed-alignpicker'}});
	var
		_this = this,
		row = this.pWnd.insertRow(-1),
		cell = row.insertCell(-1);

	this.pIcon = cell.appendChild(BX.create("IMG", {props: {id: 'bx_btn_align_tl', src: one_gif_src, className: "bxedtbutton"}, style:  {border: '1px solid '+borderColorNormal, backgroundImage: "url(" + image_path + "/_global_iconkit.gif)"}}));

	if (this.title)
		this.pIcon.title = this.title;

	this.pIcon.onclick = function(e){_this.OnClick(e, this)};
	this.pIcon.onmouseover = function (e){BX.addClass(this, "bxedtbuttonover");};
	this.pIcon.onmouseout = function (e){BX.removeClass(this, "bxedtbuttonover");};
},

Create: function ()
{
	this.pPopupNode = document.body.appendChild(BX.create("DIV", {props: {className: "bx-alpick-cont"}, style: {zIndex: this.zIndex}}));

	var
		_this = this,
		row, cell, j, but,
		tbl = this.pPopupNode.appendChild(BX.create("TABLE", {props: {className: 'bx-alpic-tbl'}})),
		i;

	row = tbl.insertRow(-1);
	cell = BX.adjust(row.insertCell(-1), {props: {className: 'bx-alpic-default', colSpan: 3}, html: '<nobr>' + BX_MESS.TAlignDef + '</nobr>'});

	cell.onmouseover = function (e) {BX.addClass(this, "bxedtbuttonover");};
	cell.onmouseout = function (e){BX.removeClass(this, "bxedtbuttonover");};
	cell.onclick = function (e){_this._OnChange('', ''); _this.Close();};

	for(i = 0; i < 3; i++)
	{
		row = tbl.insertRow(-1);

		for(j = 0; j < 3; j++)
		{
			cell = row.insertCell(-1);
			cell.className = 'bx-alpic-but';

			if(this.type != 'image' || i == 1 || j == 1)
			{
				but = cell.appendChild(BXPopupWindow.CreateElement("DIV", {id: 'bx_btn_align_'+this.arIcon[i * 3 + j], className: 'bxedtbutton', title: this.arIconName[i * 3 + j]}, {border: '1px solid '+borderColorNormal, backgroundImage: "url(" + global_iconkit_path + ")"}));

				if(this.type == 'image')
				{
					but.val = j==1 ? this.arIconV[i] : this.arIconH[j];
					but.onclick = function (e){_this._OnChangeI(this.val); _this.Close();};
				}
				else
				{
					but.valH = this.arIconH[j];
					but.valV = this.arIconV[i];
					but.onclick = function (e){_this._OnChange(this.valH, this.valV); _this.Close();};
				}

				but.onmouseover = function (e){BX.addClass(this, "bxedtbuttonover");};
				but.onmouseout = function (e){BX.removeClass(this, "bxedtbuttonover");};
			}
		}
	}

	this.bCreated = true;
},

Open: function ()
{
	var
		pOverlay = this.pMainObj.oTransOverlay.Show(),
		pos = BX.align(BX.pos(this.pIcon), 91, 102),
		_this = this;

	BX.bind(document, "keyup", BX.proxy(this.OnKey, this));
	BX.bind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));
	oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
	pOverlay.onclick = function(){_this.Close()};

	this.pPopupNode.style.display = 'block';
	this.pPopupNode.style.top = pos.top + 'px';
	this.pPopupNode.style.left = pos.left + 'px';
	this.bOpened = true;
},

Close: function ()
{
	this.pPopupNode.style.display = 'none';
	this.pMainObj.oTransOverlay.Hide();
	BX.unbind(document, "keyup", BX.proxy(this.OnKey, this));
	BX.unbind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));
	this.bOpened = false;
},

_OnChange: function (valH, valV)
{
	if(this.OnChange)
		this.OnChange(valH, valV);

	this.SetValue(valH, valV);
},

_OnChangeI: function (val)
{
	if(this.OnChange)
		this.OnChange(val);

	this.SetValueI(val);
},

SetValue: function(valH, valV)
{
	if(this.type == 'image')
		return this.SetValueI(valH);

	for(var j = 0; j < 3; j++)
		if(this.arIconH[j] == valH)
			break;

	for(var i = 0; i < 3; i++)
		if(this.arIconV[i] == valV)
			break;

	if(i > 2)
		i = 1;
	if(j > 2)
		j=0;

	this.pIcon.id = "bx_btn_align_"+this.arIcon[i * 3 + j];
	this.pIcon.title = this.arIconName[i * 3 + j];
	return i * 3 + j;
},

SetValueI: function(val)
{
	var i, j = 0;
	for(i = 0; i < 3; i++)
		if(this.arIconV[i] == val)
		{
			j = 1;
			break;
		}
	if(j != 1)
		for(j = 0; j < 3; j++)
			if(this.arIconH[j] == val)
			{
				i = 1;
				break;
			}

	if(i > 2)
		i=1;
	if(j > 2)
		j=0;

	this.pIcon.id = "bx_btn_align_"+this.arIcon[i * 3 + j];
	this.pIcon.title = this.arIconName[i * 3 + j];
	return i * 3 + j;
},

OnClick: function (e)
{
	if(this.disabled)
		return false;

	if (!this.bCreated)
		this.Create();

	if (this.bOpened)
		return this.Close();

	this.Open();
},

OnKey: function(e)
{
	if (this.bOpened)
	{
		if(!e) e = window.event
		if(e.keyCode == 27)
			this.Close();
	}
}
};

// function BXGroupedButton()
// {
	// this.disabled = false;
	// this.bCreated = false;
	// this.bOpened = false;
	// this.zIndex = 2090;
// }

// BXGroupedButton.prototype = {
	// _Create: function()
	// {
		// var _this = this;

		// this.pWnd = BX.create("IMG", {props: {className: 'bxedtbutton', src: one_gif_src, id: "bx_btn_" + this.id}, style: {backgroundImage: "url(" + global_iconkit_path + ")"}});

		// this.pWnd.onmouseover = function(e)
		// {
			// if(!this.disabled)
				// BX.addClass(this, 'bxedtbutton-over');
		// };

		// this.pWnd.onmouseout = function(e)
		// {
			// if(!this.disabled)
				// BX.removeClass(this, 'bxedtbutton-over');
		// };

		// this.pWnd.onclick = BX.proxy(this.OnClick, this);

		// this.pPopupNode = document.body.appendChild(BX.create("DIV", {props: {className: "bx-but-group"}, style: {zIndex: this.zIndex}}));
		// this.bCreated = true;

		// this.pPopupNode.style.height = ((this.buttons.length - 1) * 20) + "px";

		// var i, l = this.buttons.length, pBut;
		// for (i = 0; i < l; i++)
		// {
			// //pBut = this.pMainObj.CreateCustomElement("BXButton", arButton[1]);
			// //this.pPopupNode.appendChild(BX.create("DIV", {props: {className: "bx-g-tlbr-but"}})).appendChild(pBut.pWnd);
		// }

		// // if(!this.no_actions || this.no_actions != true) // for context menu
		// // {
			// //if (this.defaultState)
			// //	this.Check(true);
			// // addCustomElementEvent(this.pWnd, 'click', this.OnClick, this);
			// // this.pMainObj.AddEventHandler("OnSelectionChange", this._OnSelectionChange, this);
			// // this.pMainObj.AddEventHandler("OnChangeView", this.OnChangeView, this);
		// //}
	// },

	// // _OnChangeView: function (mode, split_mode)
	// // {
		// // mode = (mode == 'split' ? split_mode : mode);
		// // if(mode == 'code' && !this.codeEditorMode || (mode=='html' && this.hideInHtmlEditorMode))
		// // {
			// // this._prevDisabledState = this.pWnd.disabled;
			// // this.Disable(true);
		// // }
		// // else if(mode == 'code' && this.codeEditorMode || (this.hideInHtmlEditorMode && mode != 'html'))
			// // this.Disable(false);
		// // else if(!this.codeEditorMode)
			// // this.Disable(this._prevDisabledState);
	// // },

	// OnChangeView: function (mode, split_mode)
	// {
		// //this._OnChangeView(mode, split_mode);
	// },

	// OnClick: function (e)
	// {
		// if(this.disabled)
			// return false;

		// if (this.bOpened)
			// return this.Close();

		// this.Open();
	// },

	// Open: function ()
	// {
		// var
			// pOverlay = this.pMainObj.oTransOverlay.Show(),
			// pos = BX.pos(this.pWnd),
			// _this = this;

		// //BX.bind(document, "keyup", BX.proxy(this.OnKey, this));
		// //BX.bind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));

		// oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
		// pOverlay.onclick = function(){_this.Close()};

		// this.pPopupNode.style.top = pos.top + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? 17 : 19);
		// this.pPopupNode.style.left = pos.left + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? -2 : 0);
		// this.pPopupNode.style.display = 'block';

		// // BXPopupWindow.Show({
			// // top: pos.top + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? 17 : 19),
			// // left: pos.left + (BX.browser.IsIE() && !BX.browser.IsDoctype() ? -2 : 0),
			// // node: this.pPopupNode,
			// // width: this.width,
			// // height: this.height
		// // });
		// this.bOpened = true;
	// },

	// Close: function ()
	// {
		// this._Close();
	// },

	// _Close: function ()
	// {
		// this.pPopupNode.style.display = 'none';
		// this.pMainObj.oTransOverlay.Hide();

		// //BX.unbind(document, "keyup", BX.proxy(this.OnKey, this));
		// //BX.unbind(this.pMainObj.pEditorDocument, "keyup", BX.proxy(this.OnKey, this));
		// this.bOpened = false;
	// },

	// OnKey: function (e)
	// {
		// if(!e)
			// e = window.event
		// if(e.keyCode == 27 && this.bOpened)
			// this.Close();
	// }
// }

function BXDialog() {}
BXDialog.prototype = {
	_Create: function()
	{
		var _this = this;
		this.pMainObj._DisplaySourceFrame(true);

		if(!this.params || typeof(this.params) != "object")
			this.params = {};

		this.params.pMainObj = this.pMainObj;
		pObj = window.pObj = this;

		oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
		var ShowResult = function(result, bFastMode)
		{
			BX.closeWait();

			if (window.oBXEditorDialog && window.oBXEditorDialog.isOpen)
				return false;

			var arDConfig = {
				title : _this.name,
				width: _this.width,
				height: 300,
				resizable: false
			};

			if (bFastMode)
			{
				if (result.title)
					arDConfig.title = result.title;

				if (result.width)
					arDConfig.width = result.width;
				if (result.height)
					arDConfig.height = result.height;

				if (result.resizable)
				{
					arDConfig.resizable = true;
					arDConfig.min_width = result.min_width;
					arDConfig.min_height = result.min_height;
					arDConfig.resize_id = result.resize_id;
				}
			}

			window.oBXEditorDialog = new BX.CEditorDialog(arDConfig);
			window.oBXEditorDialog.editorParams = _this.params;

			BX.addCustomEvent(window.oBXEditorDialog, 'onWindowUnRegister', function()
			{
				if (window.oBXEditorDialog && window.oBXEditorDialog.DIV && window.oBXEditorDialog.DIV.parentNode)
					window.oBXEditorDialog.DIV.parentNode.removeChild(window.oBXEditorDialog.DIV);
			});

			if (bFastMode)
			{
				window.oBXEditorDialog.Show();
				window.oBXEditorDialog.SetContent(result.innerHTML);

				if (result.OnLoad && typeof result.OnLoad == 'function')
					result.OnLoad();
			}
		}
		BX.showWait();

		var potRes = this.GetFastDialog();
		if (potRes !== false)
			return ShowResult(potRes, true);

		var
			addUrl = (this.params.PHPGetParams ? this.params.PHPGetParams : '') + '&mode=public' + '&sessid=' + BX.bitrix_sessid() + (this.not_use_default ? '&not_use_default=Y' : ''),
			handler = this.handler ? '/bitrix/admin/' + this.handler : editor_dialog_path,
			url = handler + '?lang=' + BXLang + '&bxpublic=Y&site=' + BXSite + '&name=' + this.name + addUrl;

		if (_this.params.bUseTabControl)
		{
			BX.closeWait();
			window.oBXEditorDialog = new BX.CAdminDialog({
				title : _this.name,
				content_url: url,
				width: _this.width,
				resizable: false
			});
			window.oBXEditorDialog.bUseTabControl = true;
			window.oBXEditorDialog.Show();
		}
		else
		{
			// hack to loading auth
			url += '&bxsender=core_window_cadmindialog';

			BX.ajax.post(url, {}, ShowResult);
		}
	},

	Close: function(){},

	GetFastDialog: function()
	{
		return window.arEditorFastDialogs[this.name] ? window.arEditorFastDialogs[this.name](this) : false;
	}
}

BXHTMLEditor.prototype.OpenEditorDialog = function(dialogName, obj, width, arParams, notUseDefaultButtons)
{
	this.CreateCustomElement("BXDialog", {width: parseInt(width) || 500, name: dialogName, params: arParams || {}, not_use_default: notUseDefaultButtons});
}htmleditor2/bars_ex.js000064400000050136150240170740010767 0ustar00// Toolbarsets class
function BXToolbarSet(pColumn, pMainObj, bVertical)
{
	//ar_BXToolbarSetS.push(this);
	this.className = 'BXToolbarSet';
	pColumn.unselectable = "on";
	this.pWnd = pColumn;
	this.pMainObj = pMainObj;
	this.bVertical = bVertical;
	this.pWnd.className = 'bxedtoolbarset';
	this.arToolbarPositions = [];
	pColumn.style.display = "";
	pColumn.parentNode.style.display = "";

	if(bVertical)
	{
		pColumn.style.verticalAlign = "top";
		//pColumn.innerHTML = '<img src="' + one_gif_src + '" width="1" height="0">';
		this.pWnd = pColumn.appendChild(BX.create("TABLE", {props: {unselectable: "on",cellSpacing: 0,cellPadding: 0,border: 0}}));
		this.pWnd.insertRow(0);
		this.pParent = pColumn;
	}
}

// Check if coordinate hit in toolbarset area (+/- some inaccuracy)
// Return array:
//		"row" - row in toolbarset;
//		"col" - column in toolbarset;
//		"addrow"  - between two rows
// or false - if it's too far
BXToolbarSet.prototype =
{
	HitTest: function (px, py, ind)
	{
		var delta = 3, result, position, allNodes;

		if (!(position = CACHE_DISPATCHER['BXToolbarSet_pos_'+ind]))
			position = CACHE_DISPATCHER['BXToolbarSet_pos_'+ind] = BX.pos((this.bVertical ? this.pParent : this.pWnd));

		if(position["left"] - delta < px &&
			px < position["right"] + delta &&
			position["top"] - delta < py &&
			py < position ["bottom"] + delta)
		{
			result = {row: 0, col: 0, addrow: false};

			// find all toolbars in toolbarset
			if(this.bVertical)
				allNodes = this.pWnd.rows[0].cells;
			else
				allNodes = this.pWnd.childNodes;

			if(!allNodes || allNodes.length<=0)
			{
				result["addrow"] = true;
				return result;
			}

			var allCells, j, i, l = allNodes.length, toolbar_position;
			for(i = 0; i < l; i++)
			{
				toolbar_position = BX.pos(allNodes[i]);
				if(this.bVertical)
				{
					if(toolbar_position["left"] - delta < px && px < toolbar_position["right"] + delta)
					{
						if(toolbar_position["left"] + delta > px)
						{
							result["addrow"] = true;
							result["col"] = i;
						}
						else if(toolbar_position["right"] - delta < px)
						{
							result["addrow"] = true;
							result["col"] = i + 1;
						}
						else
						{
							result["col"] = i;
							allCells = allNodes[i].childNodes[0].rows;
							for(j = allCells.length-1; j > 0; j--)
							{
								var celltemp = allCells[j].cells[0];
								var celltemp_position = BX.pos(celltemp);
								if(celltemp_position["top"] - delta < py)
								{
									result["row"] = j;
									break;
								}
							}
						}
						return result;
					}
				}
				else
				{
					if(toolbar_position["top"] - delta < py && py < toolbar_position["bottom"] + delta)
					{
						if(toolbar_position["top"] + delta > py)
						{
							result["addrow"] = true;
							result["row"] = i;
						}
						else if(toolbar_position["bottom"] - delta < py)
						{
							result["addrow"] = true;
							result["row"] = i + 1;
						}
						else
						{
							result["row"] = i;
							allCells = allNodes[i].rows[0].cells;
							for(j = allCells.length-1; j > 0; j--)
							{
								//var cell_position = GetRealPos(allCells[j]);
								var cell_position = BX.pos(allCells[j]);
								if(cell_position["left"] - delta < px)
								{
									result["col"] = j;
									return result;
								}
							}
						}
						return result;
					}
				}
			}
		}
		return false;
	},

	returnToolbarsPositions: function ()
	{
		return this.arToolbarPositions;
	},

	// Add toolbar to toolbarset
	AddToolbar: function (pToolbar, row, col, bAddRow)
	{
		CACHE_DISPATCHER['pEditorFrame'] = null;

		pToolbar.bDocked = true;
		var pColTable = null;
		var rowIcons;
		pToolbar.SetDirection(this.bVertical);

		if(this.bVertical)
		{
			var cols = this.pWnd.rows[0].cells;
			var pRow, tTable;
			if(col>cols.length)
				col = cols.length;
			if(col >= cols.length || bAddRow)
			{
				var ctmp = this.pWnd.rows[0].insertCell(col);
				ctmp.style.verticalAlign = "top";
				tTable = ctmp.appendChild(this.pMainObj.pDocument.createElement("TABLE"));
				tTable.cellSpacing = 0;
				tTable.cellPadding = 0;
				tTable.border = 0;
				tTable.unselectable = "on";
			}
			else
			{
				tTable = cols[col].childNodes[0];
				if(tTable.clientHeight + pToolbar.pWnd.clientHeight > this.pMainObj.arConfig["height"])
				{
					tTable = null;
					return this.AddToolbar(pToolbar, row, col+1, bAddRow);
				}
			}

			if(row>tTable.rows.length)
				row = tTable.rows.length;

			pRow = tTable.insertRow(row);
			pColTable = pRow.insertCell(0);

			tTable = null;
			pRow = null;
			ctmp = null;
			cols = null;
		}
		else
		{
			var allNodes = this.pWnd.childNodes;
			var pRowTable;
			if(row>allNodes.length)
				row = allNodes.length;
			if(row >= allNodes.length || bAddRow)
			{
				var t = BX.create("TABLE", {props: {className: "bxed-toolbar-inner",cellSpacing: 0, cellPadding: 0, unselectable: "on"}});
				t.insertRow(0);
				pRowTable = (row >= allNodes.length) ? (this.pWnd.appendChild(t)) : (this.pWnd.insertBefore(t, allNodes[row]));
			}
			else
			{
				pRowTable = allNodes[row];
				if(pRowTable.clientWidth + pToolbar.pWnd.clientWidth > this.pMainObj.arConfig["width"])
					return this.AddToolbar(pToolbar, row+1, col, bAddRow);
			}

			if(col > pRowTable.rows[0].cells.length)
				col = pRowTable.rows[0].cells.length;

			pColTable = pRowTable.rows[0].insertCell(col);
			rowIcons = pToolbar.pIconsTable.rows[0];
			rowIcons.cells[0].style.display = GetDisplStr(1);
			rowIcons.cells[rowIcons.cells.length-1].style.display = GetDisplStr(1);

			r = null;
			t = null;
			pRowTable = null;
			allNodes = null;
		}

		pToolbar.row = row;
		pToolbar.col = col;

		pToolbar.pWnd.style.position = "relative";
		pToolbar.pWnd.style.zIndex = "200";
		pToolbar.pWnd.style.left = null;
		pToolbar.pWnd.style.top = null;

		pToolbar.pTitleRow.style.display = "none";

		pToolbar.pWnd = pColTable.appendChild(pToolbar.pWnd);
		pToolbar.pWnd.style.position = "";
		pToolbar.pToolbarSet = this;
		pToolbar.parentCell = pColTable;

		pColTable.style.width = '10px'; // Hack

		this.__ReCalc();
		pColTable = null;
	},

	//Dell toolbar from toolbarset
	DelToolbar: function (pToolbar)
	{
		CACHE_DISPATCHER['pEditorFrame'] = null;

		pToolbar.parentCell.removeChild(pToolbar.pWnd);
		pToolbar.pToolbarSet = null;
		this.__ReCalc();
	},

	__ReCalc: function ()
	{
		var allNodes, i, j, pToolbar, cols, pDomToolbar;
		if(this.bVertical)
		{
			cols = this.pWnd.rows[0].cells;
			for(i = cols.length - 1; i >= 0; i--)
			{
				allNodes = cols[i].childNodes[0].rows;
				for(j = allNodes.length - 1; j >= 0; j--)
					if(allNodes[j].cells[0].childNodes.length <= 0)
						cols[i].childNodes[0].deleteRow(j);
				if(cols[i].childNodes[0].rows.length <= 0)
					this.pWnd.rows[0].deleteCell(i);
			}

			for(i = 0; i < cols.length; i++)
			{
				allNodes = cols[i].childNodes[0].rows;
				for(j = 0; j < allNodes.length; j++)
				{
					pToolbar = allNodes[j].cells[0].childNodes[0].pObj;

					pToolbar.row = j;
					pToolbar.col = i;
					this.arToolbarPositions[pToolbar.name] = [pToolbar.row,pToolbar.col];
				}
			}
		}
		else
		{
			allNodes = this.pWnd.childNodes;


			for(i = allNodes.length-1; i>=0; i--) // horizontal rows
			{
				var tbl = allNodes[i];
				for(j = tbl.rows[0].cells.length - 1; j >= 0; j--)
				{
					if(tbl.rows[0].cells[j].childNodes.length <= 0)
						tbl.rows[0].deleteCell(j);
				}
				//dell whole table if there are no rows....
				if(tbl.rows[0].cells.length <= 0)
					this.pWnd.removeChild(tbl);
				else
					tbl.rows[0].insertCell(-1);
			}

			for(i = 0; i < allNodes.length; i++)
			{
				for(j = 0; j < allNodes[i].rows[0].cells.length; j++)
				{
					pDomToolbar = allNodes[i].rows[0].cells[j].childNodes[0];
					if (!pDomToolbar || !pDomToolbar.pObj)
						continue;

					pToolbar = pDomToolbar.pObj;
					pToolbar.row = i;
					pToolbar.col = j;
					this.arToolbarPositions[pToolbar.name] = [pToolbar.row,pToolbar.col];
				}
			}
		}
		pToolbar = null;
		tbl = null;
		allNodes = null;
	}
};


//###################################################
//#   class BXToolbar - toolbar
//#   pWnd - pointer to TABLE of toolbar
//#   bDragging - dragging state
//#   bDocked - docked state
//###################################################
function BXToolbar(pMainObj, title, name, dx, dy)
{
	ar_BXToolbarS.push(this);
	this.pMainObj = pMainObj;
	this.className = 'BXToolbar';
	this.id = Math.random();
	this.name = name;
	this.bVertical = false;
	this.title = title;
	this.actTInd = 0;
	this.buttons = [];

	var obj = this;

	var tableToolbar = BX.create("TABLE", {props: {className: "bx-toolbar-tbl", unselectable: "on"}, style: {width: dx != null ? dx : "0%", height: dy != null ? dy : "20px"}});
	tableToolbar.pObj = this;
	tableToolbar.ondragstart = function (e){return false;};
	this.pTitleRow = tableToolbar.insertRow(0);
	var cellTitle = BX.adjust(this.pTitleRow.insertCell(0), {props: {className: "bxedtoolbartitle", noWrap: "nowrap", unselectable: "on"}});

	cellTitle.innerHTML = '<table class="bxedtoolbartitletext"><tr><td width="99%" nowrap style="padding: 0px 1px 1px 8px;">' + title + '</td><td width="0%">&nbsp;</td><td id="title_x_'+this.id+'" width="1%" style="padding: 0px 3px 0px 3px; cursor: default;"><img src="' + one_gif_src + '" class= "iconkit_c bx-toolbar-x" /></td></table>';
	cellTitle.onmousedown = function(e){obj.MouseDown(e); return false;};

	var cellrow2 = tableToolbar.insertRow(1).insertCell(0);
	cellrow2.className = "bxedtoolbar";
	cellrow2.unselectable = "on";

	var tableIcons = BX.create("TABLE", {props: {className: "bxedtoolbaricons", unselectable: "on"}});
	tableIcons.style.height = (dy != null ? dy : "22px");

	var rowIcons = tableIcons.insertRow(0);
	rowIcons.style.backgroundImage = "url(" + image_path + "/toolbarbg.gif)";
	var cellIcons = rowIcons.insertCell(0);
	cellIcons.style.width = "0%";
	cellIcons.style.cursor = "move";
	cellIcons.appendChild(pMainObj.CreateElement("DIV", {title: title, className: "iconkit_c"}, {backgroundPosition: "-317px -96px", width: "12px", height: "25px"}));

	cellIcons.unselectable = "on";
	cellIcons.onmousedown = function(e){obj.MouseDown(e);  return false;};
	cellIcons = rowIcons.insertCell(-1);
	cellIcons.unselectable = "on";
	cellIcons.style.width = "100%";
	cellIcons.style.backgroundImage = "url(" + image_path + "/toolbarbg.gif)";
	cellIcons.innerHTML = ' ';
	cellIcons = rowIcons.insertCell(-1);
	cellIcons.unselectable = "on";
	cellIcons.style.width = "0%";
	//Right part of toolbar
	cellIcons.appendChild(pMainObj.CreateElement("DIV", {title: title, className: "iconkit_c"}, {backgroundPosition: "-334px -96px", width: "5px", height: "25px"}));
	cellIcons.onmousedown = function(e){obj.MouseDown(e); return false;};

	this.pIconsTable = cellrow2.appendChild(tableIcons);
	this.pWnd = this.pMainObj.pWnd.appendChild(tableToolbar);

	var x_cell = pMainObj.pDocument.getElementById('title_x_'+this.id);
	x_cell.onmousedown = function(e){obj.Close(e)};
	x_cell = null;

	// Add button to toolbar
	BXToolbar.prototype.AddButton = function(pButton, num)
	{
		var rowIcons = this.pIconsTable.rows[0];
		var but_count = rowIcons.cells.length - 3;
		if(!num || num>but_count)
			num = but_count;

		var cellIcon = rowIcons.insertCell(num + 1);
		cellIcon.unselectable = "on";
		cellIcon.style.backgroundImage = "url(" + image_path + "/toolbarbg.gif)";
		cellIcon.style.width = "0%";
		cellIcon.appendChild(pButton.pWnd);
		cellIcon.pObj = pButton;

		cellIcon = null;
		rowIcons = null;
	};

	BXToolbar.prototype.SetDirection = function(bVertical)
	{
		if(this.bVertical == bVertical)
			return;

		var obj = this;
		this.bVertical = bVertical;
		var newr, i, buttons, ar = Array();
		if(bVertical)
		{
			buttons = this.pIconsTable.rows[0].cells;
			i=0;
			while(buttons.length > 3)
				ar[i++] = this.pIconsTable.rows[0].removeChild(buttons[1]);

				this.pIconsTable.deleteRow(0);
			var ct = this.pIconsTable.insertRow(0).insertCell(0);
			ct.appendChild(pMainObj.CreateElement("DIV", {title: title, className: "iconkit_c"}, {backgroundPosition: "-291px -100px", width: "25px", height: "12px"}));
			ct.style.width = "0%";

			ct.onmousedown = function(e){obj.MouseDown(e);  return false;};
			ct.style.height = "0%";
			ct.style.cursor = "move";
			for(i = 0, l = ar.length; i < l; i++)
			{
				var ra = this.pIconsTable.insertRow(i+1);
				ct = ra.appendChild(ar[i]);
				ct.style.backgroundImage = "url(" + image_path + "/toolbarbg_vert.gif)";

				if(ar[i].pObj.OnToolbarChangeDirection)
					ar[i].pObj.OnToolbarChangeDirection(bVertical);
			}
			ct = this.pIconsTable.insertRow(-1).insertCell(0).appendChild(pMainObj.CreateElement("IMG", {src: one_gif_src, title: title, className: "iconkit_c"}, {backgroundPosition: "-291px -113px", width: "25px", height: "5px"}));
			ct = null;
			ra = null;
		}
		else
		{
			buttons = this.pIconsTable.rows;
			for(i=1; i<buttons.length-1; i++)
				ar[i-1] = buttons[i].removeChild(buttons[i].cells[0]);

			while(this.pIconsTable.rows.length>0)
				this.pIconsTable.deleteRow(0);

			var r = this.pIconsTable.insertRow(0)
			var ct2 = r.insertCell(0);
			ct2.appendChild(pMainObj.CreateElement("DIV", {title: title, className: "iconkit_c"}, {backgroundPosition: "-317px -96px", width: "12px", height: "25px"}));
			ct2.style.width = "0%";
			ct2.style.height = "0%";
			ct2.style.cursor = "move";
			ct2.onmousedown = function(e){obj.MouseDown(e);  return false;};

			for(i=0; i<ar.length; i++)
			{
				ct2 = r.appendChild(ar[i]);
				ct2.style.width = "0%";
				ct2.style.backgroundImage = "url(" + image_path + "/toolbarbg.gif)";

				if(ct2.pObj.OnToolbarChangeDirection)
					ct2.pObj.OnToolbarChangeDirection(bVertical);
			}
			var ln = r.cells.length;
			ct2 = r.insertCell(ln)
			ct2.innerHTML = ' ';
			ct2.style.width = "100%";
			r.insertCell(-1).appendChild(pMainObj.CreateElement("DIV", {title: title, className: "iconkit_c"}, {backgroundPosition: "-334px -96px", width: "5px", height: "25px"}));

			buttons = null; r = null; ct2 = null;
		}
	};
}

BXToolbar.prototype = {
MouseDown: function (e)
{
	e = getRealMousePos(e, this.pMainObj);
	var position = BX.pos(this.pWnd);

	this.pMainObj.bDragging = true;
	this.bDragging = true;

	this.pMainObj.iLeftDragOffset = e.realX - position["left"];
	this.pMainObj.iTopDragOffset = e.realY - position["top"];

	pBXEventDispatcher.SetCursor("move");
	this.pWnd.oldBorder = this.pWnd.style.border;
	this.pWnd.style.zIndex = "1000";
	var _this = this;


	var __BXToolbarMouseMove = function(e){_this.MouseMove(getRealMousePos(e, _this.pMainObj));};
	var __BXToolbarMouseMoveF = function(e){_this.MouseMove(getRealMousePos(e, _this.pMainObj, true));};

	var __BXToolbarMouseUp = function(e)
	{
		// Clean event handlers
		removeAdvEvent(document, "mousemove", __BXToolbarMouseMove, true);
		removeAdvEvent(document, "mouseup", __BXToolbarMouseUp, true);
		removeAdvEvent(_this.pMainObj.pEditorDocument, "mousemove", __BXToolbarMouseMoveF, true);
		removeAdvEvent(_this.pMainObj.pEditorDocument, "mouseup", __BXToolbarMouseUp, true);
		if (BX.browser.IsIE())
		{
			removeAdvEvent(_this.pMainObj.pEditorDocument, "selectstart", preventselect, true);
			removeAdvEvent(document, "selectstart", preventselect, true);
		}

		if(_this.pMainObj.bDragging && _this.bDragging)
		{
			_this.pMainObj.bDragging = false;
			_this.bDragging = false;
			_this.pWnd.style.zIndex = "200";
			_this.pWnd.style.border = _this.pWnd.oldBorder;
			pBXEventDispatcher.SetCursor("auto");

			_this.SaveConfiguration();
		}

		// Resize (refresh) taskbarsets
		_this.pMainObj.arTaskbarSet[2]._SetTmpClass(true);
		_this.pMainObj.arTaskbarSet[2].Resize();
		_this.pMainObj.arTaskbarSet[3].Resize();
	};

	var preventselect = function(e){return false;};

	addAdvEvent(document, "mousemove", __BXToolbarMouseMove, true);
	addAdvEvent(this.pMainObj.pEditorDocument, "mousemove", __BXToolbarMouseMoveF, true);
	addAdvEvent(document, "mouseup", __BXToolbarMouseUp, true);
	addAdvEvent(this.pMainObj.pEditorDocument, "mouseup", __BXToolbarMouseUp, true);

	if (BX.browser.IsIE())
	{
		addAdvEvent(this.pMainObj.pEditorDocument, "selectstart", preventselect, true);
		addAdvEvent(document, "selectstart", preventselect, true);
	}

	if (e.stopPropagandation)
		e.stopPropagandation();
	else
		e.cancelBubble = true;
},

// Undock toolbar from toolbarset:
//      .... position = absolute
//      show toolbar title
UnDock: function ()
{
	if(this.pToolbarSet)
		this.pToolbarSet.DelToolbar(this);
	this.pWnd.style.zIndex = "1000";
	this.pWnd.style.position = "absolute";
	document.body.appendChild(this.pWnd);
	var rowIcons = this.pIconsTable.rows[0];
	this.pTitleRow.style.display = GetDisplStr(1);
	this.SetDirection(false);
	this.bDocked = false;
},

Close: function ()
{
	if(this.pToolbarSet)
		this.pToolbarSet.DelToolbar(this);
	this.pWnd.style.display = GetDisplStr(0);

	this.SaveConfiguration();
},

SaveConfiguration: function ()
{
	var arTlbrSet_old = copyObj(SETTINGS[this.pMainObj.name].arToolbarSettings);
	if (this.bDocked)
		this.ReCalcPositions();

	var arTlbrSet = SETTINGS[this.pMainObj.name].arToolbarSettings;
	arTlbrSet[this.name].show = !(this.pWnd.style.display == "none" && this.name != 'standart');
	if (!this.bDocked)
	{
		arTlbrSet[this.name].docked = false;
		arTlbrSet[this.name].position = {x:this.pWnd.style.left,y:this.pWnd.style.top};
	}

	if (compareObj(arTlbrSet_old, arTlbrSet))
		return;

	this.pMainObj.SaveConfig("toolbars", {tlbrset: arTlbrSet});
},

ReCalcPositions: function ()
{
	var arTlbrSet = SETTINGS[this.pMainObj.name].arToolbarSettings;
	var arToolbarSet = this.pMainObj.GetToolbarSet();
	var __arToolBarPos = arToolbarSet[this.actTInd].returnToolbarsPositions();
	arTlbrSet[this.name].docked = true;
	arTlbrSet[this.name].position = [];
	for (var k in __arToolBarPos)
		if (arTlbrSet[k] && arTlbrSet[k].docked)
			arTlbrSet[k].position = [this.actTInd,__arToolBarPos[k][0],__arToolBarPos[k][1]];
},

SetPosition: function (x,y)
{
	if (this.bDocked)
		this.UnDock();

	this.pWnd.style.top = (y || 0) + "px";
	this.pWnd.style.left = (x || 0) + "px";
},

// Mouse moving:
//	if it's dragging than check nearest toolbarset with help of BXToolToolbarSet.HitTest...
//	And dock or undock toolbar....
MouseMove: function(e)
{
	if(this.pMainObj.bDragging && this.bDragging)
	{
		// check: if hit the toolbarset
		var
			left, top,
			bDocked = false, actToolbarSet = false, arPos,
			arToolbarSet = this.pMainObj.GetToolbarSet(),
			i, tl = arToolbarSet.length;

		for(i = 0; i < tl; i++)
		{
			if(arPos = arToolbarSet[i].HitTest(e.realX, e.realY, i))
			{
				bDocked = true;
				actToolbarSet = arToolbarSet[i];
				this.actTInd = i;
				break;
			}
		}

		left = e.realX - this.pMainObj.iLeftDragOffset;
		top = e.realY - this.pMainObj.iTopDragOffset;
		if (isNaN(left) || left < 0)
			left = 0;
		if (isNaN(top) || top < 0)
			top = 0;
		left += 'px';
		top += 'px';

		if(this.bDocked && !bDocked) // toolbar go out from toolbarset
		{
			this.UnDock();
			this.pWnd.style.left = left;
			this.pWnd.style.top = top;
		}
		else if(!this.bDocked && bDocked && actToolbarSet) // toolbar in toolbarset
		{
			if(this.pToolbarSet)
				this.pToolbarSet.DelToolbar(this);
			actToolbarSet.AddToolbar(this, arPos['row'], arPos['col'], arPos['addrow']);
		}
		else if(!this.bDocked && !bDocked)
		{
			this.pWnd.style.left = left;
			this.pWnd.style.top = top;
		}
		else if(arPos["addrow"] || this.row != arPos['row'] || this.col != arPos['col'])
		{
			if(this.pToolbarSet)
				this.pToolbarSet.DelToolbar(this);
			actToolbarSet.AddToolbar(this, arPos['row'], arPos['col'], arPos['addrow']);
		}

		this.bDocked = bDocked;
	}
}
}

function BXRefreshToolbars(pMainObj)
{
	var
		arTlbrSet = SETTINGS[pMainObj.name].arToolbarSettings, sToolBarId, k, BXToolbar;

	for (k in ar_BXToolbarS)
	{
		BXToolbar = ar_BXToolbarS[k];
		sToolBarId = BXToolbar.name;

		if (BXToolbar.pMainObj.name!=pMainObj.name)
			continue;

		if (!arTlbrSet || !arTlbrSet[sToolBarId])
			continue;

		if (arTlbrSet[sToolBarId].show && BXToolbar.pWnd.style.display == 'none')
		{
			if (arTlbrSet[sToolBarId].docked)
					pMainObj.arToolbarSet[arTlbrSet[sToolBarId].position[0]].AddToolbar(BXToolbar,arTlbrSet[sToolBarId].position[1],arTlbrSet[sToolBarId].position[2]);

			BXToolbar.pWnd.style.display = GetDisplStr(1);
		}
		else if (!arTlbrSet[sToolBarId].show && BXToolbar.pWnd.style.display != 'none')
		{
			if (BXToolbar.pToolbarSet)
				BXToolbar.pToolbarSet.DelToolbar(BXToolbar);
			BXToolbar.pWnd.style.display = GetDisplStr(0);
		}
	}
}
htmleditor2/bars.js000064400000133272150240170740010276 0ustar00function BXTaskbarSet(pColumn, pMainObj, iNum)
{
	if (typeof SETTINGS[pMainObj.name].arTBSetsSettings != 'object' )
		SETTINGS[pMainObj.name].arTBSetsSettings = arTBSetsSettings_default;

	var
		arTBSetsSet = SETTINGS[pMainObj.name].arTBSetsSettings,
		_this = this,
		bVertical = (iNum == 1 || iNum==2);

	ar_BXTaskbarSetS.push(this);

	this.pParentWnd = pColumn;
	this.pParentWnd.unselectable = "on";
	this.pMainObj = pMainObj;
	this.bVertical = bVertical;
	this.iNum = iNum;
	this.bShowing = !!arTBSetsSet[iNum].show;
	this.bFirstDisplay = true;

	this.pWnd = BX.findChild(this.pParentWnd, {tagName: "TABLE"});
	this.sActiveTaskbar = '';

	this.pMoveColumn = this.pWnd.rows[0].cells[0];
	if (this.iNum == 2) //right
	{
		this.pTitleColumn = this.pWnd.rows[0].cells[1];
		this.pMainCell = this.pWnd.rows[1].cells[0];
		this.pBottomColumn = this.pWnd.rows[2].cells[0];
	}
	else //this.iNum == 3  - bottom
	{
		this.pTitleColumn = this.pWnd.rows[1].cells[0];
		this.pMainCell = this.pWnd.rows[2].cells[0];
		this.pBottomColumn = this.pWnd.rows[3].cells[0];
	}

	this.pDataColumn = this.pMainCell.appendChild(BX.create("DIV", {props: {className: "bxedtaskbar-scroll"}}));
	this.arTaskbars = [];

	this.pMoveColumn.style.display = "none";
	this.pMoveColumn.unselectable = "on";
	this.pMoveColumn.ondragstart = function (e){return BX.PreventDefault(e);};
	this.pMoveColumn.onmousedown = function(e){_this.MouseDown(e); return false;};

	if (!CACHE_DISPATCHER['TranspToggle'])
		CACHE_DISPATCHER['TranspToggle'] = document.body.appendChild(BX.create('IMG', {props: {src: one_gif_src}, styles: {display: 'none'}}));
}

BXTaskbarSet.prototype =
{
	// Start move toogle
	MouseDown: function (e)
	{
		var val, maxVal, minVal, bVertical, w, h;

		if (this.iNum == 2)  // Right
		{
			val = parseInt(this.pWnd.offsetWidth);
			maxVal = val + parseInt(this.pMainObj.cEditor.offsetWidth) - 155;
			minVal = 210;
			bVertical = false;
			w = false;
			h = this.pMoveColumn.offsetHeight;
		}
		else // Bottom
		{
			val = parseInt(this.pWnd.offsetHeight);
			maxVal = val + parseInt(this.pMainObj.cEditor.offsetHeight) - (BX.browser.IsIE() ? 50 : 155);
			minVal = 120;
			bVertical = true;
			w = this.pMoveColumn.offsetWidth;
			h = false;
		}

		this.pMainObj.ClearPosCache();

		showTranspToggle({
			e: e,
			bVertical: bVertical,
			pMainObj: this.pMainObj,
			pos: BX.pos(this.pMoveColumn),
			width: w,
			height: h,
			callbackFunc: this.Resize,
			callbackObj: this,
			value: val,
			maxValue: maxVal,
			minValue: minVal
		});
	},

	Resize: function (value, bSave, bSetTmpClass)
	{
		// Get value from saved settings resize
		if (value === false || typeof value == 'undefined')
		{
			value = SETTINGS[this.pMainObj.name].arTBSetsSettings[this.iNum].size;
			bSave = false;
		}

		if (!this.bShowing)
		{
			value = 0;
			bSave = false;
		}

		var maxVal, minVal;
		if (this.iNum == 2)  // Right
		{
			maxVal = parseInt(this.pMainObj.pWnd.offsetWidth) - 200;
			minVal = 210;
		}
		else // Bottom
		{
			maxVal = parseInt(this.pMainObj.pWnd.offsetHeight) - 250;
			minVal = 120;
		}

		if (value > maxVal && maxVal > minVal)
			value = maxVal;

		if (value < minVal && value !== 0 && minVal < maxVal)
			value = minVal;

		value = parseInt(value);
		var
			_this = this,
			rightTaskbar = this.pMainObj.arTaskbarSet[2],
			bottomTaskbar = this.pMainObj.arTaskbarSet[3],
			h = parseInt(this.pMainObj.pWnd.offsetHeight), // sceleton height
			h1 = parseInt(this.pMainObj.pTopToolbarset.offsetHeight), // top toolbarset
			h2 = 29; //taskbars tabs

		// If editor is invisible - try to resize it every 0.5 sec
		if (!h || !h1)
			return setTimeout(function(){_this.Resize(value, bSave, bSetTmpClass);}, 500);

		if (this.iNum == 2)  // Resize vertical taskbar set
		{
			var h4 = bottomTaskbar.pWnd.offsetHeight;
			this.pParentWnd.style.height = (h - h1 - h2 - h4) + "px";
			if (this.bShowing)
			{
				this.pWnd.style.width = value + 'px';
				this.pDataColumn.style.width = (value - 8) + 'px';
				this.pParentWnd.style.width = value + 'px';
			}

			var w = parseInt(this.pMainObj.pWnd.offsetWidth); // sceleton width
			this.pMainObj.cEditor.style.width = (w - value - 2) + 'px';
		}
		else // Resize horizontal taskbar set
		{
			this.pMainObj.cEditor.style.height = (h - h1 - h2 - value) + "px";
			rightTaskbar.pParentWnd.style.height = (h - h1 - h2 - value) + "px";

			if (this.bShowing)
			{
				this.pWnd.style.height = value + 'px';
				this.pDataColumn.style.height = (value - 34) + 'px';
			}
		}

		if (this.adjustTimeout)
			clearTimeout(this.adjustTimeout);

		this.adjustTimeout = setTimeout(function()
		{
			var
				h3 = rightTaskbar.pDataColumn.parentNode.offsetHeight,
				w3 = rightTaskbar.pDataColumn.parentNode.offsetWidth;

			h3 = BX.findParent(rightTaskbar.pDataColumn, {tagName: "TABLE"}).offsetHeight - 26 /*top title*/;
			if (rightTaskbar.arTaskbars.length > 1)
				h3 -= 26;


			if (h3 > 0)
				rightTaskbar.pDataColumn.style.height = h3 + "px";

			if (w3 > 0)
				rightTaskbar.pDataColumn.style.width = w3 + "px";

			if (BX.browser.IsIE())
				rightTaskbar.pWnd.parentNode.appendChild(rightTaskbar.pWnd); // IE needs to refresh DOM tree

			if (bSetTmpClass !== false)
				_this._SetTmpClass(false);
		}, 100);

		if (bSave !== false)
		{
			SETTINGS[this.pMainObj.name].arTBSetsSettings[this.iNum].size = value;
			this.SaveConfig();
		}
	},

	_SetTmpClass: function(bSet)
	{
		var
			d2 = this.pMainObj.arTaskbarSet[2].pDataColumn,
			d3 = this.pMainObj.arTaskbarSet[3].pDataColumn,
			c = "bxedtaskbar-scroll-tmp";

		if (bSet)
		{
			BX.addClass(d2, c);
			BX.addClass(d3, c);
		}
		else
		{
			BX.removeClass(d2, c);
			BX.removeClass(d3, c);
		}
	},

	SaveConfig: function ()
	{
		this.pMainObj.SaveConfig("taskbars", {
			tskbrsetset: SETTINGS[this.pMainObj.name].arTBSetsSettings,
			tskbrset: SETTINGS[this.pMainObj.name].arTaskbarSettings
		});
	},

	Show: function ()
	{
		this.bShowing = true;
		SETTINGS[this.pMainObj.name].arTBSetsSettings[this.iNum].show = true;

		var _this = this;
		var btt = this.pMainObj.oBXTaskTabs;

		if (this.pMainObj.visualEffects && btt)
			this.pMainObj.oBXVM.Show({
				sPos: btt.GetVPos(),
				ePos: this.GetVPos(),
				callback: function(){_this.Display(true);}
			});
		else
			this.Display(true);
	},

	Hide: function ()
	{
		this.bShowing = false;
		SETTINGS[this.pMainObj.name].arTBSetsSettings[this.iNum].show = false;

		this.Display(false);

		if (this.pMainObj.oBXTaskTabs)
		{
			if (this.pMainObj.visualEffects)
				this.pMainObj.oBXVM.Show({sPos: this.GetVPos(), ePos: this.pMainObj.oBXTaskTabs.GetVPos()});

			this.pMainObj.oBXTaskTabs.Refresh();
		}

		this.SaveConfig();
	},

	Display: function(bDisplay)
	{
		// It's first taskbarset opening - lets draw tabs for taskbars
		if (this.bFirstDisplay)
		{
			this.DrawTabs();
			this.bFirstDisplay = false;
		}

		this.bShowing = !!bDisplay && this.arTaskbars.length > 0;

		var dispStr = bDisplay ? '' : 'none';

		if (bDisplay)
			this._SetTmpClass(true);

		var _this = this;
		setTimeout(function()
		{
			_this.Resize();
			_this.pWnd.style.display = _this.pWnd.parentNode.style.display = dispStr;
			if (!_this.bVertical)
				_this.pWnd.parentNode.parentNode.style.display = dispStr;

		}, 10);
	},

	ShowToggle: function(e)
	{
		if(this.bShowing)
			this.Hide();
		else
			this.Show();

		SETTINGS[this.pMainObj.name].arTBSetsSettings[this.iNum].show = this.bShowing;
		this.SaveConfig();
		BX.PreventDefault(e);
	},

	AddTaskbar: function (pTaskbar, bDontRefresh)
	{
		var arTBSetsSet = SETTINGS[this.pMainObj.name].arTBSetsSettings;

		pTaskbar.pWnd.style.display = "";
		pTaskbar.pWnd.style.width = "100%";
		pTaskbar.pWnd.style.height = "100%";

		pTaskbar.pTaskbarSet = this;
		pTaskbar.parentCell = this.pWnd;
		//this.pWnd.style.height = '100%'; // ??????????????/

		this.arTaskbars.push(pTaskbar);
		this.pMoveColumn.style.display = "";

		if (this.bVertical)
		{
			this.pWnd.style.width = arTBSetsSet[this.iNum].size + "px";
			this.pWnd.style.height = "100%";
			this.pWnd.parentNode.style.height = "100%";
		}
		else
		{
			this.pWnd.style.width = "100%";
			this.pWnd.style.height = arTBSetsSet[this.iNum].size + "px";
		}

		if (this.arTaskbars.length > 0)
		{
			this.DrawTabs();

			// We add tab to taskbar set - need for resize right taskbar
			this._SetTmpClass(true);
			this.Resize();
		}

		pTaskbar.OnCreate();
	},

	GetVPos: function (pTaskbar, bDontRefresh)
	{
		var arVPos = [];
		var iNum = this.iNum;
		//var edPos = GetRealPos(this.pMainObj.pWnd);
		var edPos = BX.pos(this.pMainObj.pWnd);
		if (this.bVertical)
		{
			arVPos[iNum] = {
				t: parseInt(edPos.top) + 60,
				l: parseInt(edPos.right) - 200,
				w: 200,
				h: parseInt(this.pMainObj.pWnd.offsetHeight) - 150
			};
		}
		else
		{
			arVPos[iNum] = {
				t: parseInt(edPos.bottom) - 200,
				l: parseInt(edPos.left),
				w: parseInt(this.pMainObj.pWnd.offsetWidth),
				h: 200
			};
		}
		return arVPos[iNum];
	},

	DelTaskbar: function (pTaskbar, bRedrawTabs)
	{
		if (pTaskbar.pWnd && pTaskbar.pWnd.parentNode)
			pTaskbar.pWnd.parentNode.removeChild(pTaskbar.pWnd);

		//ar_BXTaskbarS[pTaskbar.name + "_" + this.pMainObj.name] = null;
		for(var i = 0; i < this.arTaskbars.length; i++)
		{
			if(pTaskbar.id == this.arTaskbars[i].id)
			{
				this.arTaskbars = BX.util.deleteFromArray(this.arTaskbars, i);
				this.DrawTabs();
				if(this.arTaskbars.length > 0)
					this.ActivateTaskbar(this.arTaskbars[0].id, false);
			}
		}

		if (bRedrawTabs !== false)
		{
			this.pMainObj.oBXTaskTabs.Draw();
			this.pMainObj.oBXTaskTabs.Refresh();
		}

		if(this.arTaskbars.length == 0)
			this.Display(false);
	},

	DrawTabs: function ()
	{
		this.pMoveColumn.style.display = this.arTaskbars.length == 0 ? "none" : "";
		if(this.arTaskbars.length <= 1)
		{
			//this.pBottomColumn.parentNode.style.display = this.pBottomColumn.style.display = 'none';
			this.pBottomColumn.style.display = 'none';
			return;
		}

		//If more than one taskbars for one taskbarsets
		//this.pBottomColumn.parentNode.style.display = this.pBottomColumn.style.display = "";
		this.pBottomColumn.style.display = "";
		BX.cleanNode(this.pBottomColumn);

		var
			_this = this,
			pIconTable = this.pBottomColumn.appendChild(BX.create("TABLE", {props: {className: "bx-taskbar-tabs", unselectable: "on"}})),
			r = pIconTable.insertRow(0), c,
			tabIsAct, cn, k, l = this.arTaskbars.length;

		BX.adjust(r.insertCell(-1), {style: {width: "9px"}}).appendChild(BX.create("DIV", {props: {className: 'tabs_common bx_btn_tabs_0a'}}));

		this.sActiveTaskbar = this.arTaskbars[0].id;

		for(k = 0; k < l; k++)
		{
			tabIsAct = true;
			if (k != 0)
			{
				BX.adjust(r.insertCell(-1), {style: {width: "9px"}}).appendChild(BX.create("DIV", {props: {className: 'tabs_common ' + (k==1 ? 'bx_btn_tabs_ad' : 'bx_btn_tabs_dd')}}));
				tabIsAct = false;
			}

			c = BX.adjust(r.insertCell(-1), {props: {className: tabIsAct ? 'bx-tsb-tab-act' : 'bx-tsb-tab'}, style:{width: "0%"}, html: '<span unselectable="on" class="bx-tsb-title">' + this.arTaskbars[k].title + '</span>'});
			c.tid = this.arTaskbars[k].id;
			c.onclick = function (e){_this.ActivateTaskbar(this.tid);};
		}

		BX.adjust(r.insertCell(-1), {style: {width: "9px"}}).appendChild(BX.create("DIV", {props: {className: 'tabs_common bx_btn_tabs_d0'}}));
		BX.adjust(r.insertCell(-1), {props: {className: "bxedtaskbaricontable", unselectable: "on"}});
	},

	ActivateTaskbar: function(id, bSave)
	{
		if (this.bShowing && this.bFirstDisplay)
			this.Show();

		BX.cleanNode(this.pDataColumn);
		BX.cleanNode(this.pTitleColumn);
		var j, i, l = this.arTaskbars.length, oActiveTaskbar;

		for(j = 0; j < l; j++)
		{
			this.arTaskbars[j].bActivated = false;
			if(this.arTaskbars[j].id == id)
			{
				this.pDataColumn.appendChild(this.arTaskbars[j].pWnd);
				this.pTitleColumn.appendChild(this.arTaskbars[j].pHeaderTable);

				this.arTaskbars[j].pWnd.style.display = "";
				this.sActiveTaskbar = id;

				oActiveTaskbar = this.arTaskbars[j];
				this.arTaskbars[j].bActivated = true;
				//this.Resize(); // ???
			}
			SETTINGS[this.pMainObj.name].arTaskbarSettings[this.arTaskbars[j].name].active = this.arTaskbars[j].bActivated;
		}

		if(this.pBottomColumn.childNodes[0])
		{
			var tsb_cells = this.pBottomColumn.childNodes[0].rows[0].cells;
			for(i = 0; i < tsb_cells.length - 1; i++)
			{
				if (i == 0)
				{
					if (tsb_cells[1].tid == id)
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_0a';
					else
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_0d';
					continue;
				}
				else if (i == tsb_cells.length - 2)
				{
					if (tsb_cells[tsb_cells.length-3].tid==id)
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_a0';
					else
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_d0';
				}
				else if((i+1)%2==0)
				{
					//TaskbarTasb cells
					if (tsb_cells[i].tid==id)
					{
						tsb_cells[i].className = 'bxedtaskbaricontableact';
						tsb_cells[i].style.backgroundImage = 'url(' + image_path + '/taskbar_tabs/a-bg.gif)';
					}
					else
					{
						tsb_cells[i].className = 'bxedtaskbaricontable';
						tsb_cells[i].style.backgroundImage = 'url(' + image_path + '/taskbar_tabs/d-bg.gif)';
					}
				}
				else
				{
					//switching between tabs
					if (tsb_cells[i-1].tid==id)
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_ad';
					else if (tsb_cells[i+1].tid==id)
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_da';
					else
						tsb_cells[i].firstChild.className = 'tabs_common bx_btn_tabs_dd';
				}
			}
			tsb_cells = null;
		}

		if (this.pMainObj.oBXTaskTabs)
			this.pMainObj.oBXTaskTabs.Refresh();

		if (bSave !== false)
			this.SaveConfig();
	}
}


function BXTaskbar()
{
}

BXTaskbar.prototype = {
Create: function(name, pMainObj, title, dx, dy)
{
	this.name = name;
	ar_BXTaskbarS[this.name + "_" + pMainObj.name] = this;
	this.pMainObj = pMainObj;
	this.pref = this.pMainObj.name.toUpperCase()+'_BXTaskBar_';
	this.id = "tb_" + Math.round(Math.random() * 100000);
	this.bVertical = false;
	this.title = title;
	this.bDeleted = false;
	this.thirdlevel = false;
	var _this = this;
	this.fullyLoaded = true;
	this.bActivated = false;

	if (!SETTINGS[this.pMainObj.name].arTaskbarSettings[this.name])
		SETTINGS[this.pMainObj.name].arTaskbarSettings[this.name] = arTaskbarSettings_default[this.name];

	this.bActive = SETTINGS[this.pMainObj.name].arTaskbarSettings[this.name].active;

	this.pWnd = BX.create("DIV", {props: {className: "bxedtaskbar", unselectable: "on"}});
	this.rootElementsCont = BX.create("DIV", {props: {className: "bxedtaskbar-root"}});
},

OnCreate: function()
{
	// Create taskbar title
	var _this = this;
	var pHeaderTable = this.pTaskbarSet.pTitleColumn.appendChild(BX.create("TABLE", {props: {className: "bxedtaskbartitletext"}}));

	pHeaderTable.setAttribute("__bxtagname", "_taskbar_default");
	this.pHeaderTable = pHeaderTable;

	var r = pHeaderTable.insertRow(-1);

	this.iconDiv = BX.adjust(r.insertCell(-1), {props: {className: 'def'}, style: {width: "1%", paddingLeft: "2px"}}).appendChild(BX.create("DIV"));
	BX.adjust(r.insertCell(-1), {props: {className: "head_text", noWrap: true, unselectable: "on"}, text: this.title});
	var cmBut = BX.adjust(r.insertCell(-1), {props:{className: "head-button-menu", title: BX_MESS.Actions}}).appendChild(BX.create("DIV"));

	cmBut.onmouseover = function(e)
	{
		this.style.margin =  "0px";
		this.style.border =  "#4B4B6F 1px solid";
		this.style.backgroundColor = "#FFC678";
	};
	cmBut.onmouseout = function(e)
	{
		this.style.margin =  "1px";
		this.style.borderStyle = "none";;
		this.style.backgroundColor = "transparent";
	};
	cmBut.onclick = function(e)
	{
		var _bxtgn = pHeaderTable.getAttribute("__bxtagname");
		if (!_bxtgn)
			return;

		var pos = BX.pos(this);
		pos.left += 22;
		pos.top += 20;
		oBXContextMenu.Show(2500, 0, pos, false, {pTaskbar: _this, bxtagname: _bxtgn}, _this.pMainObj, true);
	};

	var hideBut = BX.adjust(r.insertCell(-1), {props:{className: "head-button-hide", title: BX_MESS.Hide}, style: {width: "20px"}}).appendChild(BX.create("DIV"));
	hideBut.onclick = function(e)
	{
		_this.pTaskbarSet.Hide();
		SETTINGS[_this.pMainObj.name].arTBSetsSettings[_this.pTaskbarSet.iNum].show = false;
		_this.pTaskbarSet.SaveConfig();
	};

	if(this.OnTaskbarCreate)
		this.OnTaskbarCreate();
},

SetActive: function ()
{
	if(this.pTaskbarSet)
		this.pTaskbarSet.ActivateTaskbar(this.id);
},

Close: function(bRedrawTabs, bSaveConfig)
{
	SETTINGS[this.pMainObj.name].arTaskbarSettings[this.name].show = false;
	SETTINGS[this.pMainObj.name].arTaskbarSettings[this.name].active = false;
	ar_BXTaskbarS[this.name + "_" + this.pMainObj.name].bDeleted = true;

	if(this.pTaskbarSet)
	{
		if (bSaveConfig !== false)
			this.pTaskbarSet.SaveConfig();
		this.pTaskbarSet.DelTaskbar(this, bRedrawTabs);
	}
},

SetContent: function (sContent)
{
	this.pWnd.innerHTML = sContent;
},

CreateScrollableArea: function (pParent)
{
	return pParent;
	return pParent.appendChild(BX.create("DIV", {props: {className: "bx-taskbar-scroll"}}));

	var res = this.pMainObj.pDocument.createElement("DIV");
	res.style.position = "relative";
	res.style.left = "0px";
	res.style.right = "0px";
	res.style.width = "100%";
	res.style.height = "100%";
	pParent = pParent.appendChild(res);
	res = null;

	res = this.pMainObj.pDocument.createElement("DIV");
	res.style.position = "absolute";
	res.style.left = "0px";
	res.style.right = "0px";
	res.style.width = "100%";
	res.style.height = "100%";

	if(!BX.browser.IsIE())
		res.style.overflow = "-moz-scrollbars-vertical";

	//res.style.overflowY = "scroll";
	res.style.overflowY = "auto";
	res.style.overflowX = "hidden";

	res.style.scrollbar3dLightColor = "#C0C0C0";
	res.style.scrollbarArrowColor = "#252525";
	res.style.scrollbarBaseColor = "#C0C0C0";
	res.style.scrollbarDarkShadowColor = "#252525";
	res.style.scrollbarFaceColor = "#D4D4D4";
	res.style.scrollbarHighlightColor = "#EFEFEF";
	res.style.scrollbarShadowColor = "#EFEFEF";
	res.style.scrollbarTrackColor = "#DFDFDF";


	pParent = pParent.appendChild(res);
	res = null;

	return pParent;
},

DisplayElementList: function (arElements, oCont)
{
	BX.cleanNode(oCont);
	var hi, hlen = arElements.length;
	for (hi = 0; hi < hlen; hi++)
		this.DisplayElement(arElements[hi], oCont);
},

DisplayElement: function (arElement, oCont, orderInd, sPath)
{
	if (orderInd == undefined)
		orderInd = -1;

	if (arElement['isGroup'])
		this.DisplayGroupElement(arElement, oCont, orderInd, sPath);
	else
	{
		if (arElement['thirdlevel'])
		{
			if(this.thirdlevel.name && this.thirdlevel.name != arElement['thirdlevel'])
				this.Display3rdLevelSep(oCont,this.thirdlevel.sPath);
			this.DisplaySingleElement(arElement,oCont,orderInd,sPath);
			this.thirdlevel = {
					name  : arElement['thirdlevel'],
					sPath : sPath
				};
		}
		else
		{
			if(this.thirdlevel.name)
			{
				this.Display3rdLevelSep(oCont,this.thirdlevel.sPath);
				this.thirdlevel = [];
			}
			this.DisplaySingleElement(arElement,oCont,orderInd,sPath);
		}
	}

	if (this.rootElementsCont.parentNode)
		this.rootElementsCont.parentNode.removeChild(this.rootElementsCont);
	oCont.appendChild(this.rootElementsCont);
},

DisplaySingleElement: function (oElement, oCont, orderInd, sPath)
{
	if (sPath==undefined)
		sPath='';

	var _oTable = BX.create('TABLE', {props: {className: 'bxgroupblock1', title: BX_MESS.InsertTitle}});
	_oTable.setAttribute('__bxgroup1', '__' + oElement.name);
	var rowTitle = _oTable.insertRow(-1); //Group header
	//Left cell - icon
	var c = BX.adjust(rowTitle.insertCell(-1), {props: {className: 'iconcell1', unselectable: "on"}});

	var _this = this;
	//*** ICON ***
	ic = this.pMainObj.CreateElement('IMG', {src: oElement.icon || (image_path + '/component.gif')});
	ic.onerror = function(){this.src = image_path + '/component.gif';};
	ic.ondragstart = function(){if(window.event) window.event.cancelBubble = true;};
	this.pMainObj.SetBxTag(ic, {tag: oElement.tagname, params: oElement.params});

	if (_this.OnElementClick)
		ic.onclick = function(e){_this.OnElementClick(this, oElement);};

	_oTable.ondblclick = function()
	{
		var ic = BX.findChild(this, {tagName: 'IMG'}, true);
		if (!ic || !ic.id)
			return;

		var draggedElId = ic.id;
		_this.pMainObj.insertHTML('<img src="' + ic.src + '" id="' + ic.id + '">');
		setTimeout(function()
		{
			_this.OnElementDragEnd(_this.pMainObj.pEditorDocument.getElementById(draggedElId));
		}, 20);
	};

	if(BX.browser.IsIE())
	{
		ic.onmousedown = function (e)
		{
			_this.pMainObj.nLastDragNDropElement = this.id;
		};

		ic.ondragend = function (e)
		{
			_this.pMainObj.nLastDragNDropElementFire = false;
			if (_this.OnElementDragEnd != undefined)
				_this.pMainObj.nLastDragNDropElementFire = _this.OnElementDragEnd;
			_this.pMainObj.OnDragDrop();
		};
	}
	else
	{
		ic.onmousedown = function (e)
		{
			_this.pMainObj.SetFocus();
			_this.pMainObj.nLastDragNDropElement = this.id;
			_this.pMainObj.nLastDragNDropElementFire = false;
			if (_this.OnElementDragEnd != undefined)
				_this.pMainObj.nLastDragNDropElementFire = _this.OnElementDragEnd;
		};

		ic.ondragend = function (e) // For Firefox 3.5 and later
		{
			_this.pMainObj.nLastDragNDropElementFire = false;
			if (_this.OnElementDragEnd != undefined)
				_this.pMainObj.nLastDragNDropElementFire = _this.OnElementDragEnd;
			_this.pMainObj.OnDragDrop();
		};
	}
	c.appendChild(ic);
	c.id = 'element_' + oElement.name;
	ic = null;

	//*** TITLE ***
	c = rowTitle.insertCell(-1);
	c.style.paddingLeft = '5px';
	c.className = 'titlecell1';
	c.appendChild(document.createTextNode(oElement.title || oElement.name));

	if (sPath == '')
	{
		this.rootElementsCont.appendChild(_oTable);
	}
	else
	{
		var oGroup = this.GetGroup(oCont, sPath);
		if (oGroup)
			oGroup.rows[1].cells[0].appendChild(_oTable);
	}
},

Display3rdLevelSep: function (oCont,sPath)
{
	var _oSeparator = document.createElement('TABLE');
	_oSeparator.style.width = BX.browser.IsIE() ? '80%' : '100%';
	_oSeparator.style.height = "1px";
	var _oSepTR = _oSeparator.insertRow(-1);
	var _oSepTD = _oSepTR.insertCell(-1);
	_oSepTD.style.backgroundImage = 'url(' + image_path + '/new_taskbars/point.gif)';

	if (sPath=='')
		oCont.appendChild(_oSeparator);
	else
	{
		var oGroup = this.GetGroup(oCont,sPath);
		var childCell = oGroup.rows[1].cells[0];

		childCell.appendChild(_oSeparator);
	}
	_oSepTD = null;
	_oSepTR = null;
	_oSeparator = null;
},

DisplayGroupElement: function (arElement, oCont, orderInd, sPath)
{
	// create group
	var _this = this;
	if (sPath == undefined)
		sPath = '';

	if (sPath=='')
	{
		//Hight level group
		var _oTable = document.createElement('TABLE');
		oCont.appendChild(_oTable);
		_oTable.cellPadding = 0;
		_oTable.cellSpacing = 0;
		_oTable.width = '100%';
		_oTable.className = 'bxgroupblock0';
		_oTable.setAttribute('__bxgroup0', '__'+arElement.name);

		var rowTitle = _oTable.insertRow(-1); //Group header
		c = rowTitle.insertCell(-1); // Plus/Minus cell
		c.className = 'pluscell0';
		c.unselectable = "on";
		c.style.width = '20px';
		c.style.backgroundImage = 'url(' + image_path + '/new_taskbars/part_l.gif)';
		c.appendChild(this.pMainObj.CreateElement("DIV", {className: 'tskbr_common bx_btn_tabs_plus_small', id: this.pref + 'Group_plus_'+arElement.name}));

		c = rowTitle.insertCell(-1); //Central cell - title
		c.className = 'titlecell0';
		c.style.width = '900px';
		c.unselectable = "on";
		c.innerHTML = BXReplaceSpaceByNbsp((arElement.title) ? arElement.title : arElement.name);
		c.style.backgroundImage = 'url(' + image_path + '/new_taskbars/part_l.gif)';

		var rowData = _oTable.insertRow(-1); // Cell with child elements
		rowData.id = this.pref + 'Group_' + arElement.name;
		rowData.style.display = GetDisplStr(0);
		c = rowData.insertCell(-1);
		c.className = 'datacell0';
		c.colSpan = "2";

		arElement.hidden = true;
		rowTitle._el = arElement;
		rowTitle.onclick = function()
		{
			if (_this.PreBuildList && !_this.fullyLoaded)
			{
				var __this = this;
				BX.showWait();
				setTimeout(function()
				{
					_this.PreBuildList();
					_this.HideGroup(__this._el, !__this._el.hidden, 0);
					BX.closeWait();
				}, 1);
			}
			else
				_this.HideGroup(this._el, !this._el.hidden, 0);
		};

		var len = arElement.childElements.length;
		if (len<=0)
			return;

		for (var i=0; i<len; i++)
			this.DisplayElement(arElement.childElements[i],oCont,-1,arElement.name);
	}
	else
	{
		//1st level subgroup
		if (sPath.indexOf(',')!=-1)
			return;

		try
		{
			var oGroup = this.GetGroup(oCont,sPath);
			var childCell = oGroup.rows[1].cells[0];

			var _oTable = document.createElement('TABLE');
			_oTable.cellPadding = 0;
			_oTable.cellSpacing = 0;
			_oTable.width = '100%';
			_oTable.className = 'bxgroupblock1';

			_oTable.setAttribute('__bxgroup1','__'+arElement.name);

			var rowTitle = _oTable.insertRow(-1); //group title
			var c = rowTitle.insertCell(-1); //plus
			c.unselectable = "on";
			c.style.width = '0%';
			c.className = 'pluscell1';
			c.appendChild(this.pMainObj.CreateElement("IMG", {src: one_gif_src, className: 'tskbr_common bx_btn_tabs_plus_big', id: this.pref + 'Plus_1_icon_'+arElement.name}));

			var c = rowTitle.insertCell(-1); //icon
			c.unselectable = "on";
			c.style.width = '0%';
			c.className = 'iconfoldercell1';

			c.appendChild(this.pMainObj.CreateElement("DIV", {className: 'tskbr_common bx_btn_tabs_folder_c', id: this.pref + 'Folder_1_icon_'+arElement.name}));

			c = rowTitle.insertCell(-1); // title
			c.unselectable = "on";
			c.className = 'titlecell1';
			c.innerHTML = (arElement.title) ? arElement.title : arElement.name;

			var rowData = _oTable.insertRow(-1); //Cell with child elements
			rowData.style.display = GetDisplStr(0);
			rowData.id = this.pref + 'Group_1_'+arElement.name;
			c = rowData.insertCell(-1);
			c.className = 'datacell1';
			c.colSpan = "3";

			rowTitle._el = arElement;
			rowTitle.onclick = function(){_this.HideGroup(this._el,!this._el.hidden,1)};

			childCell.appendChild(_oTable);

			arElement.hidden = true;

			var len = arElement.childElements.length;
			if (len<=0)
				return;
			for (var i=0;i<len;i++)
				this.DisplayElement(arElement.childElements[i],oCont,-1,arElement.name);
		}
		catch(e)
		{
			return false;
		}
	}
	rowTitle = null;
	rowData = null;
	rowBottom = null;
	c = null;
	r = null;
},

//sPath - path  in tree
AddElement: function(oElement, oCont, sPath, orderInd)
{
	if (orderInd==undefined)
		orderInd = -1;
	this.DisplayElement(oElement, oCont, orderInd, sPath || "");
},

RemoveElement: function(elName, oCont, sPath)
{
	if (sPath == "")
	{
		var child, __bxgroup;
		for (var i = 0; i < oCont.childNodes.length; i++)
		{
			child = oCont.childNodes[i];
			__bxgroup = child.getAttribute('__bxgroup');
			if (__bxgroup == '__' + elName)
				oCont.removeChild(child);
		}
	}
	else
	{
		var arPath = sPath.split(',');
		var _len = arPath.length;

		if (_len == 0 || _len > 1)
			return false;

		for (var iCh = 0;iCh<oCont.childNodes.length;iCh++)
		{
			try
			{
				var grName = oCont.childNodes[iCh].getAttribute('__bxgroup'), row;
				if(grName == '__'+arPath[0])
				{
					_oCont = BX(this.pref + 'Group_'+arPath[0]);
					for (var j=0;j<_oCont.rows.length;j++)
					{
						row = _oCont.rows[j];
						if (row.cells[0].id=='element_'+elName)
							row.parentNode.removeChild(row);
					}
					break;
				}
			}
			catch(e)
			{
				continue;
			}
		}
	}
	return true;
},

HideGroup: function (arElement, bHide, ilevel)
{
	if (ilevel==undefined)
		ilevel = 0;

	if (ilevel==0)
	{
		var im_plus = BX(this.pref + 'Group_plus_'+arElement.name);
		var elementsGroup = BX(this.pref + 'Group_'+arElement.name);
		if(!bHide)
		{
			arElement.hidden = false;
			elementsGroup.style.display = GetDisplStr(1);
			im_plus.className = 'tskbr_common bx_btn_tabs_minus_small';
		}
		else
		{
			arElement.hidden = true;
			elementsGroup.style.display = GetDisplStr(0);
			im_plus.className = 'tskbr_common bx_btn_tabs_plus_small';
		}
	}
	else if(ilevel==1)
	{
		var plusIcon = BX(this.pref + 'Plus_1_icon_'+arElement.name);
		var groupIcon = BX(this.pref + 'Folder_1_icon_'+arElement.name);
		var elementsGroup1 = BX(this.pref + 'Group_1_'+arElement.name);
		if(!bHide)
		{
			arElement.hidden = false;
			elementsGroup1.style.display = GetDisplStr(1);
			plusIcon.className = 'tskbr_common bx_btn_tabs_minus_big';
			groupIcon.className = "tskbr_common bx_btn_tabs_folder_o";
		}
		else
		{
			arElement.hidden = true;
			elementsGroup1.style.display = GetDisplStr(0);
			plusIcon.className = 'tskbr_common bx_btn_tabs_plus_big';
			groupIcon.className = "tskbr_common bx_btn_tabs_folder_c";
		}
	}
},

GetGroup: function(oCont, sPath)
{
	var arPath = sPath.split(',');
	var len = arPath.length, grName, grName2, newCont;
	if (len<=2)
	{
		for (var iCh = 0; iCh < oCont.childNodes.length; iCh++)
		{
			try
			{
				grName = oCont.childNodes[iCh].getAttribute('__bxgroup0');
				if(grName == '__'+arPath[0])
				{
					if (len==1)
						return oCont.childNodes[iCh];
					else
					{
						newCont = oCont.childNodes[iCh].rows[1].cells[0];
						for (var iCh2 = 0; iCh2<newCont.childNodes.length; iCh2++)
						{
							grName2 = newCont.childNodes[iCh2].getAttribute('__bxgroup1');
							if(grName2 == '__'+arPath[1])
								return newCont.childNodes[iCh2];
						}
					}

				}
			}
			catch(e)
			{
				continue;
			}
		}

	}
	return false;
},

insertHTML: function(_html){this.pMainObj.insertHTML(_html);}
}

//BXPropertiesTaskbar
function BXPropertiesTaskbar()
{
	ar_BXPropertiesTaskbarS.push(this);
	var obj = this;
	obj.bDefault = false;
	obj.emptyInnerHTML = "<br /><span style='padding-left: 15px;'>" + BX_MESS.SelectAnyElement + "</span>";

	BXPropertiesTaskbar.prototype.OnTaskbarCreate = function ()
	{
		this.pHeaderTable.setAttribute("__bxtagname", "_taskbar_properties");
		BX.addClass(obj.pWnd, "bx-props-taskbar")
		this.pMainObj.oPropertiesTaskbar = this;
		this.icon = 'properties';
		this.iconDiv.className = 'tb_icon bxed-taskbar-icon-' + this.icon;
		var table = this.pMainObj.pDocument.createElement("TABLE");
		table.style.width = "100%";
		this.pCellPath = table.insertRow(-1).insertCell(-1);
		this.pCellPath.className = "bxproptagspath";
		this.pCellProps = table.insertRow(-1).insertCell(-1);
		this.pCellProps.style.height = "100%";
		this.pCellProps.vAlign = "top";

		this.pWnd.appendChild(table);

		this.pCellPath.style.height = "0%";
		this.pCellProps.style.height = "100%";

		this.pCellProps = this.CreateScrollableArea(this.pCellProps);
		this.pCellProps.className = "bxtaskbarprops";
		this.pCellProps.innerHTML = obj.emptyInnerHTML;

		this.pMainObj.AddEventHandler("OnSelectionChange", obj.OnSelectionChange);

		table = null;
	}

	BXPropertiesTaskbar.prototype.OnSelectionChange = function (sReloadControl, pElement)
	{
		try{ // In split mode in IE fast view mode changing occurs Permission denied ERROR
		if (!obj.bActivated || !obj.pTaskbarSet.bShowing)
			return;

		var oSelected, pElementTemp, strPath = '';
		if (pElement)
			oSelected = pElement;
		else
			pElement = oSelected = obj.pMainObj.GetSelectionObject();

		if (pElement && pElement.ownerDocument != obj.pMainObj.pEditorDocument)
		{
			try{
				var pBody = obj.pMainObj.pEditorDocument.body;
				pElement = pBody.lastChild || pBody.appendChild(obj.pMainObj.pEditorDocument.createElement('BR'));
				obj.pMainObj.SelectElement(pElement);
			}catch(e){}
		}

		if(sReloadControl == "always" || !obj.oOldSelected || !BXElementEqual(oSelected, obj.oOldSelected))
		{
			obj.oOldSelected = oSelected;
			BX.cleanNode(obj.pCellPath);

			var tPath = BX.create("TABLE");
			tPath.className = "bxproptagspathinl";
			tPath.cellSpacing = 0;
			tPath.cellPadding = 1;
			var
				bxTag,
				rPath = tPath.insertRow(-1),
				cPath, pBut, oRange,
				cActiveTag = null,
				fPropertyPanel = null,
				fPropertyPanelElement = null;

			if(obj.pMainObj.pEditorDocument.body.createTextRange)
				oRange = obj.pMainObj.pEditorDocument.body.createTextRange();

			while(pElement && (pElementTemp = pElement.parentNode) != null)
			{
				if(pElementTemp.nodeType !=1 || !pElement.tagName)
				{
					pElement = pElementTemp;
					continue;
				}

				strPath = pElement.tagName.toLowerCase();

				bxTag = obj.pMainObj.GetBxTag(pElement);

				if (bxTag.tag)
				{
					strPath = bxTag.tag;
					fPropertyPanel = false;
					tPath.deleteRow(rPath);
					rPath = tPath.insertRow(-1);
				}

				if(strPath == 'tbody')
				{
					pElement = pElementTemp;
					continue;
				}

				cPath = rPath.insertCell(0);
				if(!fPropertyPanel && pPropertybarHandlers[strPath])
				{
					fPropertyPanel = pPropertybarHandlers[strPath];
					fPropertyPanelElement = pElement;
					cActiveTag = cPath;
				}

				cPath.innerHTML = '&lt;' + strPath + '&gt;';
				cPath.pElement = pElement;
				cPath.oRange = oRange;
				cPath.pMainObj = obj.pMainObj;
				cPath.onclick = function ()
				{
					if(this.oRange && this.oRange.moveToElementText)
					{
						this.oRange.moveToElementText(this.pElement);
						this.oRange.select();
					}
					else
					{
						this.pMainObj.pEditorWindow.getSelection().selectAllChildren(this.pElement);
					}
					this.pMainObj.OnEvent("OnSelectionChange");
				};

				pElement = pElementTemp;
			}

			// temp hack...
			var cPathLast = rPath.insertCell(-1);
			cPathLast.style.width = '100%';
			cPathLast.innerHTML = "&nbsp;";

			var bDefault = false;
			obj.pCellPath.appendChild(tPath);
			if(!fPropertyPanel)
			{
				fPropertyPanel = pPropertybarHandlers['default'];
				fPropertyPanelElement = oSelected;
				bDefault = true;
			}

			if(cActiveTag)
				cActiveTag.className = 'bxactive-tag';

			if(fPropertyPanelElement && fPropertyPanelElement.tagName && (!(obj.oOldPropertyPanelElement && BXElementEqual(fPropertyPanelElement, obj.oOldPropertyPanelElement)) || sReloadControl == "always"))
			{
				var sRealTag = fPropertyPanelElement.tagName.toLowerCase();
				bxTag = obj.pMainObj.GetBxTag(fPropertyPanelElement);

				if (bxTag.tag)
					sRealTag = bxTag.tag;
				obj.oOldPropertyPanelElement = fPropertyPanelElement;

				var bNew = false;
				if((sReloadControl == "always") || (bDefault && obj.bDefault != bDefault) || (!bDefault && (!obj.sOldTag || obj.sOldTag != sRealTag)))
				{
					obj.pMainObj.OnChange("OnPropertyChange", "");
					bNew = true;
					BX.cleanNode(obj.pCellProps);
				}

				obj.sOldTag = sRealTag;

				if(fPropertyPanel)
					fPropertyPanel(bNew, obj, fPropertyPanelElement);

				var w = (parseInt(obj.pTaskbarSet.pDataColumn.parentNode.offsetWidth) - 2);
				obj.pTaskbarSet.pDataColumn.style.width = (w > 0 ? w : 0) + 'px';
				obj.pMainObj.OnEvent("OnPropertybarChanged");
				ar_PROP_ELEMENTS.push(obj);
				obj.bDefault = bDefault;
			}
			tPath = rPath = cPath = pBut = null;
		}
		pElement = null;
		oSelected = null;

		}catch(e){}
		return true;
	}
}
oBXEditorUtils.addTaskBar('BXPropertiesTaskbar', 3 , BX_MESS.CompTBProp, [], 5);

function BXCreateTaskbars(pMainObj)
{
	var _sort = function(arr)
	{
		var l = arr.length, tmp, flag = false, i = 0;
		while (i < l - 1)
		{
			if (arr[i].sort - arr[i + 1].sort > 0)
			{
				tmp = arr[i + 1];
				arr[i + 1] = arr[i];
				arr[i] = tmp;
				i--;
			}
			i++;
		}
	}
	_sort(arBXTaskbars);

	if (!SETTINGS[pMainObj.name].arTaskbarSettings)
		SETTINGS[pMainObj.name].arTaskbarSettings = arTaskbarSettings_default;

	var _old_visualEffects = pMainObj.visualEffects;
	pMainObj.visualEffects = false;
	var i, aroTBSet, l = arBXTaskbars.length, oTB, tbkey, pTaskbar;

	for(i = 0; i < l; i++)
	{
		oTB = arBXTaskbars[i];
		tbkey = oTB.name + "_" + pMainObj.name;

		if (ar_BXTaskbarS[tbkey] && (ar_BXTaskbarS[tbkey].pMainObj.name == pMainObj.name) && !ar_BXTaskbarS[tbkey].bDeleted)
			continue;

		aroTBSet = SETTINGS[pMainObj.name].arTaskbarSettings[oTB.name];
		if (!aroTBSet || !pMainObj.allowedTaskbars[oTB.name])
			continue;

		if (!aroTBSet.show && oTB.name != "BXPropertiesTaskbar")
			continue;

		if (oTB.pos !== 2) // Right or bottom
			oTB.pos = 3;

		if ((oTB.arParams['bWithoutPHP'] === false && !pMainObj.arConfig["bWithoutPHP"]) ||
		oTB.arParams['bWithoutPHP'] !== false)
		{
			BX.extend(window[oTB.name], window.BXTaskbar);
			pTaskbar = new window[oTB.name]();

			pTaskbar.Create(oTB.name, pMainObj, oTB.title);
			pMainObj.arTaskbarSet[oTB.pos].AddTaskbar(pTaskbar, true);
		}
	}

	var tbs, l, i, j, bActivate;
	for(i in pMainObj.arTaskbarSet)
	{
		tbs = pMainObj.arTaskbarSet[i];
		if (!tbs || typeof tbs !== 'object' || !tbs.arTaskbars || !tbs.arTaskbars[0])
			continue;

		l = tbs.arTaskbars.length;

		if (l == 1 && !tbs.bShowing)
		{
			tbs.sActiveTaskbar = tbs.arTaskbars[0].id;
		}
		else
		{
			bActivate = false;
			for (j = 0; j < l; j++)
			{
				if (SETTINGS[pMainObj.name].arTaskbarSettings[tbs.arTaskbars[j].name].active)
				{
					tbs.ActivateTaskbar(tbs.arTaskbars[j].id, false);
					bActivate = true;
					break; // Activate and exit if we find active taskbar
				}
			}

			// If no active taskbars find - activate first
			if (!bActivate)
				tbs.ActivateTaskbar(tbs.arTaskbars[0].id, false);
		}
	}

	if (!pMainObj.oBXTaskTabs)
		pMainObj.oBXTaskTabs = new BXTaskTabs(pMainObj);

	// Refresh Taskbars
	var arTskbrSet = SETTINGS[pMainObj.name].arTaskbarSettings;
	var tId, tTitle, BXTaskbar;
	for (var k in ar_BXTaskbarS)
	{
		BXTaskbar = ar_BXTaskbarS[k];
		if(!pMainObj.CheckTaskbar(BXTaskbar))
			continue;

		tId = BXTaskbar.name;
		if (BXTaskbar.pMainObj.name != pMainObj.name || !arTskbrSet || !arTskbrSet[tId])
			continue;

		if (arTskbrSet[tId].show && !BXTaskbar.pTaskbarSet)
			pMainObj.arTaskbarSet[arTskbrSet[tId].position[0]].AddTaskbar(BXTaskbar, true);
		else if (!arTskbrSet[tId].show && BXTaskbar.pTaskbarSet)
			BXTaskbar.Close(false);
	}

	pMainObj.oBXTaskTabs.Draw();
	pMainObj.oBXTaskTabs.Refresh();

	setTimeout(function(){pMainObj.visualEffects = _old_visualEffects; pMainObj.oBXTaskTabs.Refresh();}, 500);
}

function BXTaskTabs(pMainObj)
{
	this.pMainObj = pMainObj;
	this.bRendered = false;
};

BXTaskTabs.prototype = {
	Draw: function()
	{
		var tbs, i, j, l, k, tb, pTab, _this = this, id;
		this.arTabs = [];
		this.arTabIndex = {};
		BX.cleanNode(this.pTabsCont);

		for(i in this.pMainObj.arTaskbarSet)
		{
			tbs = this.pMainObj.arTaskbarSet[i];
			if (!tbs || typeof tbs !== 'object' || !tbs.arTaskbars || !tbs.arTaskbars.length)
				continue;

			for(j = 0, k = tbs.arTaskbars.length; j < k; j++)
			{
				if (!this.bRendered)
				{
					this.pTabsCont = this.pMainObj.pTaskTabs.appendChild(BX.create("DIV", {props: {className: 'bxed-tasktab-cnt', unselectable : "on"}}));
					this.bRendered = true;
				}

				tb = tbs.arTaskbars[j];
				id = "tab_" + tb.id;

				pTab = BX.create("SPAN", {
					props: {
						id: id,
						className: "bxed-tasktab",
						title: tb.title,
						unselectable: "on"
					},
					events: {
						click: function(){_this.OnClick(this)},
						mouseover:  function(){_this.OnMouseOver(this)},
						mouseout:  function(){_this.OnMouseOut(this)}
					},
					html: '<i class="tasktab-left"></i><span class="tasktab-center"><span class="tasktab-icon bxed-taskbar-icon-' + tb.icon + '" unselectable="on"></span><span class="tasktab-text" unselectable="on">' + tb.title + '</span></span><i class="tasktab-right"></i>'
				});

				this.arTabs.push({
					id: id,
					cont: pTab,
					tb: tb,
					tbs: tbs,
					bPushed: tbs.sActiveTaskbar == tb.id
				});
				this.arTabIndex[id] = this.arTabs.length - 1;

				if (tbs.sActiveTaskbar == tb.id && tbs.bShowing)
					BX.addClass(pTab, "bxed-tasktab-pushed");

				this.pTabsCont.appendChild(pTab);
			}
		}
	},

	Refresh: function()
	{
		var i, l = this.arTabs.length, tab, bAct;
		for(i = 0; i < l; i++)
		{
			tab = this.arTabs[i];
			bAct = (tab.tbs.bShowing && tab.tb.id == tab.tbs.sActiveTaskbar);

			if (tab.bPushed == bAct)
				continue;

			tab.bPushed = bAct;
			if (bAct)
				BX.addClass(tab.cont, "bxed-tasktab-pushed");
			else
				BX.removeClass(tab.cont, "bxed-tasktab-pushed");
		}
	},

	OnClick: function(pObj)
	{
		var oTab = this.arTabs[this.arTabIndex[pObj.id]];
		if (oTab.bPushed)
		{
			oTab.bPushed = false;
			BX.removeClass(pObj, "bxed-tasktab-pushed");
			oTab.tbs.Hide();
		}
		else
		{
			oTab.bPushed = true;
			BX.addClass(pObj, "bxed-tasktab-pushed");
			if (!oTab.tbs.bShowing)
				oTab.tbs.Show();
			oTab.tbs.ActivateTaskbar(oTab.tb.id);
		}

		SETTINGS[oTab.tbs.pMainObj.name].arTBSetsSettings[oTab.tbs.iNum].show = oTab.bPushed;
	},

	OnMouseOver: function(pObj)
	{
		BX.addClass(pObj, "bxed-tasktab-over");
	},

	OnMouseOut: function(pObj)
	{
		BX.removeClass(pObj, "bxed-tasktab-over");
	},

	GetVPos: function()
	{
		var edPos = BX.pos(this.pMainObj.pWnd);
		return {
			t: parseInt(edPos.bottom) - 25,
			l: parseInt(edPos.left) + 50,
			w: 300,
			h: 25
		};
	}
}

function BXVisualMinimize(par)
{
	this.oDiv = document.body.appendChild(BX.create('DIV', {props: {className: 'visual_minimize'}, style: {display: 'none'}}));
}

BXVisualMinimize.prototype.Show = function(par)
{
	par.num = BX.browser.IsIE() ? 4 : 8;
	par.time = BX.browser.IsIE() ? 1 : 5;
	this.oDiv.style.display = 'block';

	var
		_this = this,
		i = 0,
		dt = Math.round((par.ePos.t - par.sPos.t) / par.num),
		dl = Math.round((par.ePos.l - par.sPos.l) / par.num),
		dw = Math.round((par.ePos.w - par.sPos.w) / par.num),
		dh = Math.round((par.ePos.h - par.sPos.h) / par.num),
		show = function()
		{
			i++;
			if (i > par.num - 1)
			{
				clearInterval(intId);
				_this.oDiv.style.display = 'none';
				if (par.callback)
					par.callback();
				return;
			}

			_this.oDiv.style.top = (par.sPos.t + dt * i) + 'px';
			_this.oDiv.style.left = (par.sPos.l + dl * i) + 'px';
			_this.oDiv.style.width = Math.abs(par.sPos.w + dw * i) + 'px';
			_this.oDiv.style.height = Math.abs(par.sPos.h + dh * i) + 'px';
		},
		intId = setInterval(show, par.time);
};

function showTranspToggle(arParams)
{
	if (!arParams) return;
	var pMainObj = arParams.pMainObj;
	var e = arParams.e;

	// For main document
	var TranspToggleMove = function(e)
	{
		e = getRealMousePos(e, pMainObj);
		if (arParams.bVertical)
			TranspToggle.style.top = adjustValue(arParams.pos.top, dY + e.realY);
		else
			TranspToggle.style.left = adjustValue(arParams.pos.left, dX + e.realX);
	};

	// For editor document
	var TranspToggleMoveF = function(e)
	{
		e = getRealMousePos(e, pMainObj, true);
		if (arParams.bVertical)
			TranspToggle.style.top = adjustValue(arParams.pos.top, dY + e.realY);
		else
			TranspToggle.style.left = adjustValue(arParams.pos.left, dX + e.realX);
	};

	var adjustValue = function(value, new_value)
	{
		var _cursor = cursor;

		if ((new_value < value) && (value - new_value > maxDiff))
		{
			new_value = value - maxDiff;
			_cursor = "not-allowed";
		}
		else if((new_value > value) && (new_value - value > minDiff))
		{
			new_value = value + minDiff;
			_cursor = "not-allowed";
		}

		if (curCursor != _cursor)
		{
			curCursor = _cursor;
			pBXEventDispatcher.SetCursor(curCursor);
		}

		return new_value + 'px';
	};

	// MouseUp handler
	var TranspToggleMouseUp = function()
	{
		pMainObj.arTaskbarSet[2]._SetTmpClass(true);

		// Clean event handlers
		removeAdvEvent(document, "mousemove", TranspToggleMove, true);
		removeAdvEvent(document, "mouseup", TranspToggleMouseUp, true);
		removeAdvEvent(pMainObj.pEditorDocument, "mousemove", TranspToggleMoveF, true);
		removeAdvEvent(pMainObj.pEditorDocument, "mouseup", TranspToggleMouseUp, true);

		if (BX.browser.IsIE())
		{
			removeAdvEvent(pMainObj.pEditorDocument, "selectstart", preventselect, true);
			removeAdvEvent(document, "selectstart", preventselect, true);
		}

		// Remove toggle
		TranspToggle.style.display = 'none';
		pBXEventDispatcher.SetCursor("default");

		var value = arParams.value - (arParams.bVertical ? (parseInt(TranspToggle.style.top) - arParams.pos.top) : (parseInt(TranspToggle.style.left) - arParams.pos.left));

		if (arParams.callbackObj)
			arParams.callbackFunc.apply(arParams.callbackObj, [value]);
		else
			arParams.callbackFunc(value);
	};

	var
		w, h, dY, dX, cursor, className, top, left,
		maxDiff = arParams.maxValue - arParams.value,
		minDiff = arParams.value - arParams.minValue;
	e = getRealMousePos(e, pMainObj);

	if (arParams.bVertical)
	{
		w = parseInt(arParams.width) + "px",
		h = parseInt(arParams.height ? arParams.height : 6)  + "px";
		dY = e.realY - parseInt(arParams.pos.top) - 6;
		top = (arParams.pos.top + 10) + "px";
		left = arParams.pos.left + "px";
		cursor = "row-resize";
		className = "transp_tog_h";
	}
	else
	{
		h = parseInt(arParams.height) + "px";
		w = parseInt((arParams.width) ? arParams.width : 6) + "px";
		dX = e.realX - parseInt(arParams.pos.left) - 6;
		top = arParams.pos.top + "px";
		left = (arParams.pos.left  + 10) + "px";
		cursor = "col-resize";
		className = "transp_tog_v";
	}
	var curCursor = cursor;
	pBXEventDispatcher.SetCursor(cursor);

	// Create toggle
	var TranspToggle = CACHE_DISPATCHER['TranspToggle'];
	BX.adjust(TranspToggle, {props: {className: className}, style: {display: 'block', width: w, height: h, top: top, left: left}});

	addAdvEvent(document, "mousemove", TranspToggleMove, true);
	addAdvEvent(document, "mouseup", TranspToggleMouseUp, true);
	addAdvEvent(pMainObj.pEditorDocument, "mousemove", TranspToggleMoveF, true);
	addAdvEvent(pMainObj.pEditorDocument, "mouseup", TranspToggleMouseUp, true);

	if (BX.browser.IsIE())
	{
		addAdvEvent(pMainObj.pEditorDocument, "selectstart", preventselect, true);
		addAdvEvent(document, "selectstart", preventselect, true);
	}

	return BX.PreventDefault(e);
}

// # # # # # # # # # # # # # # # #    ONE BIG TOOLBAR # # # # # # # # # # # # # # # #
// For lightMode == true
function BXGlobalToolbar(pMainObj)
{
	this.pMainObj = pMainObj;
	this.oCont = this.pMainObj.pTopToolbarset;
	this.oCont.style.display = this.oCont.parentNode.style.display = "";
	this.oCont.className = "bxedtoolbarset";
	this.oCont.unselectable = "on";
	this.oCont.appendChild(BX.create("DIV", {style: {width: '100%'}}));
}

BXGlobalToolbar.prototype = {
	AddButton: function(pButton)
	{
		this.oCont.firstChild.appendChild(BX.create("DIV", {props: {className: "bx-g-tlbr-but"}})).appendChild(pButton.pWnd);
	},

	LineBegin: function(bFirst)
	{
		// Hack for IE 7
		if (!bFirst && BX.browser.IsIE())
			this.oCont.firstChild.appendChild(BX.create("IMG", {props: {src: one_gif_src, className: "bx-g-tlbr-line-ie"}}));
		this.oCont.firstChild.appendChild(BX.create("DIV", {props: {className: "bx-g-tlbr-line-begin"}}));
	},

	LineEnd: function()
	{
		this.oCont.firstChild.appendChild(BX.create("DIV", {props: {className: "bx-g-tlbr-line-end"}}));
	}
}htmleditor2/editor_php.js000064400000047727150240170740011515 0ustar00var
	one_gif_src = '/bitrix/images/1.gif',
	image_path = '/bitrix/images/fileman/htmledit2',
	c2wait_path = image_path + '/c2waiter.gif',
	global_iconkit_path = image_path + '/_global_iconkit.gif',
	settings_page_path = '/bitrix/admin/fileman_manage_settings.php?sessid=' + BX.bitrix_sessid(),
	editor_action_path = '/bitrix/admin/fileman_editor_action.php?sessid=' + BX.bitrix_sessid(),
	editor_dialog_path = '/bitrix/admin/fileman_editor_dialog.php',
	flash_preview_path = '/bitrix/admin/fileman_flash_preview.php',
	manage_snippets_path = '/bitrix/admin/fileman_manage_snippets.php?lang=' + window.BXLang + '&site=' + window.BXSite + '&sessid=' + BX.bitrix_sessid(),
	to_template_path = window.BX_PERSONAL_ROOT + "/templates/",
	dxShadowImgPath = '';

// Methods for PHP version
BXHTMLEditor.prototype.LoadComponents2 = function(oCallBack)
{
	var callback = function(oCallBack)
	{
		if (!oCallBack.params)
			oCallBack.func.apply(oCallBack.obj);
		else
			oCallBack.func.apply(oCallBack.obj, oCallBack.params);
	};

	if (window.as_arComp2Elements)
		return callback(oCallBack);

	var lc = new JCHttpRequest();
	var count = 0;
	lc.Action = function(result)
	{
		var interval = setInterval
		(
			function()
			{
				if (window.arComp2Elements)
				{
					clearInterval(interval);
					window.as_arComp2Elements = [];
					var l = window.arComp2Elements.length;
					for (var i = 0; i < l; i++)
						as_arComp2Elements[window.arComp2Elements[i].name] = window.arComp2Elements[i];
					callback(oCallBack);
					return;
				}
				if (count > 20)
				{
					clearInterval(interval);
					err_text = "ERROR in pMainObj.LoadComponents2()";
					if ((eind = result.indexOf('Fatal error')) != -1)
						err_text += "\n PHP error: \n\n....." + result.substr(eind - 10);
					alert(err_text);
					callback(oCallBack);
				}
				count++;
			}, 10
		);
	};
	lc.Send('/bitrix/admin/fileman_load_components2.php?lang='+BXLang+'&site='+BXSite+'&load_tree=Y');
};

BXHTMLEditor.prototype.IsSessionExpired = function(result)
{
	if (result.indexOf(this.SessionLostStr) == -1)
		return false;
	var
		i1 = result.indexOf(this.SessionLostStr) + this.SessionLostStr.length,
		sessid = result.substr(i1, result.indexOf('-->') - i1);

	return sessid;
}

BXHTMLEditor.prototype.OnLoad_ex = function()
{
	var _this = this;
	if((!this.arConfig["bWithoutPHP"] || this.limit_php_access) && this.arConfig["use_advanced_php_parser"] == 'Y')
	{
		this.bUseAPP = true; // APP - AdvancedPHPParser
		this.APPConfig =
		{
			arTags_before : ['tbody','thead','tfoot','tr','td','th'],
			arTags_after : ['tbody','thead','tfoot','tr','td','th'],
			arTags :
			{
				'a' : ['href','title','class','style'],
				'img' : ['src','alt','class','style']
			}
		};
	}
	else
		this.bUseAPP = false;

	if (this.limit_php_access)
	{
		oBXEditorUtils.addUnParser(function(_node)
		{
			var id, bxTag;
			if (id = _node.arAttributes["id"])
			{
				bxTag = _this.pMainObj.GetBxTag(id);
				if(bxTag.tag && bxTag.tag == 'php_disabled' && bxTag.params && bxTag.params.value)
					return '#PHP' + bxTag.params.value + '#';
			}
			return false;
		});

		oBXEditorUtils.addPropertyBarHandler('php_disabled', function(bNew, pTaskbar, pElement)
		{
			BX.cleanNode(pTaskbar.pCellProps);
			pTaskbar.pCellProps.appendChild(BX.create("SPAN", {text: BX_MESS.LPA_WARNING, style: {padding: '10px'}}));
		});
	}
};


BXHTMLEditor.prototype.APP_Parse = function(sContent)
{
	if (!this.bUseAPP)
		return sContent;

	this.arAPPFragments = [];
	sContent = this.APP_ParseBetweenTableTags(sContent);

	//sContent = this.APP_ParseInAttributes(sContent);
	return sContent;
};

BXHTMLEditor.prototype.APP_ParseBetweenTableTags = function(str)
{
	var _this = this;
	var replacePHP_before = function(str,b1,b2,b3,b4)
	{
		_this.arAPPFragments.push(JS_addslashes(b1));
		return b2+b3+' __bx_php_before=\"#APP'+(_this.arAPPFragments.length-1)+'#\" '+b4;
	};
	var replacePHP_after = function(str,b1,b2,b3,b4)
	{
		_this.arAPPFragments.push(JS_addslashes(b4));
		return b1+'>'+b3+'<'+b2+' style="display:none;"__bx_php_after=\"#APP'+(_this.arAPPFragments.length-1)+'#\"></'+b2+'>';
	};
	var arTags_before = _this.APPConfig.arTags_before;
	var arTags_after = _this.APPConfig.arTags_after;
	var tagName,re;
	// PHP fragments before tags
	for (var i = 0,l = arTags_before.length; i<l; i++)
	{
		tagName = arTags_before[i];
		if (_this.limit_php_access)
			re = new RegExp('#(PHP(?:\\d{4}))#(\\s*)(<'+tagName+'[^>]*?)(>)',"ig");
		else
			re = new RegExp('<\\?(.*?)\\?>(\\s*)(<'+tagName+'[^>]*?)(>)',"ig");
		str = str.replace(re, replacePHP_before);
	}
	// PHP fragments after tags
	for (var i = 0,l = arTags_after.length; i<l; i++)
	{
		tagName = arTags_after[i];
		if (_this.limit_php_access)
			re = new RegExp('(</('+tagName+')[^>]*?)>(\\s*)#(PHP(?:\\d{4}))#',"ig");
		else
			re = new RegExp('(</('+tagName+')[^>]*?)>(\\s*)<\\?(.*?)\\?>',"ig");
		str = str.replace(re, replacePHP_after);
	}
	return str;
};

BXHTMLEditor.prototype.APP_ParseInAttributes = function(str)
{
	var _this = this;
	var replacePHP_inAtr = function(str,b1,b2,b3,b4,b5,b6)
	{
		_this.arAPPFragments.push(JS_addslashes(b5));
		return b1+b2+b3+'""'+' __bx_ex_'+b2+b3+'\"#APP'+(_this.arAPPFragments.length-1)+'#\"'+b6;
	};
	var arTags = _this.APPConfig.arTags;
	var tagName, atrName, atr, i;
	for (tagName in arTags)
	{
		for (i = 0, cnt = arTags[tagName].length; i < cnt; i++)
		{
			atrName = arTags[tagName][i];
			re = new RegExp('(<'+tagName+'(?:[^>](?:\\?>)*?)*?)('+atrName+')(\\s*=\\s*)((?:"|\')?)<\\?(.*?)\\?>\\4((?:[^>](?:\\?>)*?)*?>)',"ig");
			str = str.replace(re, replacePHP_inAtr);
		}
	}
	return str;
};

BXHTMLEditor.prototype.SystemParse_ex = function(sContent)
{
	if(window.lca)
	{
		if (_$arComponents !== false) // _$arComponents - is not empty
		{
			_$lca_only = true;
		}
		else
		{
			_$arComponents = {};
			_$compLength = 0;
		}
	}

	if (this.limit_php_access)
	{
		var _this = this;
		sContent = sContent.replace(/#PHP(\d{4})#/ig, function(s, s1){
			return "<img src=\"/bitrix/images/fileman/htmledit2/php.gif\" id=\"" + _this.SetBxTag(false, {tag: 'php_disabled', params: {value: s1}}) + "\" border=\"0\"/>";});
	}

	//Replacing PHP by IMG
	if(!this.arConfig["bWithoutPHP"] || this.limit_php_access)
		sContent = this.pParser.ParsePHP(sContent);

	return sContent;
};


BXHTMLEditor.prototype.SetCodeEditorContent_ex = function(sContent)
{
	sContent = sContent.replace(/(^[\s\S]*?)(<body.*?>)/i, "");
	if (this.fullEdit)
	{
		this._head = RegExp.$1;
		if (this._body != RegExp.$2)
		{
			this._body = RegExp.$2;
			this.updateBody(this._body);
		}
	}
	sContent = sContent.replace(/(<\/body>[\s\S]*?$)/i, "");

	if (this.fullEdit)
		this._footer = RegExp.$1;

	if (this.fullEdit)
		return this._head+this._body+sContent+this._footer;

	return sContent;
};

BXHTMLEditor.prototype.APP_Unparse = function(sContent)
{
	sContent = this.APP_UnparseBetweenTableTags(sContent);
	sContent = this.APP_UnparseInAttributes(sContent);
	return sContent;
};

BXHTMLEditor.prototype.APP_UnparseBetweenTableTags = function(str)
{
	var _this = this;
	var unreplacePHP_before = function(str, b1, b2, b3)
	{
		if (_this.limit_php_access)
			return '#'+JS_stripslashes(b2)+'#'+b1+b3;
		else
			return '<?'+JS_stripslashes(_this.arAPPFragments[parseInt(b2)])+'?>'+b1+b3;
	};
	var unreplacePHP_after = function(str, b1, b2)
	{
		if (_this.limit_php_access)
			return b1+'#'+JS_stripslashes(b2)+'#';
		else
			return b1+'<?'+JS_stripslashes(_this.arAPPFragments[parseInt(b2)])+'?>';
	}

	var arTags_before = _this.APPConfig.arTags_before;
	var arTags_after = _this.APPConfig.arTags_after;
	var tagName,re;
	// PHP fragments before tags
	for (var i = 0,l = arTags_before.length; i<l; i++)
	{
		tagName = arTags_before[i];
		re = new RegExp('(<'+tagName+'[^>]*?)__bx_php_before="#APP(\\d+)#"([^>]*?>)',"ig");
		str = str.replace(re, unreplacePHP_before);
	}
	// PHP fragments after tags
	for (var i = 0,l = arTags_after.length; i<l; i++)
	{
		tagName = arTags_after[i];
		re = new RegExp('(</'+tagName+'[^>]*?>\\s*)<'+tagName+'[^>]*?__bx_php_after="#APP(\\d+)#"[^>]*?>(?:.|\\s)*?</'+tagName+'>',"ig");
		str = str.replace(re, unreplacePHP_after);
	}
	return str;
};

BXHTMLEditor.prototype.APP_UnparseInAttributes = function(str)
{
	var _this = this;
	un_replacePHP_inAtr = function(str,b1,b2,b3,b4,b5,b6,b7)
	{
		return b1+'"<?'+JS_stripslashes(_this.arAPPFragments[parseInt(b6)])+'?>" '+b3+b7;
	}
	un_replacePHP_inAtr2 = function(str,b1,b2,b3,b4,b5,b6)
	{
		return b1+b4+'"<?'+JS_stripslashes(_this.arAPPFragments[parseInt(b3)])+'?>" '+b6;
	}
	var arTags = _this.APPConfig.arTags;

	var tagName, atrName, atr, i;
	for (tagName in arTags)
	{
		for (i = 0, cnt = arTags[tagName].length; i < cnt; i++)
		{
			atrName = arTags[tagName][i];
			re = new RegExp('(<'+tagName+'(?:[^>](?:\\?>)*?)*?'+atrName+'\\s*=\\s*)("|\')[^>]*?\\2((?:[^>](?:\\?>)*?)*?)(__bx_ex_'+atrName+')(?:\\s*=\\s*)("|\')#APP(\\d+)#\\5((?:[^>](?:\\?>)*?)*?>)',"ig");
			re2 = new RegExp('(<'+tagName+'(?:[^>](?:\\?>)*?)*?)__bx_ex_'+atrName+'\\s*=\\s*("|\')#APP(\\d+)#\\2((?:[^>](?:\\?>)*?)*?'+atrName+'\\s*=\\s*)("|\').*?\\5((?:[^>](?:\\?>)*?)*?>)',"ig");
			str = str.replace(re, un_replacePHP_inAtr);
			str = str.replace(re2, un_replacePHP_inAtr2);
		}
	}
	return str;
};

BXNode.prototype.__ReturnPHPStr = function(arVals, arParams)
{
	var res = "";
	var un = Math.random().toString().substring(2);
	var i=0, val, comm, zn, p, j;
	for(var key in arVals)
	{
		val = arVals[key];
		i++;
		comm = (arParams && arParams[key] && arParams[key].length > 0 ? un + 'x' + i + 'x/' + '/ '+arParams[key] : '');
		res += '\r\n\t\''+key+'\'\t=>\t';

		if(typeof(val)=='object' && val.length>1)
		{
			res += "Array("+comm+"\r\n";
			zn = '';
			for(j=0; j<val.length; j++)
			{
				p = val[j];
				if(zn!='') zn+=',\r\n';
				zn += "\t\t\t\t\t"+this.__PreparePHP(p);
			}
			res += zn+"\r\n\t\t\t\t),";
		}
		else if(typeof(val)=='object' && val[0])
			res += "Array("+this.__PreparePHP(val[0])+"),"+comm;
		else
			res += this.__PreparePHP(val)+","+comm;
	}

	var max = 0;
	var lngth = [], pn, l;
	for(j=1; j<=i; j++)
	{
		p = res.indexOf(un+'|'+j+'|');
		pn = res.substr(0, p).lastIndexOf("\n");
		l = (p-pn);
		lngth[j] = l;
		if(max<l)
			max = l;
	}

	var k;
	for(j=1; j<=i; j++)
	{
		val = '';
		for(k=0; k<(max-lngth[j]+7)/8; k++)
			val += '\t';
		l = new RegExp(un+'x'+j+'x', "g")
		res = res.replace(l, val);
	}

	res = res.replace(/^[ \t,\r\n]*/g, '');
	res = res.replace(/[ \t,\r\n]*$/g, '');
	return res;
};

BXNode.prototype.__PreparePHP = function (str)
{
	str = str.toString();
	if (isPHPBracket(str))
		return trimPHPBracket(str);

	str = str.replace(/\\/g, "\\\\");
	str = str.replace(/'/g, "\\'");
	return "'"+str+"'";
};

BXParser.prototype.ParsePHP = function (str)
{

	var arScripts = [];
	var p = 0, i, bSlashed, bInString, ch, posnext, ti, quote_ch, mm=0, mm2=0;
	while((p = str.indexOf("<?", p)) >= 0)
	{
		mm = 0;
		i = p + 2;
		bSlashed = false;
		bInString = false;
		while(i < str.length-1)
		{
			i++;
			ch = str.substr(i, 1);

			if(!bInString)
			{
				//if it's not comment
				if(ch == "/" && i+1<str.length)
				{
					//find end of php fragment php
					posnext = str.indexOf("?>", i);
					if(posnext==-1)
					{
						//if it's no close tag - so script is unfinished
						p = str.length;
						break;
					}
					posnext += 2;

					ti = 0;
					if(str.substr(i + 1, 1)=="*" && (ti = str.indexOf("*/", i+2))>=0)
						ti += 2;
					else if(str.substr(i+1, 1)=="/" && (ti = str.indexOf("\n", i+2))>=0)
						ti += 1;

					if(ti>0)
					{
						//find begin - "i" and end - "ti" of comment
						// check: what is coming sooner: "END of COMMENT" or "END of SCRIPT"
						if(ti>posnext && str.substr(i+1, 1)!="*")
						{

							//if script is finished - CUT THE SCRIPT
							arScripts.push([p, posnext, str.substr(p, posnext-p)]);
							p = posnext;
							break;
						}
						else
							i = ti - 1; //End of comment come sooner
					}
					continue;
				}
				if(ch == "?" && i+1<str.length && str.substr(i+1, 1)==">")
				{
					i = i+2;
					arScripts.push([p, i, str.substr(p, i-p)]);
					p = i+1;
					break;
				}
			}

			//if(bInString && ch == "\\" && bSlashed)
			if(bInString && ch == "\\")
			{
				bSlashed = true;
				continue;
			}

			if(ch == "\"" || ch == "'")
			{
				if(bInString)
				{
					if(!bSlashed && quote_ch == ch)
						bInString = false;
				}
				else
				{
					bInString = true;
					quote_ch = ch;
				}
			}

			bSlashed = false;
		}

		if(i>=str.length)
			break;

		p = i;
	}
	this.arScripts = [];

	if(arScripts.length > 0)
	{
		var newstr = "";
		var plast = 0, arPHPScript = [], arRes, arTemplate, arScript, str1, strParsed;

		arComponents2 = [];
		arComponents2Length = 0;
		for(i = 0; i < arScripts.length; i++)
		{
			arScript = arScripts[i];
			strParsed = false;
			try{
				for (var j = 0; j < arPHPParsers.length;j++)
				{
					str1 = arPHPParsers[j](arScript[2], this.pMainObj)
					if (str1 && str1.indexOf("<?") == -1)
					{
						strParsed = true;
						break;
					}
				}
			}catch(e) {_alert('ERROR: '+e.message+'\n'+'BXParser.prototype.ParsePHP'+'\n'+'Type: '+e.name);}

			if (strParsed)
				newstr += str.substr(plast, arScript[0] - plast) + str1;
			else if(!this.pMainObj.limit_php_access || (this.pMainObj.limit_php_access && !this.pMainObj.pComponent2Taskbar))
			{
				var id = this.pMainObj.SetBxTag(false, {tag: "php", params: {value : arScript[2]}});
				newstr += str.substr(plast, arScript[0] - plast) + '<img id="' + id + '" src="/bitrix/images/fileman/htmledit2/php.gif" border="0"/>';
			}
			else
			{
				if (window.BS_MESS)
					alert(BS_MESS.LPA_WARNING);
				else
					setTimeout(function(){if(window.BS_MESS){alert(BS_MESS.LPA_WARNING);}}, 1000);

				newstr += str.substr(plast, arScript[0]-plast);
			}

			plast = arScript[1];
		}
		str = newstr + str.substr(plast);
	}
	return str;
};

function isYes(val)
{
	return val && val.toUpperCase() == "Y";
}

function isPHPBracket(val)
{
	return val.substr(0, 2) =='={';
}

function trimPHPBracket(val)
{
	return val.substr(2, val.length - 3);
}

function isNum(val)
{
	var _val = val;
	val = parseFloat(_val);
	if (isNaN(val))
		val = parseInt(_val);
	if (!isNaN(val))
		return _val == val;
	return false;
}

// API BXEditorUtils for PHP
arPHPParsers = [];

BXEditorUtils.prototype.addPHPParser = function(func, pos, extra_access)
{
	if (!extra_access)
		extra_access == false;
	if (!extra_access && limit_php_access)
		return;

	if (pos==undefined || pos ===false)
		arPHPParsers.push(func);
	else
	{
		if (pos<0)
			pos = 0;
		else if (pos > arPHPParsers.length+1)
			pos = arPHPParsers.length+1;

		var newAr = arPHPParsers.slice(0,pos);
		newAr.push(func);
		newAr = newAr.concat(arPHPParsers.slice(pos));
		arPHPParsers = newAr;
		newAr = null;
	}
}


function __PHPParser(){}
__PHPParser.prototype.trimPHPTags = function(str)
{
	if (str.substr(0, 2)!="<?")
		return str;

	if(str.substr(0, 5).toLowerCase()=="<?php")
		str = str.substr(5);
	else
		str = str.substr(2);

	str = str.substr(0, str.length-2);
	return str;
}

__PHPParser.prototype.trimQuotes = function(str, qoute)
{
	str = str.trim();
	if (qoute == undefined)
	{
		f_ch = str.substr(0, 1);
		l_ch = str.substr(0, 1);
		if ((f_ch == '"' && l_ch == '"') || (f_ch == '\'' && l_ch == '\''))
			str = str.substring(1, str.length - 1);
	}
	else
	{
		if (!qoute.length)
			return str;
		f_ch = str.substr(0, 1);
		l_ch = str.substr(0, 1);
		qoute = qoute.substr(0, 1);
		if (f_ch == qoute && l_ch == qoute)
			str = str.substring(1, str.length - 1);
	}
	return str;
}

__PHPParser.prototype.cleanCode = function(str)
{
	var bSlashed = false;
	var bInString = false;
	var new_str = "";
	var i=-1, ch, string_tmp = "", ti, quote_ch, max_i=-1;

	while(i<str.length-1)
	{
		i++;
		ch = str.substr(i, 1);
		if(!bInString)
		{
			if(ch == "/" && i+1<str.length)
			{
				ti = 0;
				if(str.substr(i+1, 1)=="*" && ((ti = str.indexOf("*/", i+2))>=0))
					ti += 2;
				else if(str.substr(i+1, 1)=="/" && ((ti = str.indexOf("\n", i+2))>=0))
					ti += 1;

				if(ti>0)
				{
					if(i>ti)
						alert('iti='+i+'='+ti);
					i = ti;
				}

				continue;
			}

			if(ch == " " || ch == "\r" || ch == "\n" || ch == "\t")
				continue;
		}

		//if(bInString && ch == "\\" && !bSlashed)
		if(bInString && ch == "\\")
		{
			bSlashed = true;
			new_str += ch;
			continue;
		}

		if(ch == "\"" || ch == "'")
		{
			if(bInString)
			{
				if(!bSlashed && quote_ch == ch)
				{
					bInString = false;
					//new_str += ch;
					//continue;
				}
			}
			else
			{
				bInString = true;
				quote_ch = ch;
				//new_str += ch;
				//continue;
			}
		}
		bSlashed = false;
		new_str += ch;
	}
	return new_str;
};


__PHPParser.prototype.parseFunction = function(str)
{
	var pos = str.indexOf("(");
	var lastPos = str.lastIndexOf(")");
	if(pos>=0 && lastPos>=0 && pos<lastPos)
		return {name:str.substr(0, pos),params:str.substring(pos+1,lastPos)};
	else
		return false;
};


__PHPParser.prototype.parseParameters = function(str)
{
	str = this.cleanCode(str);
	var
		prevAr = this.getParams(str),
		tq, j, l = prevAr.length;

	for (j = 0; j < l; j++)
	{
		if (prevAr[j].substr(0, 6).toLowerCase()=='array(')
		{
			prevAr[j] = this.getArray(prevAr[j]);
		}
		else
		{
			tq = this.trimQuotes(prevAr[j]);
			if (isNum(tq) || prevAr[j] != tq)
				prevAr[j] = tq;
			else
				prevAr[j] = this.wrapPHPBrackets(prevAr[j]);
		}
	}
	return prevAr;
};


__PHPParser.prototype.getArray = function(_str)
{
	var resAr = {}; //var resAr = [];
	if (_str.substr(0, 6).toLowerCase()!='array(')
		return _str;
	_str = _str.substring(6, _str.length-1);
	var tempAr = this.getParams(_str);
	var f_ch, l_ch, prop_name, prop_val;

	var len = tempAr.length;

	for (var y=0; y < len; y++)
	{
		if (tempAr[y].substr(0, 6).toLowerCase()=='array(')
		{
			resAr[y] = this.getArray(tempAr[y]);
			continue;
		}

		var p = tempAr[y].indexOf("=>");

		if (p==-1)
		{
			if (tempAr[y] == this.trimQuotes(tempAr[y]))
				resAr[y] = this.wrapPHPBrackets(tempAr[y]);
			else
				resAr[y] = this.trimQuotes(tempAr[y]);
		}
		else
		{
			prop_name = this.trimQuotes(tempAr[y].substr(0,p));
			prop_val = tempAr[y].substr(p+2);
			if (prop_val == this.trimQuotes(prop_val))
				prop_val = this.wrapPHPBrackets(prop_val);
			else
				prop_val = this.trimQuotes(prop_val);

			if (prop_val.substr(0, 6).toLowerCase()=='array(')
				prop_val = this.getArray(prop_val);

			resAr[prop_name] = prop_val;
		}
	}
	return resAr;
};


__PHPParser.prototype.wrapPHPBrackets = function(str)
{
	str = str.trim();
	f_ch = str.substr(0,1);
	l_ch = str.substr(0,1);
	if ((f_ch=='"' && l_ch=='"') || (f_ch=='\'' && l_ch=='\''))
		return str;

	return "={"+str+"}";
};

__PHPParser.prototype.getParams = function(params)
{
	var arParams = [];
	var sk = 0, ch, sl, q1=1,q2=1;
	var param_tmp = "";
	for(var i=0; i<params.length; i++)
	{
		ch = params.substr(i, 1);
		if (ch=="\"" && q2==1 && !sl)
			q1 *=-1;
		else if (ch=="'" && q1==1  && !sl)
			q2 *=-1;
		else if(ch=="\\"  && !sl)
		{
			sl = true;
			param_tmp += ch;
			continue;
		}


		if (sl)
			sl = false;

		if (q2==-1 || q1==-1)
		{
			param_tmp += ch;
			continue;
		}

		if(ch=="(")
			sk++;
		else if(ch==")")
			sk--;
		else if(ch=="," && sk==0)
		{
			arParams.push(param_tmp);
			param_tmp = "";
			continue;
		}

		if(sk<0)
			break;

		param_tmp += ch;
	}
	if(param_tmp!="")
		arParams.push(param_tmp);

	return arParams;
};

function _GAttrEx(pEl, atrName, atrNameEX,pTaskbar)
{
	var
		returnPHP_atr = function(str, b1){return '<?'+JS_stripslashes(pTaskbar.pMainObj.arAPPFragments[parseInt(b1)])+'?>';},
		v = GAttr(pEl, atrNameEX);

	if (v.length > 0 && pTaskbar.pMainObj.bUseAPP)
		return  v.replace(/#APP(\d+)#/ig, returnPHP_atr);

	return GAttr(pEl, atrName);
}

function _SAttrEx(pEl,atrName,atrNameEX,val,pTaskbar)
{
	if (pTaskbar.pMainObj.bUseAPP && val.substr(0, 2) == '<?' && val.substr(val.length-2,2) == '?>')
	{
		var rep = function(str,b1)
		{
			var v = GAttr(pEl, atrNameEX), i;
			if (v.length > 0)
				i = parseInt(v.slice(4,-1));
			else
			{
				pTaskbar.pMainObj.arAPPFragments.push(JS_addslashes(b1));
				i = pTaskbar.pMainObj.arAPPFragments.length - 1;
				SAttr(pEl, atrNameEX, '#APP'+i+'#');
				SAttr(pEl, atrName, " ");
			}
			pTaskbar.pMainObj.arAPPFragments[i] = JS_addslashes(b1);
		}
		val.replace(/<\?((?:.|\s)*?)\?>/ig, rep);
	}
	else
	{
		pEl.removeAttribute(atrNameEX);
		SAttr(pEl, atrName, val);
	}
}


htmleditor2/parser.js000064400000052230150240170740010635 0ustar00var reBlockElements = /^(HTML|HEAD|BODY|BR|TITLE|TABLE|SCRIPT|TR|TBODY|P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI)$/i;

// Some methods of this class is in the editor_php.js/editor_aspx.js
function BXNode(parent)
{
	this.oParent = parent;
	this.iLevel = 0;
	if(parent)
	{
		parent.arNodes[parent.arNodes.length] = this;
		this.iLevel = parent.iLevel+1;
	}
	this.arNodes = [];
	this.arAttributes = {};
	this.type = null;
	this.text = "";
}

BXNode.prototype = {
GetHTML: function(bFormatted)
{
	//try{
		var id = this.arAttributes["id"];
		if (id)
		{
			var bxTag = this.pParser.pMainObj.GetBxTag(id);
			if(bxTag.tag)
			{
				switch(bxTag.tag)
				{
					case 'img':
						if (!bxTag.params)
							return '';

						// width, height
						var
							w = this.arStyle.width || this.arAttributes.width || '',
							h = this.arStyle.height || this.arAttributes.height || '';

						if (~w.indexOf('%'))
							w = parseInt(w) + '%';
						if (~h.indexOf('%'))
							h = parseInt(h) + '%';
						if (w && !isNaN(w))
							bxTag.params.width = w;
						if (h && !isNaN(h))
							bxTag.params.height = h;

						bxTag.params['class'] = this.arAttributes['class'] ||'';
						bxTag.params['align'] = this.arAttributes['align'] ||'';

						var i, res = '<img ';
						for (i in bxTag.params)
							if (bxTag.params[i])
							{
								if (this.pParser.isPhpAttribute(bxTag.params[i]))
									res += i + '="' + bxTag.params[i] + '" ';
								else
									res += i + '="' + BX.util.htmlspecialchars(bxTag.params[i]) + '" ';
							}
						res += ' />';

						return res;
					case 'a':
						if (!bxTag.params)
							return '';

						bxTag.params['class'] = this.arAttributes['class'] ||'';

						var i, res = '<a ';
						for (i in bxTag.params)
							if (bxTag.params[i] && i != 'noindex')
							{
								if (this.pParser.isPhpAttribute(bxTag.params[i]))
									res += i + '="' + bxTag.params[i] + '" ';
								else if (i == 'href')
									res += i + '="' + bxTag.params[i] + '" ';
								else
									res += i + '="' + BX.util.htmlspecialchars(bxTag.params[i]) + '" ';
							}
						res += '>';

						for(i = 0; i < this.arNodes.length; i++)
							res += this.arNodes[i].GetHTML(bFormatted);

						res += '</a>';

						if (bxTag.params.noindex)
							res = '<noindex>' + res + '</noindex>';

						return res;
					case 'php':
						var pMainObj = this.pParser.pMainObj;
						if (pMainObj.bDotNet || (pMainObj.limit_php_access && pMainObj.pComponent2Taskbar))
							break;
						return bxTag.params.value;
					case 'noscript':
					case 'noindex':
						var res = "", i;
						for(i = 0; i < this.arNodes.length; i++)
							res += this.arNodes[i].GetHTML(bFormatted);
						return "<" + bxTag.tag + ">" + res + "</" + bxTag.tag + ">";
					case 'break':
						return '<BREAK />';
					case 'break_page':
						return '<div style="page-break-after: always"><span style="display: none">&nbsp;</span></div>';
					case 'hr':
						if (!BX.browser.IsIE() && bxTag.params && bxTag.params.value)
							return bxTag.params.value;
						break;
					case 'flash':
						if (!bxTag.params)
							return '';
						var i, res = '<embed type="application/x-shockwave-flash" pluginspage="http:/' + '/www.macromedia.com/go/getflashplayer" ';
						for (i in bxTag.params)
							if (bxTag.params[i])
								res += i + '="' + bxTag.params[i] + '" ';
						res += '></embed>';
						return res;
					case 'cursor':
						return '#BXCURSOR#';
					default:
						var customRes = this.CustomUnParse();

						if (customRes)
							return customRes;

						// Symbols
						if (this.pParser.arSym[bxTag.tag])
							return this.pParser.arSym[bxTag.tag][0];

						// comments, script
						if (bxTag.params && bxTag.params.value)
							return '\n' + bxTag.params.value + '\n';
				}
			}
		}

		if(this.arAttributes["_moz_editor_bogus_node"])
			return '';

		var f;
		this.bDontUseSpecialchars = false;
		for (var i = 0, l = arNodeUnParsers.length; i < l; i++)
		{
			f = arNodeUnParsers[i];
			if (f && typeof(f) == 'function')
				f(this, this.pParser.pMainObj);
		}

		res = this.GetHTMLLeft();

		var bNewLine = false;
		var sIndent = '';

		if(bFormatted && this.type != 'text')
		{
			if(reBlockElements.test(this.text) && !(this.oParent && this.oParent.text && this.oParent.text.toLowerCase() == 'pre'))
			{
				for(var j = 0; j < this.iLevel - 3; j++)
					sIndent += "  ";
				bNewLine = true;
				res = "\r\n" + sIndent + res;
			}
		}

		for(var i=0; i< this.arNodes.length; i++)
			res += this.arNodes[i].GetHTML(bFormatted);

		res += this.GetHTMLRight();
		if(bNewLine)
			res += "\r\n" + (sIndent=='' ? '' : sIndent.substr(2));

		return res;
	//}catch(e){_alert("Error BXNode.prototype.GetHTML : \n type = "+this.type+"\ntext = "+this.text);}
},

CustomUnParse: function(res)
{
	if (!res)
		res = false;

	var fUnParser, i, l;
	for (i = 0, l = arBXTaskbars.length; i < l; i++)
	{
		fUnParser = window[arBXTaskbars[i].name].prototype.UnParseElement;
		if (fUnParser)
			arUnParsers.push(fUnParser);
	}

	for (var j = 0; j < arUnParsers.length; j++)
	{
		fUnParser = arUnParsers[j];
		if (fUnParser)
		{
			res = fUnParser(this, this.pParser.pMainObj);
			if (res !== false)
				break;
		}
	}

	return res;
},

IsPairNode: function()
{
	return (this.text.substr(0, 1) != 'h' && this.text != 'br' && this.text != 'img' && this.text != 'input');
},

GetHTMLLeft: function()
{
	if(this.type == 'text')
		return this.bDontUseSpecialchars ? this.text : bxhtmlspecialchars(this.text);

	var atrVal, attrName, res;
	if(this.type == 'element')
	{
		res = "<"+this.text;

		for(attrName in this.arAttributes)
		{
			atrVal = this.arAttributes[attrName];
			if(attrName.substring(0,4).toLowerCase() == '_moz')
				continue;

			if(this.text.toUpperCase()=='BR' && attrName.toLowerCase() == 'type' && atrVal == '_moz')
				continue;

			if(attrName == 'style')
			{
				if (atrVal.length > 0 && atrVal.indexOf('-moz') != -1)
					atrVal = BX.util.trim(atrVal.replace(/-moz.*?;/ig, '')); // Kill -moz* styles from firefox

				if (this.text == 'td')
				{
					// Kill border-image: none; styles from firefox for <td>
					atrVal = BX.util.trim(atrVal.replace(/border-image:\s*none;/ig, '')); //

					// kill border-color: for ie
					atrVal = BX.util.trim(atrVal.replace(/border-bottom-color:\s*;?/ig, ''));
					atrVal = BX.util.trim(atrVal.replace(/border-top-color:\s*;?/ig, ''));
					atrVal = BX.util.trim(atrVal.replace(/border-right-color:\s*;?/ig, ''));
					atrVal = BX.util.trim(atrVal.replace(/border-left-color:\s*;?/ig, ''));
				}

				if(atrVal.length <= 0)
					 continue;
			}
			res += ' ' + attrName + '="' + (this.bDontUseSpecialchars ? atrVal : bxhtmlspecialchars(atrVal)) + '"';
		}

		if(this.arNodes.length <= 0 && !this.IsPairNode())
			return res+" />";
		return res+">";
	}
	return "";
},

GetHTMLRight: function()
{
	if(this.type == 'element' && (this.arNodes.length>0 || this.IsPairNode()))
		return "</"+this.text+">";
	return "";
}
};

// Some methods of this class is in the editor_php.js/editor_aspx.js
function BXParser(pMainObj)
{
	this.pMainObj = pMainObj;
	this.arSym = {'bxshy' : ['&shy;', '-'], 'bxnbsp' : ['&nbsp;', ' ']};
	this.systemCSS = "img.bxed-anchor{background-image: url(" + global_iconkit_path + ")!important; background-position: -260px 0!important; height: 20px!important; width: 20px!important;}\n" +
	"span.bxed-noscript{color: #0000a0!important; padding: 2px!important; font-style:italic!important; font-size: 90%!important;}\n" +
	"span.bxed-noindex{color: #004000!important; padding: 2px!important; font-style:italic!important; font-size: 90%!important;}\n" +
	"img.bxed-flash{border: 1px solid #B6B6B8!important; background: url(" + image_path + "/flash.gif) #E2DFDA center center no-repeat !important;}\n" +
	"img.bxed-hr{padding: 2px!important; width: 100%!important; height: 2px!important;}\n";
}

BXParser.prototype = {
_RecursiveParse: function (oParentNode, oBXNode)
{
	switch(oParentNode.nodeType)
	{
		case 9:
			oBXNode.type = 'document';
			break;
		case 1:
			if(oParentNode.__bxID && oParentNode.__bxID == this.__bxID)
				return;
			oParentNode.__bxID = this.__bxID;
			if(oParentNode.tagName.length<=0 || oParentNode.tagName.substring(0, 1)=="/")
				return;

			oBXNode.type = 'element';
			oBXNode.text = oParentNode.tagName.toLowerCase();
			var j, attr = oParentNode.attributes, l = attr.length ;
			for(j = 0; j < l; j++)
			{
				if(attr[j].specified || (oBXNode.text == "input" && attr[j].nodeName.toLowerCase()=="value"))
				{
					var attrName = attr[j].nodeName.toLowerCase();
					if(attrName == '__bxid')
						continue;

					if(attrName=="style")
						oBXNode.arAttributes[attrName] = oParentNode.style.cssText;
					else if(attrName=="src" || attrName=="href"  || attrName=="width"  || attrName=="height")
						oBXNode.arAttributes[attrName] = oParentNode.getAttribute(attrName, 2);
					else
						oBXNode.arAttributes[attrName] = attr[j].nodeValue;
				}
			}
			if (oParentNode.style)
				oBXNode.arStyle = oParentNode.style;
			break;
		case 3:
			oBXNode.type = 'text';
			var res = oParentNode.nodeValue;
			if(!(oBXNode.oParent && oBXNode.oParent.text && oBXNode.oParent.text.toLowerCase() == 'pre'))
			{
				res = res.replace(/\n+/g, ' ');
				res = res.replace(/ +/g, ' ');
			}

			oBXNode.text = res;
			break;
	}

	var arChilds = oParentNode.childNodes;
	var oNode, oBXChildNode;

	for(var i = 0; i < arChilds.length; i++)
	{
		oNode = arChilds[i];
		oBXChildNode = new BXNode(oBXNode);
		oBXChildNode.pParser = this;
		this._RecursiveParse(oNode, oBXChildNode);
	}
},

Parse: function ()
{
	// Limit Component Access: if it's not first parsing and all components was converted to html
	if (!this.pMainObj.bDotNet && lca && this.pMainObj.pComponent2Taskbar && _$arComponents !== false && _$LCAContentParser_execed)
	{
		_$arComponents = {};
		_$compLength = 0;
	}

	this.arNodeParams = {};
	this.__bxID = parseInt(Math.random() * 100000) + 1;
	this.pNode = new BXNode(null);
	this.pNode.pParser = this;
	this._RecursiveParse(this.pMainObj.pEditorDocument, this.pNode);
},

GetHTML: function (bFormatted)
{
	return this.pNode.GetHTML(bFormatted);
},

SystemParse: function(sContent)
{
	var _this = this;
	this.strStyleNodes = this.systemCSS;

	sContent = this.ClearFromHBF(sContent);
	sContent = sContent.replace(/(<td[^>]*>)\s*(<\/td>)/ig, "$1<br _moz_editor_bogus_node='on'>$2");

	//TODO: at the beginning of the parsing - replace <? ?> for something,  at the end unparse it back. For easier regexps.
	// Image
	sContent = sContent.replace(/<img([\s\S]*?(?:.*?[^\?%]{1})??)>/ig,
		function(str, s1)
		{
			var arParams = _this.GetAttributesList(s1), i , val, res = "", bPhp = false;

			if (arParams && arParams.id)
			{
				var oTag = _this.pMainObj.GetBxTag(arParams.id);
				if (oTag.tag)
					return str;
			}

			res = "<img id=\"" + _this.pMainObj.SetBxTag(false, {tag: 'img', params: arParams}) + "\" ";
			for (i in arParams)
			{
				if (typeof arParams[i] == 'string' && i != 'id')
				{
					if (i == 'src' && window.SITE_TEMPLATE_PATH )
					{
						var len = SITE_TEMPLATE_PATH.length;
						var src = arParams[i];
						if (arParams[i].indexOf('SITE_TEMPLATE_PATH') != -1)
						{
							src = src.replace(/<\?=\s*SITE_TEMPLATE_PATH;?\s*\?>/i, SITE_TEMPLATE_PATH);
							src = src.replace(/<\?\s*echo\s*SITE_TEMPLATE_PATH;?\s*\?>/i, SITE_TEMPLATE_PATH);
						}
						res += 'src="' + src + '" ';
						continue;
					}

					bPhp = _this.isPhpAttribute(arParams[i]);
					if (!bPhp) // No php in attribute
						res += i + '="' + BX.util.htmlspecialchars(arParams[i]) + '" ';
				}
			}
			res += " />";
			return res;
		}
	);

	// Link
	sContent = sContent.replace(/(<noindex>)*?<a(\s[\s\S]*?(?:.*?[^\?%\/]{1})??)(>([\s\S]*?)<\/a>)(<\/noindex>)*/ig,
		function(str, s0, s1, s2, innerHtml, s3)
		{
			var arParams = _this.GetAttributesList(s1), i , res, bPhp = false;
			if (s0 && s3 && s0.toLowerCase().indexOf('noindex') != -1 && s3.toLowerCase().indexOf('noindex') != -1)
			{
				arParams.noindex = true;
				arParams.rel = "nofollow";
			}

			// It's anchor
			if (arParams.name && (BX.util.trim(innerHtml) == ""))
				return str;

			res = "<a id=\"" + _this.pMainObj.SetBxTag(false, {tag: 'a', params: arParams}) + "\" ";
			for (i in arParams)
			{
				if (typeof arParams[i] == 'string' && i != 'id' && i != 'noindex')
				{
					bPhp = _this.isPhpAttribute(arParams[i]);
					if (i == 'href') // Php in href
					{
						if (bPhp)
							res += 'href="bx_bogus_href" ';
						else
							res += 'href="' + arParams[i] + '" ';
					}
					else if (!bPhp) // No php in attribute
						res += i + '="' + BX.util.htmlspecialchars(arParams[i]) + '" ';
				}
			}
			res += s2;

			return res;
		}
	);

	// APP - Advanced PHP parcer
	if (!this.pMainObj.bDotNet && this.pMainObj.bUseAPP)
		sContent = this.pMainObj.APP_Parse(sContent);

	if (this.pMainObj.bDotNet && this.pMainObj.bUseAAP)
		sContent = this.pMainObj.AAP_Parse(sContent);

	//Parse content as string...
	sContent = this.CustomParse(sContent);

	if (!this.pMainObj.bDotNet)
		sContent = this.pMainObj.SystemParse_ex(sContent);

	sContent = sContent.replace(/<break \/>/ig, "<img src=\"" + image_path + "/break_tag.gif\" id=\"" + this.pMainObj.SetBxTag(false, {tag: 'break'}) + "\"/>");

	// Flash parsing
	sContent = sContent.replace(/<embed([^>]+?)(?:>(?:\s|\S)*?<\/embed)?(?:\/?)?>/ig, function(sContent, s1){return _this.UnparseFlash(sContent, s1);});

	if (BX.browser.IsIE())
	{
		sContent = sContent.replace(/<area([^>]*?>[^>]*?)<\/area>/ig, "<bxarea$1</bxarea>");
		sContent = sContent.replace(/<area([^>]*?>[^>]*?)>/ig, "<bxarea$1>");

		sContent = sContent.replace(/<noindex[^>]*?>([\s\S]*?)<\/noindex>/ig, "<span class=\"bxed-noindex\" id=\"" + this.pMainObj.SetBxTag(false, {tag: 'noindex'}) + "\">$1</span>");
	}
	else
	{
		sContent = sContent.replace(/<hr([^>]*)>/ig, function(sContent, params)
			{
				return '<img class="bxed-hr" src="' + image_path + '/break_page.gif" id="' + _this.pMainObj.SetBxTag(false, {tag: "hr", params: {value : sContent}}) + '"/>';
			}
		);
	}

	sContent = sContent.replace(/<noscript[^>]*?>([\s\S]*?)<\/noscript>/ig, "<span class=\"bxed-noscript\" id=\"" + this.pMainObj.SetBxTag(false, {tag: 'noscript'}) + "\">$1</span>");
	sContent = sContent.replace(/<style[\s\S]*?>([\s\S]*?)<\/style>/gi, function(sContent, s1){return _this.UnparseStyleNode(sContent, s1)});
	sContent = sContent.replace(/<script[\s\S]*?\/script>/gi, function(sContent){return '<img id="' + _this.pMainObj.SetBxTag(false, {tag: "script", params: {value : sContent}}) + '" src="' + image_path + '/script.gif" />';});
	sContent = sContent.replace(/<!--[\s\S]*?-->/ig, function(sContent){return '<img id="' + _this.pMainObj.SetBxTag(false, {tag: "comments", params: {value : sContent}}) + '" src="' + image_path + '/comments.gif" />';});

	sContent = sContent.replace(/<a\s([\s\S]*?)>\s*?<\/a>/ig, function(sContent, s1){return _this.UnparseAnchors(sContent, s1);});
	sContent = sContent.replace(/<a(\s[\s\S]*?)\/>/ig, function(sContent, s1){return _this.UnparseAnchors(sContent, s1);});
	//sContent = sContent.replace(/<a(\s[\s\S]*?)(?:>\s*?<\/a)?(?:\/?)?>/ig, function(sContent, s1){return _this.UnparseAnchors(sContent, s1);});
	sContent = this.SymbolsParse(sContent);

	if (this.strStyleNodes.length > 0)
		setTimeout(function(){_this.AppendCSS(_this.strStyleNodes);}, 300);

	sContent = sContent.replace(/#BXCURSOR#/ig, '<a href="#" id="' + this.pMainObj.lastCursorId + '">|</a>');

	return sContent;
},

GetAttributesList: function(str)
{
	str = " " + str + " ";

	var arParams = {}, arPHP = [], bPhp = false, _this = this;
	// 1. Replace PHP by #BXPHP#
	str = str.replace(/<\?.*?\?>/ig, function(s)
	{
		arPHP.push(s);
		return "#BXPHP" + (arPHP.length - 1) + "#";
	});

	// 2.0 Parse params - without quotes
	str = str.replace(/([^\w]??\s)(\w+?)=([^\s\'"]+?)\s/ig, function(s, b0, b1, b2)
	{
		b2 = b2.replace(/#BXPHP(\d+)#/ig, function(s, num){return arPHP[num] || s;});
		arParams[b1.toLowerCase()] = _this.isPhpAttribute(b2) ? b2 : BX.util.htmlspecialcharsback(b2);
		return b0;
	});

	// 2.1 Parse params
	str = str.replace(/([^\w]??\s)(\w+?)\s*=\s*("|\')([^\3]*?)\3/ig, function(s, b0, b1, b2, b3)
	{
		// 3. Replace PHP back
		b3 = b3.replace(/#BXPHP(\d+)#/ig, function(s, num){return arPHP[num] || s;});
		arParams[b1.toLowerCase()] = _this.isPhpAttribute(b3) ? b3 : BX.util.htmlspecialcharsback(b3);
		return b0;
	});

	return arParams;
},

isPhpAttribute: function(str)
{
	if (typeof str == 'number' || typeof str == 'object')
		return false;
	return str.indexOf("<?") != -1 || str.indexOf("?>") != -1 || (str.indexOf("#PHP") != -1 && this.pMainObj.limit_php_access);
},

SystemUnParse: function(sContent)
{
	if (BX.browser.IsIE())
	{
		sContent = sContent.replace(/<bxarea([^>]*?>[^>]*?)<\/bxarea>/ig, "<area$1</area>");
		sContent = sContent.replace(/<bxarea([^>]*?>[^>]*?)>/ig, "<area$1>");
	}

	// APP - Advanced PHP parcer, AAP - Advanced Aspx Parser
	if (!this.pMainObj.bDotNet && this.pMainObj.bUseAPP)
		sContent = this.pMainObj.APP_Unparse(sContent);
	if (this.pMainObj.bDotNet && this.pMainObj.bUseAAP)
		sContent = this.pMainObj.AAP_Unparse(sContent);

	//Replace entities
	sContent = this.HTMLEntitiesReplace(sContent);
	sContent = this.CustomContentUnParse(sContent);
	return sContent;
},

UnparseAnchors: function(sContent, s1)
{
	if (s1.indexOf("bxid_") != -1)
		return sContent;

	if(sContent.toLowerCase().indexOf("href") > 0)
		return sContent;

	var id = this.pMainObj.SetBxTag(false, {tag: "anchor", params: {value : sContent}});
	return '<img id="' + id + '" src="' + one_gif_src + '" class="bxed-anchor" />';
},

UnparseFlash: function(sContent, s1)
{
	if (s1.indexOf('.swf') === false || s1.indexOf('flash') === false) // not a flash
		return str;

	s1 = s1.replace(/[\r\n]+/ig, ' ');
	s1 = s1.replace(/\s+/ig, ' ');
	s1 = s1.trim();

	var
		arParams = {},
		w, h, style, id;

	s1 = s1.replace(/([^\w]??)(\w+?)\s*=\s*("|\')([^\3]+?)\3/ig, function(s, b0, b1, b2, b3){arParams[b1] = b3; return b0;});

	w = (parseInt(arParams.width) || 50) + 'px';
	h = (parseInt(arParams.height) || 25) + 'px';
	style = 'width: ' + w + '; height: ' + h + ';';

	return '<img id="' + this.pMainObj.SetBxTag(false, {tag: "flash", params: arParams}) + '" class="bxed-flash" style="' + style + '" src="' + one_gif_src + '"/>';
},

GetAnchorName: function(html, newName)
{
	if (newName)
		return html.replace(/([\s\S]*?name\s*=\s*("|'))([\s\S]*?)(\2[\s\S]*?(?:>\s*?<\/a)?(?:\/?)?>)/ig, "$1" + newName + "$4");

	return html.replace(/([\s\S]*?name\s*=\s*("|'))([\s\S]*?)(\2[\s\S]*?(?:>\s*?<\/a)?(?:\/?))?>/ig, "$3");
},

UnparseStyleNode: function(sContent, s1)
{
	if (typeof s1 == 'string' && s1.length > 0)
		this.strStyleNodes += s1 + "\n";

	var id = this.pMainObj.SetBxTag(false, {tag: "style", params: {value : sContent}});
	return '<img id="' + id + '" src="' + image_path + '/style.gif" />';
},

GetHBF: function(sContent, bContentWithHBF)
{
	sContent = sContent.replace(/(^[\s\S]*?)(<body.*?>)/i, "");
	this.pMainObj._head = RegExp.$1;
	this.pMainObj._body = RegExp.$2;
	sContent = sContent.replace(/(<\/body>[\s\S]*?$)/i, "");
	this.pMainObj._footer = RegExp.$1;
	if (!bContentWithHBF)
		return sContent;
	return this.AppendHBF(sContent, true);
},

ClearHBF: function()
{
	this.pMainObj._head = this.pMainObj._body = this.pMainObj._footer = '';
},

AppendHBF: function(sContent, bDontClear)
{
	if (!bDontClear)
		sContent = this.ClearFromHBF(sContent);
	return this.pMainObj._head + this.pMainObj._body + sContent + this.pMainObj._footer;
},

ClearFromHBF: function(sContent)
{
	sContent = sContent.replace(/^[\s\S]*?<body.*?>/i, "");
	sContent = sContent.replace(/<\/body>[\s\S]*?$/i, "");
	return sContent;
},

CustomParse: function(str)
{
	var str1, i, l;
	for (i = 0, l = arContentParsers.length; i < l; i++)
	{
		try{
			str1 = arContentParsers[i](str, this.pMainObj);
			if (str1 !== false && str1 !== null)
				str = str1;
		}catch(e){_alert('ERROR: '+e.message+'\n'+'BXParser.prototype.CustomParse'+'\n'+'Type: '+e.name);}
	}
	return str;
},

CustomContentUnParse: function(str)
{
	try{
		var str1, i, l;
		for (i = 0, l = arContentUnParsers.length; i < l; i++)
			if (str1 = arContentUnParsers[i](str, this.pMainObj))
				str = str1;
	}catch(e){_alert('ERROR: '+e.message+'\n'+'BXParser.prototype.CustomContentUnParse'+'\n'+'Type: '+e.name);}
	return str;
},

HTMLEntitiesReplace: function (str)
{
	var lEn = this.pMainObj.arEntities.length;
	for(var i_ = 0; i_ < lEn; i_++)
		str = str.replace(this.pMainObj.arEntities_h[i_], this.pMainObj.arEntities[i_], 'g');
	return str;
},

DOMHandle: function()
{
	try{
		for (var i = 0, l = arDOMHandlers.length; i < l; i++)
			arDOMHandlers[i](this.pMainObj.pEditorDocument);
	}catch(e){_alert('ERROR: '+e.message+'\n'+'BXParser.prototype.DOMHandle'+'\n'+'Type: '+e.name);}
},

AppendCSS : function(styles)
{
	styles = styles.trim();
	if (styles.length <= 0)
		return false;

	var
		pDoc = this.pMainObj.pEditorDocument,
		pHeads = pDoc.getElementsByTagName("HEAD");

	if(pHeads.length != 1)
		return false;

	if(BX.browser.IsIE())
	{
		setTimeout(function(){pDoc.styleSheets[0].cssText += styles;}, 5);
	}
	else
	{
		var xStyle = pDoc.createElement("STYLE");
		pHeads[0].appendChild(xStyle);
		xStyle.appendChild(pDoc.createTextNode(styles));
	}
	return true;
},

SymbolsParse: function(sContent)
{
	for (var s in this.arSym)
		if (typeof this.arSym[s] == 'object')
			sContent = sContent.replace(new RegExp(this.arSym[s][0], 'ig'), "<span id='" + this.pMainObj.SetBxTag(false, {tag: s}) + "'>" + this.arSym[s][1] + "</span>");

	return sContent;
}
}
htmleditor2/snippets.js000064400000022764150240170740011217 0ustar00var snippets_js = true;
// ========================
window.arSnippets = {};
// ========================

function BXSnippetsTaskbar()
{
	var pListCell;
	var oTaskbar = this;
	oTaskbar._arSnippets = [];

	BXSnippetsTaskbar.prototype.OnTaskbarCreate = function ()
	{
		this.icon = 'snippets';
		this.iconDiv.className = 'tb_icon bxed-taskbar-icon-' + this.icon;
		this.pHeaderTable.setAttribute("__bxtagname", "_taskbar_cached");
		this.oTaskbar = ar_BXTaskbarS["BXSnippetsTaskbar_" + this.pMainObj.name];
		this.oTaskbar.pCellSnipp = this.oTaskbar.CreateScrollableArea(this.oTaskbar.pWnd);

		try{
			this.loadSnippets();
		}catch(e) { _alert('BXSnippetsTaskbar: OnTaskbarCreate');}
	};

	BXSnippetsTaskbar.prototype.loadSnippets = function(clear_cache)
	{
		var _this = this;
		var onload = function()
		{
			_this.BuildList(window.arSnippets);
			BX.closeWait();
		};

		var q = new JCHttpRequest();
		q.Action = function(result){try{setTimeout(onload, 5);}catch(e){_alert('error: loadSnippets');};};

		try{
			q.Send(manage_snippets_path + '&templateID='+oTaskbar.pMainObj.templateID+'&target=load'+(clear_cache === true ? '&clear_snippets_cache=Y' : ''));
		}catch(e){onload();}
	};


	BXSnippetsTaskbar.prototype.BuildList = function (__arElements)
	{
		this.oTaskbar.pMainObj.arSnippetsCodes = [];
		var _this = this, oEl, i, l, _path;
		this.__arGroups = {};
		var addGroup = function(name,path)
		{
			_this.oTaskbar.AddElement({name:name,tagname:'',isGroup:true,childElements:[],icon:'',path:path,code:''},_this.oTaskbar.pCellSnipp,path);
		};

		for (var key in __arElements)
		{
			oEl = __arElements[key];
			if (oEl.path != '')
			{
				arPath = oEl.path.split("/");
				l = arPath.length;
				for (i = 0; i < l; i++)
				{
					if (!this.__arGroups[i])
						this.__arGroups[i] = {};

					if(!this.__arGroups[i][arPath[i]])
					{
						this.__arGroups[i][arPath[i]] = true;
						addGroup(arPath[i], (i == 0) ? '' : arPath[0]);
					}
				}
			}

			oEl.tagname = 'snippet';
			oEl.isGroup = false;
			oEl.icon = '/bitrix/images/fileman/htmledit2/snippet.gif';
			oEl.path = oEl.path.replace("/", ",");
			oEl.code = this.Remove__script__(oEl.code);
			oEl.description = oEl.description;
			oEl.title = oEl.title;

			var c = "sn_"+Math.round(Math.random() * 1000000);
			this.oTaskbar.pMainObj.arSnippetsCodes[c] = key;
			oEl.params = {c : c};

			this.oTaskbar.AddElement(oEl, this.oTaskbar.pCellSnipp, oEl.path);
		}
		this.oTaskbar.AddSnippet_button();
	};

	BXSnippetsTaskbar.prototype.AddSnippet_button = function()
	{
		if (!oTaskbar)
			oTaskbar = this;

		var
			id = "___add_snippet___"+this.oTaskbar.pMainObj.name,
			oDiv = BX(id);
		if (oDiv)
			this.oTaskbar.pCellSnipp.removeChild(oDiv);

		oDiv = this.oTaskbar.pCellSnipp.appendChild(BX.create("DIV", {props: {id: id, className: 'bxed-add-snip-cont'}}));
		oDiv.appendChild(BX.create("A", {props: {href: 'javascript:void("")'}, text: BX_MESS.AddSnippet, events: {click: function(){oTaskbar.addSnippet();	return false;}}}));
	};

	BXSnippetsTaskbar.prototype.Remove__script__ = function (str)
	{
		str = str.toString();
		str = str.replace(/&lt;script/ig, "<script");
		str = str.replace(/&lt;\/script/ig, "</script");
		str = str.replace(/\\n/ig, "\n");
		return str;
	};

	BXSnippetsTaskbar.prototype.OnElementClick = function (oEl, arEl)
	{
		_pTaskbar = this.pMainObj.oPropertiesTaskbar;

		if (!_pTaskbar.bActivated || !_pTaskbar.pTaskbarSet.bShowing)
			return;

		//****** DISPLAY TITLE *******
		var
			_this = this,
			snippetName = arEl.name,
			snippetTitle = arEl.title,
			prCell,
			maxLength = 70,
			snippetShortTitle = (snippetTitle.length > maxLength) ? snippetTitle.substr(0, maxLength) + '...' : snippetTitle,
			key = (arEl.path == '' ? '' : arEl.path.replace(',', '/') + '/')+arEl.name,
			snippetCode = arSnippets[key].code,
			snippetDesc = arSnippets[key].description;

		var
			tCompTitle = BX.create("TABLE", {props: {className: "componentTitle"}, style:{height: "96%"}}),
			row = tCompTitle.insertRow(-1),
			cell = row.insertCell(-1);
		cell.innerHTML = "<table style='width:100%'><tr><td style='width:85%'><SPAN title='" + bxhtmlspecialchars(snippetTitle) + "' class='title'>" + bxhtmlspecialchars(snippetShortTitle) + "  (" + snippetName+")</SPAN><BR /><SPAN class='description'>" + bxhtmlspecialchars(snippetDesc) + "</SPAN></td><td style='width:15%; padding-right: 20px; text-align: right;' align='right'><div style='width: 62px; float: right;'><span id='__edit_snip_but' class= 'iconkit_c' style='width: 29px; display:inline-block; height: 17px; background-position: -29px -62px;' title='"+BX_MESS.EditSnippet+"'></span> <span id='__del_snip_but' class= 'iconkit_c' style='width: 29px; height: 17px; background-position: 0px -62px;  display:inline-block;' title='"+BX_MESS.DeleteSnippet+"'></span></td></tr></table>";

		cell.className = "titlecell";
		cell.width = "100%";
		cell.align = "left";
		row = tCompTitle.insertRow(-1);
		cell = row.insertCell(-1);
		cell.className = "bxcontentcell";

		_tbl = cell.appendChild(document.createElement("TABLE"));
		_tbl.style.width = "100%";
		_tbl.style.height = "100%";
		_r = _tbl.insertRow(-1);

		var thumb = arSnippets[key].thumb;
		if (thumb)
		{
			prCell = _r.insertCell(-1);
			prCell.className = 'bx_snip_preview bx_snip_valign';
			var thumb_src = BX_PERSONAL_ROOT + "/templates/"+arSnippets[key].template+"/snippets/images/"+(arEl.path == '' ? '' : (arEl.path.replace(',', '/')+'/'))+thumb;
			var img = prCell.appendChild(document.createElement("IMG"));
			img.src = thumb_src;
			img.onerror = function(){this.parentNode.removeChild(this);};
		}

		_c = _r.insertCell(-1);
		_c.style.width = "100%";
		_c.className = "bx_snip_valign";

		var _repl_tags = function(str)
		{
			str = str.replace(/</g,'&lt;');
			str = str.replace(/>/g,'&gt;');
			return str;
		};

		var _d = _c.appendChild(BX.create('DIV', {props: {className: 'bx_snip_code_preview'}, html: "<pre>"+_repl_tags(snippetCode)+"</pre>"}));

		BX.cleanNode(_pTaskbar.pCellProps);
		var par_w = parseInt(_pTaskbar.pCellProps.offsetWidth);

		setTimeout(function (){_pTaskbar.pCellProps.appendChild(tCompTitle);}, 10);
		setTimeout(function ()
		{
			var editBut = BX("__edit_snip_but");
			var delBut = BX("__del_snip_but");
			if (!editBut || !delBut)
				return;

			editBut.onclick = function(e){_this.editSnippet(arSnippets[key],oEl);};
			delBut.onclick = function(e){_this.delSnippet(arSnippets[key],oEl);};

			var w = parseInt(tCompTitle.offsetWidth);
			if (!isNaN(par_w) && !isNaN(w) && par_w + 10 < w)
			{
				pr_w = prCell ? parseInt(prCell.offsetWidth) : 0;
				_d.style.width = (par_w - (pr_w || 0) - 40) + 'px';
			}
		}, 100);
	};

	BXSnippetsTaskbar.prototype.OnElementDragEnd = function(oEl)
	{
		var oTag = oTaskbar.pMainObj.GetBxTag(oEl);
		if (oTag.tag != 'snippet')
			return;

		// Run it only when dropped into editor doc
		if (oEl.ownerDocument != oTaskbar.pMainObj.pEditorDocument)
			return oTaskbar.OnElementDragEnd(oTaskbar.pMainObj.pEditorDocument.body.appendChild(oEl.cloneNode(false)));

		var
			allParams = oTag.params,
			html = oTaskbar.pMainObj.pParser.SystemParse(arSnippets[this.pMainObj.arSnippetsCodes[allParams.c]].code);

		if (BX.browser.IsIE())
		{
			this.pMainObj.pEditorDocument.selection.clear();
			this.pMainObj.insertHTML(html);
			if (oEl && oEl.parentNode)
				oEl.parentNode.removeChild(oEl);
		}
		else
		{
			var id = 'bx_editor_snippet_tmp';
			this.pMainObj.insertHTML('<a id="' + id + '" href="#" _moz_editor_bogus_node="on">+</a>');
			var pDoc = this.pMainObj.pEditorDocument;
			setTimeout(function()
			{
				var pTmp = pDoc.getElementById(id);
				if (pTmp)
				{
					pTmp.innerHTML = html;
					setTimeout(function(){
						var pTmp = pDoc.getElementById(id);
						if (pTmp)
						{
							while(pTmp.firstChild)
								pTmp.parentNode.insertBefore(pTmp.firstChild, pTmp);
							if (pTmp.parentNode)
								pTmp.parentNode.removeChild(pTmp);
						}
					}, 50);
				}
			}, 50);
			oEl.parentNode.removeChild(oEl);
		}
		this.pMainObj.oPropertiesTaskbar.OnSelectionChange('always');
	};

	BXSnippetsTaskbar.prototype.addSnippet = function()
	{
		this.pMainObj.OpenEditorDialog("snippets", false, 500, {bUseTabControl: true, mode: 'add', BXSnippetsTaskbar: oTaskbar, PHPGetParams: '&mode=add'});
	};

	BXSnippetsTaskbar.prototype.editSnippet = function(oEl,elNode)
	{
		this.pMainObj.OpenEditorDialog("snippets", false, 500, {bUseTabControl: true, mode: 'edit', BXSnippetsTaskbar: oTaskbar, oEl: oEl, elNode: elNode, prop_taskbar: _pTaskbar.pCellProps});
	};

	BXSnippetsTaskbar.prototype.delSnippet = function(oEl, elNode)
	{
		var _this = this;
		var _ds = new JCHttpRequest();
		_ds.Action = function(result)
		{
			setTimeout(function ()
				{
					if (window.operation_success)
					{
						//Clean properties panel
						BX.cleanNode(_pTaskbar.pCellProps);
						//Remove Element from list
						var _id = elNode.parentNode.id;
						var elTable = elNode.parentNode.parentNode.parentNode.parentNode;
						elTable.parentNode.removeChild(elTable);
						elTable = null;
					}
				}, 5
			);
		}
		if (confirm(BX_MESS.DEL_SNIPPET_CONFIRM+' "'+oEl.title+'"?'))
		{
			window.operation_success = false;
			_ds.Send(manage_snippets_path + '&templateID='+escape(oEl.template)+'&target=delete&name='+escape(oEl.name)+'&path='+escape(oEl.path.replace(',', '/'))+'&thumb='+escape(oEl.thumb));
		}
	};

	BXSnippetsTaskbar.prototype.ClearCache = function(oEl, elNode)
	{
		BX.showWait();
		BX.cleanNode(oTaskbar.pCellSnipp);
		BX.cleanNode(oTaskbar.rootElementsCont);
		window.arSnippets = {};
		oTaskbar.loadSnippets(true);
	};
}

oBXEditorUtils.addTaskBar('BXSnippetsTaskbar', 2, BX_MESS.SnippetsTB, [], 20);
htmleditor2/common.js000064400000116511150240170740010634 0ustar00if (!window.debug_mode)
	debug_mode = false;
function _alert(str) {if (debug_mode) alert("* * * * * * * * debug_mode * * * * * * * * * *\n"+str);}

GLOBAL_pMainObj = {};
var ar_EVENTS = [];
//Array, contains editor objects for manual cleaning and removing than editor unloads: UnloadTrigger()
var ar_PROP_ELEMENTS = [];
var ar_BXButtonS = [];
var ar_BXTaskbarSetS = [];
var ar_BXToolbarS = [];
var ar_BXTaskbarS = {};
var ar_CustomElementS = [];
var ar_BXPropertiesTaskbarS = [];
var ar_EVENTS_DE = [];
//Properties of comp2
window.as_arComp2Params = {};
window.as_arComp2Groups = {};
window.as_arComp2Templates = {};
window.as_arComp2TemplParams = {};
window.arComp2ParamsGroups = {};
window.arComp2Tooltips = {}; // Array with tooltips
var pPropertybarHandlers = []; //PropertyBarHandlers ....
var arUnParsers = [];//Array of unparsers....
var arContentUnParsers = [];//Array of content unparsers....
var arNodeUnParsers = [];
var arEditorFastDialogs = [];

// TOOLBARS SETTINGS
var arToolbarSettings_default = {
	manage: {show : true, docked : true, position : [0,0,0]},
	standart: {show : true, docked : true, position : [0,0,1]},
	style: {show : true,	docked : true, position: [0,1,0]},
	formating: {show : true, docked : true, position : [0,2,0]},
	source: {show : true, docked : true, position : [1,0,0]},
	template: {show : true, docked : true, position : [0,1,2]}
};

// TASKBARS SETTINGS
var arTaskbarSettings_default = {
	BXPropertiesTaskbar: {show : true, set: 3, active: true},
	BXComponents2Taskbar: {show : true, set: 2, active: true}
};
if (!window.arTaskbarSettings)
	window.arTaskbarSettings = arTaskbarSettings_default;

// TASKBARSETS SETTINGS
var arTBSetsSettings_default = {
	2: {show : true, size : 200},
	3: {show : true, size : 160}
};

arComp2PropGroups = [];
arComponents2 = [];
arComponents2Length = 0;

function BXSearchInd(ar, wf)
{
	if (typeof ar != 'object')
		return -1;
	if (ar.length)
	{
		for(var i = 0, l= ar.length; i < l; i++)
			if(ar[i].toString() == wf.toString())
				return i;
	}
	else
	{
		for(var i in ar)
			if (ar[i].toString() == wf.toString())
				return i;
	}
	return -1;
}

if(!String.prototype.trim)
{
    String.prototype.trim = function()
    {
	   var r, re;
	   re = /^\s+/g;
	   r = this.replace(re, "");
	   re = /\s+$/g;
	   r = r.replace(re, "");
	   return r;
    }
}

function BXCreateElement(sTagname, arParams, arStyles, pDocument)
{
	if (!pDocument)
		pDocument = this.pDocument;

	var pEl = pDocument.createElement(sTagname);
	var sParamName;
	if(arParams)
	{
		for(sParamName in arParams)
		{
			if(sParamName.substring(0, 1) == '_' && sParamName != '__exp')
				pEl.setAttribute(sParamName, arParams[sParamName]);
			else
				pEl[sParamName] = arParams[sParamName];
		}
	}

	if(arStyles)
	{
		for(sParamName in arStyles)
			pEl["style"][sParamName] = arStyles[sParamName];
	}
	return pEl;
}

function GAttr(pElement, attr)
{
	if(attr=='className' && !BX.browser.IsIE())
		attr = 'class';
	var v = pElement.getAttribute(attr, 2);
	if(v && v!='-1')
		return v;
	return "";
}

function SAttr(pElement, attr, val)
{
	if(attr == 'className')
		attr = 'class';

	if(val.length <= 0)
		pElement.removeAttribute(attr);
	else
		pElement.setAttribute(attr, val);
}

function _BXStyleParser()
{
	_BXStyleParser.prototype.Create = function()
	{
		if(this.pFrame)
			return;

		this.pFrame = document.body.appendChild(BXCreateElement('IFRAME', {src : 'javascript:void(0)', className : 'bxedpopupframe', frameBorder : 'no', scrolling : 'no', unselectable : 'on'}, {position : 'absolute', zIndex: '9999', left: '-1000px', top: '-1000px'}, document));

		if(this.pFrame.contentDocument && !BX.browser.IsIE())
			this.pDocument = this.pFrame.contentDocument;
		else
			this.pDocument = this.pFrame.contentWindow.document;

		this.pDocument.write("<html><head><style></style></head><body></body></html>");
		this.pDocument.close();
	}

	_BXStyleParser.prototype.Parse = function(strStyles)
	{
		try{
			if(BX.browser.IsIE())
				this.pDocument.styleSheets[0].cssText = strStyles;
			else
				this.pDocument.getElementsByTagName('STYLE')[0].innerHTML = strStyles;
		}catch(e){}

		var arAllSt = [], rules, cssTag, arTags, cssText = '', i, j, k, result = {}, t1, t2, l1;
		if(!this.pDocument.styleSheets)
			return result;

		var x1 = this.pDocument.styleSheets;
		for(i = 0, l1 = x1.length; i < l1; i++)
		{
			rules = (x1[i].rules ? x1[i].rules : x1[i].cssRules);
			for(j = 0, l2 = rules.length; j < l2; j++)
			{
				if (rules[j].type != rules[j].STYLE_RULE)
					continue;

				cssTag = rules[j].selectorText;
				arTags = cssTag.split(",");
				for(k = 0, l3 = arTags.length; k < l3; k++)
				{
					t1 = arTags[k].split(" ");
					t1 = t1[t1.length - 1].trim();
					if(t1.substr(0, 1) == '.')
					{
						t1 = t1.substr(1);
						t2 = 'DEFAULT';
					}
					else
					{
						t2 = t1.split(".");
						if(t2.length > 1)
							t1 = t2[1];
						else
							t1 = '';
						t2 = t2[0].toUpperCase();
					}

					if(arAllSt[t1])
						continue;
					arAllSt[t1] = true;

					if(!result[t2])
						result[t2] = [];
					result[t2].push({className: t1, original: arTags[k], cssText: rules[j].style.cssText});
				}
			}
		}
		return result;
	}
}
var BXStyleParser = new _BXStyleParser();


function _BXPopupWindow()
{
	this.bCreated = false;
}

_BXPopupWindow.prototype = {
	Create: function()
	{
		if(this.pFrame)
			return;

		this.pFrame = document.body.appendChild(BX.create('IFRAME', {props: {src : 'javascript:void(0)', className : 'bxedpopupframe', frameBorder : 'no', scrolling : 'no', unselectable : 'on'}}));

		if(this.pFrame.contentDocument && !BX.browser.IsIE())
			this.pDocument = this.pFrame.contentDocument;
		else
			this.pDocument = this.pFrame.contentWindow.document;

		this.pDocument.open();
		this.pDocument.write('<html><head></head><body class="bx_popup_frame"></body></html>');
		this.pDocument.close();

		this.pDocument.body.style.margin = this.pDocument.body.style.padding = "0px";
		this.pDocument.body.style.borderWidth = "0px";
		this.pDocument.body.style.backgroundColor = "#FFFFFF";
		this.pDocument.body.style.overflow = "hidden";

		this.bCreated = true;
	},

	Hide: function(name)
	{
		if(!this.bShowed)
			return;

		this.pFrame.style.display = "none";
		this.bShowed = false;
	},

	GetDocument: function()
	{
		if(!this.pFrame)
			this.Create();

		return this.pDocument;
	},

	Show: function (Params)
	{
		if(!this.pFrame)
			this.Create();

		this.pFrame.style.display = "block";
		BX.cleanNode(this.pDocument.body);
		this.pDocument.body.appendChild(Params.node);
		Params.node.style.display = 'block';

		if (!Params.width || !Params.height)
		{
			Params.width = this.pDiv.offsetWidth;
			Params.height = this.pDiv.offsetHeight;
		}

		this.pFrame.style.left = Params.left + "px";
		this.pFrame.style.top = Params.top + "px";
		this.pFrame.width = Params.width + "px";
		this.pFrame.height = Params.height + "px";

		this.bShowed = true;
	},

	CreateElement: BXCreateElement,

	CreateCustomElement: function(sTagName, arParams)
	{
		var ob = new window[sTagName]();
		ob.pMainObj = this;
		ob.pDocument = this.pDocument;
		ob.CreateElement = BXCreateElement;
		if(arParams)
		{
			var sParamName;
			for(sParamName in arParams)
				ob[sParamName] = arParams[sParamName];
		}
		ob._Create();
		return ob;
	},

	SetCurStyles: function ()
	{
		var
			_this = this,
			x1 = document.styleSheets,
			rules, cssText = '', j, i;

		if(!x1[0].cssRules)
		{
			for(i = x1.length - 1; i >= 0; i--)
			{
				if (i >= x1.length - 2 && x1[i].cssText.indexOf('bxed') != -1)
					cssText += x1[i].cssText;
			}
		}
		else
		{
			for(i = x1.length - 1; i >= 0; i--)
			{
				try{
					rules = (x1[i].rules ? x1[i].rules : x1[i].cssRules);
					for(j = 0; j < rules.length; j++)
					{
						if(rules[j].cssText)
							cssText += rules[j].cssText + '\n';
						else
							cssText += rules[j].selectorText + '{' + rules[j].style.cssText + '}\n';
					}
				}catch(e){continue;}
			}
		}

		this.SetStyles(cssText);
	},

	SetStyles: function(cssText, bClean)
	{
		if (bClean !== false)
		{
			var cur = this.pDocument.getElementsByTagName("STYLE");
			for(i = 0; i < cur.length; i++)
				cur[i].parentNode.removeChild(cur[i]);
		}

		if (cssText && cssText.length > 0)
		{
			var xStyle = BX.create("STYLE", {}, this.pDocument);
			this.pDocument.getElementsByTagName("HEAD")[0].appendChild(xStyle);

			if(BX.browser.IsIE())
				this.pDocument.styleSheets[0].cssText = cssText;
			else
				xStyle.appendChild(this.pDocument.createTextNode(cssText));
		}
	}
}

var BXPopupWindow = new _BXPopupWindow();


function addEvent(el, evname, func, p)
{
	el["on" + evname] = func;
	ar_EVENTS.push([el,evname,func]);
}

function addEvent1(el, evname, func, p)
{
	if(el.addEventListener)
		el.addEventListener(evname, func, (p?false:p));
	else
		el["on" + evname] = func;
}

function addAdvEvent(el, evname, func, p)
{
	if(el.addEventListener)
		el.addEventListener(evname, func, (p?false:p));
	else if (el.attachEvent)
		el.attachEvent('on'+evname,func);
}

function removeAdvEvent(el, evname, func, p)
{
	if(el.removeEventListener)
		el.removeEventListener(evname, func, (p?false:p));
	else
		el.detachEvent('on'+evname, func);
}


function removeEvent(el, evname, func, p)
{
	el['on' + evname] = null;
	if(el.removeEventListener)
		el.removeEventListener(evname, func, (p?false:p));
	else
		el.detachEvent('on'+evname,func);
}

var BXCustomElementEvents = [];

function addCustomElementEvent(elEvent, sEventName, oEventHandler, oHandlerParent)
{
	elEvent.w = sEventName;
	if(!elEvent.__eventHandlers)
		elEvent.__eventHandlers = [];
	if(!elEvent.__eventHandlers[sEventName] || elEvent.__eventHandlers[sEventName].length<=0)
	{
		elEvent.__eventHandlers[sEventName] = [];
		if(elEvent.addEventListener)
			elEvent.addEventListener(sEventName, OnCustomElementEvent, false);
		else
			elEvent["on" + sEventName] = OnCustomElementEvent;
	}

	elEvent.__eventHandlers[sEventName].push([oHandlerParent, oEventHandler]);
}

function OnCustomElementEvent(e)
{
	if(!e)
		e = window.event;

	var arHandlers = this.__eventHandlers[e.type];
	for(var i=0; i<arHandlers.length; i++)
		arHandlers[i][1].call(arHandlers[i][0], e);
}

function delCustomElementEvent(elEvent, sEventName, oEventHandler)
{
	if(!elEvent.__eventHandlers || !elEvent.__eventHandlers[sEventName])
		return false;

	var arEvents = elEvent.__eventHandlers[sEventName];
	var arNewEvents = [];
	for(var i=0; i<arEvents.length; i++)
	{
		if(arEvents[i][1]!=oEventHandler)
			arNewEvents.push(arEvents[i]);
	}
	arEvents = elEvent.__eventHandlers[sEventName] = arNewEvents;

	//Deleting event handler
	if(arEvents.length<=0)
		removeEvent(elEvent, sEventName, OnCustomElementEvent);

}

function BXElementEqual(pElement1, pElement2)
{
	if(pElement1 == pElement2)
		return true;

	return false;
	if(!pElement1)
		return false;
	if(!pElement2)
		return false;
	if(pElement1.nodeType != 1)
		return false;
	if(pElement2.nodeType != 1)
		return false;
	if(pElement1.tagName != pElement2.tagName)
		return false;
	if(pElement1.id != pElement2.id)
		return false;
	if(pElement1.offsetHeight != pElement2.offsetHeight)
		return false;
	if(pElement1.offsetLeft != pElement2.offsetLeft)
		return false;
	if(pElement1.offsetTop != pElement2.offsetTop)
		return false;
	if(pElement1.clientHeight != pElement2.clientHeight)
		return false;
	if(pElement1.clientWidth != pElement2.clientWidth)
		return false;

	return true;
}

function BXFindParentElement(pElement1, pElement2)
{
	var p, arr1 = [], arr2 = [];
	while((pElement1 = pElement1.parentNode)!=null)
		arr1[arr1.length] = pElement1;
	while((pElement2 = pElement2.parentNode)!=null)
		arr2[arr2.length] = pElement2;

	var min, diff1 = 0, diff2 = 0;
	if(arr1.length<arr2.length)
	{
		min = arr1.length;
		diff2 = arr2.length - min;
	}
	else
	{
		min = arr2.length;
		diff1 = arr1.length - min;
	}

	for(var i=0; i<min-1; i++)
	{
		if(BXElementEqual(arr1[i+diff1], arr2[i+diff2]))
			return arr1[i+diff1];
	}
	return arr1[0];
}

// return position of the cursor
function getRealMousePos(e, pMainObj, bEditorFrame)
{
	if(window.event)
		e = window.event;

	if(e.pageX || e.pageY)
	{
		e.realX = e.pageX;
		e.realY = e.pageY;
	}
	else if(e.clientX || e.clientY)
	{
		e.realX = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
		e.realY = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
	}

	if (bEditorFrame) // if peditorFrame
	{
		if (!(arFramePos = CACHE_DISPATCHER['pEditorFrame']))
			CACHE_DISPATCHER['pEditorFrame'] = arFramePos = BX.pos(pMainObj.pEditorFrame);

		e.realX += arFramePos.left;
		e.realY += arFramePos.top;

		var scrollLeft, scrollTop;
		if (BX.browser.IsIE() && !pMainObj.bFullscreen)
		{
			if (IEplusDoctype)
			{
				e.realX -= document.documentElement.scrollLeft;
				e.realY -= document.documentElement.scrollTop;
			}
			else
			{
				e.realX -= document.body.scrollLeft;
				e.realY -= document.body.scrollTop;
			}
		}
		else if (!BX.browser.IsIE() && !BX.browser.IsDoctype())  // FF without doctype
		{
			e.realX -= pMainObj.pEditorDocument.body.scrollLeft;
			e.realY -= pMainObj.pEditorDocument.body.scrollTop;
		}
	}
	return e;
}

function GetRealPos(el)
{
	if(!el || !el.offsetParent)
		return false;

	var
		res = {left: el.offsetLeft, top: el.offsetTop},
		objParent = el.offsetParent;

	while(objParent.tagName.toUpperCase() !== "BODY" && objParent.tagName.toUpperCase() !== "HTML")
	{
		res.left += objParent.offsetLeft;
		res.top += objParent.offsetTop;
		objParent = objParent.offsetParent;
	}
	res.right = res.left + el.offsetWidth;
	res.bottom=res.top + el.offsetHeight;

	return res;
}

function BXAlignToPos(pos, dir_rtl)
{
	var oW = BX.GetWindowInnerSize();
	if (oW.innerWidth < pos.right || dir_rtl)
	{
		var dw = pos.right - pos.left;
		pos.right -= dw;
		pos.left -= dw;
	}

	if (oW.innerHeight < pos.bottom)
	{
		var dh = pos.bottom - pos.top;
		pos.top -= dh;
		pos.bottom -= dh;
	}
	return pos;
}


function GetDisplStr(status)
{
	return status == 0 ? "none" : "";
}


function bxhtmlspecialchars(str)
{
	if(!(typeof(str) == "string" || str instanceof String))
		return str;

	str = str.replace(/&/g, '&amp;');
	str = str.replace(/"/g, '&quot;');
	str = str.replace(/</g, '&lt;');
	str = str.replace(/>/g, '&gt;');
	//str = str.replace(/\#/g, '&#35;');
	//str = str.replace(/\!/g, '&#33;');
	//str = str.replace(/\$/g, '&#36;');
	//str = str.replace(/\%/g, '&#37;');
	//str = str.replace(/\~/g, '&#126;');
	return str;
}

function bxhtmlunspecialchars(str)
{
	if(!(typeof(str) == "string" || str instanceof String))
		return str;

	str = str.replace(/\&quot;/g, '"');
	str = str.replace(/&#39;/g, "'");
	str = str.replace(/\&lt;/g, '<');
	str = str.replace(/\&gt;/g, '>');
	//str = str.replace(/\&#33;/g, '!');
	//str = str.replace(/\&#36;/g, '$');
	//str = str.replace(/\&#37;/g, '%');
	//str = str.replace(/\&#126;/g, '~');
	//str = str.replace(/\&nbsp;/g, ' ');
	//str = str.replace(/\&#35;/g, '#');
	str = str.replace(/\&amp;/g, '&');
	return str;
}

// Global object - collect global event handlers
function BXEventDispatcher()
{
	this.arHandlers = [];
	this.arEditorHandlers = [];
	this.arEditors = [];

	BXEventDispatcher.prototype.OnEvent = function(pDoc, e)
	{
		var arFramePos;

		if(window.event)
			e = window.event;

		if(pDoc["className"] && (pDoc.className == 'pEditorDocument' || pDoc.className == 'pSourceDocument'))
		{
			if(pDoc.pMainObj.pEditorWindow.event)
				e = pDoc.pMainObj.pEditorWindow.event;
			else if (!(arFramePos = CACHE_DISPATCHER['pEditorFrame']))
				CACHE_DISPATCHER['pEditorFrame'] = arFramePos = BX.pos(pDoc.pMainObj.pEditorFrame);
		}

		var arHandlers = pBXEventDispatcher.arHandlers[e.type];
		var arHLen = arHandlers.length;
		if (!arHLen)
			return;

		if(e.target)
			e.targetElement = e.target;
		else if(e.srcElement)
			e.targetElement = e.srcElement;

		if(e.targetElement.nodeType == 3)
			e.targetElement = e.targetElement.parentNode;

		if(e.pageX || e.pageY)
		{
			e.realX = e.pageX;
			e.realY = e.pageY;
		}
		else if(e.clientX || e.clientY)
		{
			e.realX = e.clientX + document.body.scrollLeft;
			e.realY = e.clientY + document.body.scrollTop;
		}

		if(arFramePos)
		{
			e.realX += arFramePos["left"];
			e.realY += arFramePos["top"];
		}

		var res = true;
		for(var i = 0; i < arHLen; i++)
		{
			if(!arHandlers[i](e))
				res = false;
		}
		return res;
	}


	//Method add handler of pEventHandler for global event eventName
	BXEventDispatcher.prototype.AddHandler = function (eventName, pEventHandler)
	{
		if(!this.arHandlers[eventName])
		{
			this.arHandlers[eventName] = [];
			for(var i=0; i<this.arEditors.length; i++)
			{
				var pObject = this.arEditors[i];
				addEvent1(pObject.pDocument, eventName, function (e) {pBXEventDispatcher.OnEvent(pObject.pDocument, e);});
				addEvent1(pObject.pEditorDocument, eventName,  function (e) {pBXEventDispatcher.OnEvent(pObject.pEditorDocument, e);});
			}
		}
		this.arHandlers[eventName].push(pEventHandler);
	}

	BXEventDispatcher.prototype.SetEvents = function(pDocument)
	{
		for(var eventName in this.arHandlers)
		{
			for(var i=0; i<this.arHandlers[eventName].length; i++)
				addAdvEvent(pDocument, eventName, window['OnDispatcherEvent_pEditorDocument_' + name_cur_obj]);
		}
	}

	//Internal method for adding BXHTMLEditor-type object
	BXEventDispatcher.prototype.__Add = function (pObject)
	{
		for(var eventName in this.arHandlers)
		{
			if(this.arEditors.length <= 0)
				addAdvEvent(pObject.pDocument, eventName, window['OnDispatcherEvent_pDocument_' + name_cur_obj]);

			addAdvEvent(pObject.pEditorDocument, eventName, window['OnDispatcherEvent_pEditorDocument_'+name_cur_obj]);
		}
		this.arEditors[this.arEditors.length] = pObject;
	}

	// Setting cursor for all documents....
	BXEventDispatcher.prototype.SetCursor = function (sCursor)
	{
		for(var i=0; i<this.arEditors.length; i++)
		{
			var pObject = this.arEditors[i];
			pObject.pDocument.body.style.cursor = sCursor;
			pObject.pEditorDocument.body.style.cursor = sCursor;
		}
	}

	BXEventDispatcher.prototype.AddEditorHandler = function (eventName, pEventHandler)
	{
		if(!this.arEditorHandlers[eventName])
			this.arEditorHandlers[eventName] = [];
		this.arEditorHandlers[eventName][this.arEditorHandlers[eventName].length] = pEventHandler;
	}

	BXEventDispatcher.prototype.OnEditorEvent = function (eventName, pMainObj, arParams)
	{
		if(!this.arEditorHandlers[eventName])
			return true;

		var res = true;
		for(var i=0; i<this.arEditorHandlers[eventName].length; i++)
			if(!this.arEditorHandlers[eventName][i](pMainObj, arParams))
				res = false;

		return res;
	}
}

window.BXLoadJSFiles = function(arJs, oCallBack, bFullPath)
{
	var load_js = function(ind)
	{
		if (ind >= arJs.length)
		{
			oCallBack.func.apply(oCallBack.obj);
			return;
		}

		var oSript = document.body.appendChild(document.createElement('script'));
		oSript.src = (!bFullPath ? "/bitrix/admin/htmleditor2/" : '') + arJs[ind];
		if (BX.browser.IsIE())
		{
			oSript.onreadystatechange = function()
			{
				if (oSript.readyState == 'loaded')
					load_js(++ind);
			};
		}
		else
		{
			oSript.onload = function(){setTimeout(function (){load_js(++ind);}, 50);};
		}
	};
	load_js(0);
};


// BXPreloader - special object, which one after another load functions and call they by callback...
// at the end oFinalCallback will be called
function BXPreloader(arSteps, oFinalCallback)
{
	this.oFinalCallback = oFinalCallback;
	this.arSteps = arSteps;
	this.Length = arSteps.length;
	this.curInd = 0;
	this.finalLoaded = false;
}

BXPreloader.prototype.LoadStep = function()
{
	if (this.curInd >= this.Length)
	{
		if (this.finalLoaded)
			return;

		this.finalLoaded = true;
		var o = this.oFinalCallback;
		if (!o.params)
			o.params = [];

		if (o.obj)
			o.func.apply(o.obj, o.params);
		else
			o.func(o.params);
		return;
	}

	var o = this.arSteps[this.curInd];
	this.curInd++;
	if (!o.params)
		o.params = [];
	var oCallBack = {obj: this, func: this.LoadStep};

	try
	{
		if (o.obj)
			o.func.call(o.obj, oCallBack, o.params);
		else
			o.func(oCallBack, o.params);
	}
	catch(e)
	{
		this.LoadStep();
	}
}

BXPreloader.prototype.AddStep = function(oStep)
{
	this.arSteps.push(oStep);
	this.Length++;
}

BXPreloader.prototype.RemoveStep = function(ind)
{
	if (ind == -1)
	{
		delete this.arSteps[this.Length];
		this.Length--;
	}
}

// CONTEXT MENU
function BXContextMenu() {}

BXContextMenu.prototype.Create = function()
{
	this.pref = this.pMainObj.name.toUpperCase()+'_';
	this.oDiv = document.body.appendChild(BXCreateElement('DIV', {className: 'bx_ed_context_menu', id: this.pref + '_BXContextMenu'}, {position: 'absolute', zIndex: 1500, left: '-1000px', top: '-1000px', visibility: 'hidden'}, document));
	this.oDiv.innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td class="popupmenu"><table cellpadding="0" cellspacing="0" id="' + this.pref + '_BXContextMenu_items"><tr><td></td></tr></table></td></tr></table>';

	// Part of logic of JCFloatDiv.Show()   Prevent bogus rerendering window in IE... And SpeedUp first context menu calling
	document.body.appendChild(BXCreateElement('IFRAME',{id: this.pref + '_BXContextMenu_frame', src: "javascript:void(0)"}, {position: 'absolute', zIndex: 1495, left: '-1000px', top: '-1000px', visibility: 'hidden'}, document));

	this.menu = new PopupMenu(this.pref + '_BXContextMenu');
};


BXContextMenu.prototype.Show = function(zIndex, dxShadow, oPos, pElement, arParams, pMainObj, dir_rtl)
{
	this.pMainObj = pMainObj;
	this.oPrevRange = BXGetSelectionRange(this.pMainObj.pEditorDocument, this.pMainObj.pEditorWindow);
	this.menu.PopupHide();
	if (!this.FetchAndBuildItems(pElement, arParams))
		return;

	addEvent1(this.pMainObj.pEditorDocument, "click", BXContextMenuOnclick);

	if (!isNaN(zIndex))
		this.oDiv.style.zIndex = zIndex;

	this.oDiv.style.width = parseInt(this.oDiv.firstChild.offsetWidth) + 'px';
	var w = parseInt(this.oDiv.offsetWidth);
	var h = parseInt(this.oDiv.offsetHeight);
	oPos.right = oPos.left + w;
	oPos.bottom = oPos.top;
	this.menu.PopupShow(BXAlignToPos(oPos, dir_rtl), dxShadowImgPath);
};

BXContextMenu.prototype.FetchAndBuildItems = function(pElement, arParams)
{
	var pElementTemp, i, k, arMenuItems = [], el, el_params, arUsed = [], strPath, strPath1, bxTag = false, bxtagname = false, id;

	if (!arParams)
		arParams = {};

	// Handling and creation menu elements array
	// Single custom element
	if (arParams && arParams.bxtagname)
	{
		bxtagname = arParams.bxtagname;
	}
	else if (pElement && pElement.arAttributes && (id = pElement.arAttributes["id"]))
	{
		bxTag = this.pMainObj.GetBxTag(id);
		if (bxTag && bxTag.tag)
			bxtagname = bxTag.tag;
	}

	if (bxtagname)
	{
		strPath1 = bxtagname.toUpperCase();
		if (arCMButtons[strPath1])
			for(i = 0, k = arCMButtons[strPath1].length; i < k; i++)
				arMenuItems.push(arCMButtons[strPath1][i]);
	}
	else // Elements in editor iframe
	{
		if (!pElement)
			pElement = this.pMainObj.GetSelectionObject();

		arParams.pElement = pElement;

		//Adding to default list
		for(i = 0; i < arCMButtons["DEFAULT"].length; i++)
			arMenuItems.push(arCMButtons["DEFAULT"][i]);
		//Adding other elements
		while(pElement && (pElementTemp = pElement.parentNode) != null)
		{
			if(pElementTemp.nodeType == 1 && pElement.tagName && (strPath = pElement.tagName.toUpperCase()) && strPath != 'TBODY' && !arUsed[strPath])
			{
				strPath1 = strPath;
				if (pElement.getAttribute && (id = pElement.getAttribute('id')))
				{
					bxTag = this.pMainObj.GetBxTag(id);
					if (bxTag && bxTag.tag)
						strPath1 = bxTag.tag.toUpperCase();
				}

				arUsed[strPath] = pElement;
				if(arCMButtons[strPath1])
				{
					if (arMenuItems.length > 0)
						arMenuItems.push('separator');
					for(i = 0, k = arCMButtons[strPath1].length; i < k; i++)
						arMenuItems.push(arCMButtons[strPath1][i]);
				}
			}
			else
			{
				pElement = pElementTemp;
					continue;
			}
		}
	}
	if (arMenuItems.length == 0)
		return false;

	//Cleaning menu
	var contTbl = BX(this.menu.menu_id + '_items');
	while(contTbl.rows.length>0)
		contTbl.deleteRow(0);
	return this.BuildItems(arMenuItems, arParams, contTbl);
};

BXContextMenu.prototype.BuildItems = function(arMenuItems, arParams, contTbl, parentName)
{
	var n = arMenuItems.length;
	var __this = this;
	var arSubMenu = {};
	this.subgroup_parent_id = '';
	this.current_opened_id = '';

	var _hide = function()
	{
		var cs = BX("__curent_submenu");
		if (!cs)
			return;
		_over(cs);
		__this.current_opened_id = '';
		__this.subgroup_parent_id = '';
		cs.style.display = "none";
		cs.id = "";
	};

	var _over = function(cs)
	{
		if (!cs)
			return;
		var t = cs.parentNode.nextSibling;
		t.parentNode.className = '';
	};

	var _refresh = function() {setTimeout(function() {__this.current_opened_id = '';__this.subgroup_parent_id = '';}, 400);}

	//Creation menu elements
	for(var i = 0; i < n; i++)
	{
		var row = contTbl.insertRow(-1);
		var cell = row.insertCell(-1);
		if(arMenuItems[i] == 'separator')
		{
			cell.innerHTML = '<div class="popupseparator"></div>';
		}
		else
		{
			if (arMenuItems[i].isgroup === true)
			{
				var c = (BX.browser.IsIE()) ? 'arrow_ie' : 'arrow';

				cell.innerHTML =
				'<div id="_oSubMenuDiv_'+arMenuItems[i].id+'" style="position: relative;"></div>'+
				'<table cellpadding="0" cellspacing="0" class="popupitem" id="'+arMenuItems[i].id+'">\n'+
				'	<tr>\n'+
				'		<td class="gutter"></td>\n'+
				'		<td class="item" title="'+((arMenuItems[i].title) ? arMenuItems[i].title : arMenuItems[i].name)+'">'+arMenuItems[i].name+'</td>\n'+
				'		<td class="'+c+'"></td>\n'+
				'	</tr>\n'+
				'</table>';
				var oTable = cell.childNodes[1];
				var _LOCAL_CACHE = {};
				arSubMenu[arMenuItems[i].id] = arMenuItems[i].elements;

				oTable.onmouseover = function(e)
				{
					this.className = 'popupitem popupitemover';

					var _this = this;
					_over(BX("__curent_submenu"));
					setTimeout(function()
					{
						//_this.parentNode.className = 'popup_open_cell';
						if (__this.current_opened_id && __this.current_opened_id == __this.subgroup_parent_id)
						{
							_refresh();
							return;
						}
						if (_this.className == 'popupitem')
							return;
						_hide();
						__this.current_opened_id = _this.id;

						if (!_LOCAL_CACHE[_this.id])
						{
							var _oSubMenuDiv = BX("_oSubMenuDiv_" + _this.id);
							var left = parseInt(oTable.offsetWidth) + 1 + 'px';
							var oSubMenuDiv = BXCreateElement('DIV', {'className' : 'popupmenu'}, {position: 'absolute', zIndex: 1500, left: left, top: '-1px'}, document);
							_oSubMenuDiv.appendChild(oSubMenuDiv);
							oSubMenuDiv.onmouseover = function(){_this.parentNode.className = 'popup_open_cell';};
							_LOCAL_CACHE[_this.id] = oSubMenuDiv;

							var contTbl = oSubMenuDiv.appendChild(BXCreateElement('TABLE', {cellPadding:0, cellSpacing:0}, {}, document));
							__this.BuildItems(arSubMenu[_this.id], arParams, contTbl, _this.id);
						}
						else
							oSubMenuDiv = _LOCAL_CACHE[_this.id];

						//oSubMenuDiv.style.visibility = "visible";
						oSubMenuDiv.style.display = "block";
						oSubMenuDiv.id = "__curent_submenu";
					}, 400);
				};


				oTable.onmouseout = function(e){this.className = 'popupitem';};
				continue;
			}

			var el_params = arMenuItems[i][1];
			var _atr = '';

			if(arMenuItems[i][1].iconkit)
				_atr = 'style="background-image:url(' + image_path + '/'+arMenuItems[i][1].iconkit+');" class="bxedtbutton" id="bx_btn_' + arMenuItems[i][1].id+'"';
			else if(arMenuItems[i][1].src)
				_atr = 'style="background-image:url(' + image_path + '/'+arMenuItems[i][1].src+');" ';

			var _innerHTML =
				'<table cellpadding="0" cellspacing="0" class="popupitem">\n'+
				'	<tr>\n'+
				'			<td class="gutter"><div '+ _atr+'></div></td>\n'+
				'			<td class="item" title="'+((arMenuItems[i][1].title) ? arMenuItems[i][1].title : arMenuItems[i][1].name)+'"'+'>'+arMenuItems[i][1].name+'</td>\n'+
				'		</tr>\n'+
				'	</table>';
			cell.innerHTML = _innerHTML;

			var oTable = cell.firstChild;

			var bDisable = (arMenuItems[i][1] && arMenuItems[i][1].disablecheck) ? arMenuItems[i][1].disablecheck(oTable, oBXContextMenu.pMainObj) : false;

			if (!bDisable)
			{
				oTable.pMainObj = oBXContextMenu.pMainObj;
				oTable.handler = arMenuItems[i][1].handler;
				oTable.cmd = arMenuItems[i][1].cmd;

				oTable.onmouseover = function(e)
				{
					if (parentName)
					{
						__this.subgroup_parent_id = parentName;
					}
					else
					{
						setTimeout(function()
						{
							if (__this.current_opened_id && __this.current_opened_id == __this.subgroup_parent_id)
							{
								_refresh();
								return;
							}
							_hide();
						}, 400);
					}

					this.className='popupitem popupitemover';
				}

				oTable.onmouseout = function(e){this.className = 'popupitem';};

				oTable.onclick = function()
				{
					__this.pMainObj.SetFocus();
					var res = false;
					try{
						if (BX.browser.IsIE() && !BX.browser.IsIE9()) //Restore selection for IE
							BXSelectRange(__this.oPrevRange, __this.pMainObj.pEditorDocument, __this.pMainObj.pEditorWindow);
					}catch(e){}

					if (this.handler && typeof this.handler == 'function' && this.handler(arParams) !== false)
						res = true;

					if (!res && this.cmd)
						res = this.pMainObj.executeCommand(this.cmd);

					__this.pMainObj.SetFocus();
					oBXContextMenu.menu.PopupHide();
					return res;
				};
			}
			else
			{
				oTable.className = 'popupitem popupitemdisabled';
			}

			oTable.id=null;
		}
	}

	this.oDiv.style.width = contTbl.parentNode.offsetWidth;
	return true;
};

function BXIsArrayAssoc(ob)
{
	for(var i in ob)
	{
		if(parseInt(i)!=i)
			return true;
	}
	return false;
}

function BXSerializeAttr(ob, arAttr)
{
	var new_ob = {}, sAttrName;
	for(var i=0; i<arAttr.length; i++)
	{
		sAttrName = arAttr[i];
		if(ob[sAttrName])
			new_ob[sAttrName] = ob[sAttrName];
	}
	return BXSerialize(new_ob);
}

function BXUnSerializeAttr(sOb, ob, arAttr)
{
	var new_ob = BXUnSerialize(sOb);
	for(var sAttrName in new_ob)
		ob[sAttrName] = new_ob[sAttrName];
}

function BXSerialize(ob, vd)
{
	var res, i, key;

	if(typeof(ob)=='object')
	{
		res = [];
		if(ob instanceof Array && !BXIsArrayAssoc(ob))
		{
			for(i=0; i < ob.length; i++)
				res.push(BXSerialize(ob[i]));
			return '[' + res.join(', ', res) + ']';
		}

		for(key in ob)
		{
			if (typeof ob[key] != 'function')
				res.push("'"+key+"': "+BXSerialize(ob[key]));
		}

		return "{" + res.join(", ", res) + "}";
	}

	if(typeof(ob)=='boolean')
	{
		if(ob)
			return "true";
		return "false";
	}

	if(typeof(ob)=='number')
		return ob;

	res = ob;
	res = res.replace(/\\/g, "\\\\");
	res = res.replace(/\n/g, "\\n");
	res = res.replace(/\r/g, "\\r");
	res = res.replace(/'/g, "\\'");

	return "'"+res+"'";
}

function BXUnSerialize(str)
{
	var res;
	eval("res = "+str);
	return res;
}

function BXPHPVal(ob, pref)
{
	var res, i, key;
	if(typeof(ob)=='object')
	{
		res = [];
		if(ob instanceof Array && !BXIsArrayAssoc(ob))
		{
			for(i=0; i<ob.length; i++)
				res.push(BXPHPVal(ob[i], (pref?pref:'undef')+'[]'));
		}
		else
		{
			for(key in ob)
				res.push(BXPHPVal(ob[key], (pref?pref+'['+key+']':key)));
		}

		return res.join("&", res);
	}

	if(typeof(ob)=='boolean')
	{
		if(ob)
			return pref+'=1';
		return pref+"=0";
	}

	return pref+'='+escape(ob);
	return pref+'='+ob;
}

function BXPHPValArray(ob)
{
	var res, i, key;
	if(typeof(ob)=='object')
	{
		res = [];
		if(ob instanceof Array && !BXIsArrayAssoc(ob))
		{
			for(i=0; i<ob.length; i++)
				res.push(BXPHPValArray(ob[i]));
			return 'Array(' + res.join(', ', res) + ')';
		}
		for(key in ob)
			res.push("'"+key+"'=> "+BXPHPValArray(ob[key]));
		return "Array(" + res.join(", ", res) + ")";
	}

	if(typeof(ob)=='boolean')
	{
		if(ob)
			return "true";
		return "false";
	}

	if(typeof(ob)=='number')
		return ob;

	res = ob;
	res = res.replace(/\\/g, "\\\\");
	res = res.replace(/'/g, "\\'");

	return "'" + res + "'";
}

// Initialization of global object
var pBXEventDispatcher = new BXEventDispatcher();

var BXEditorLoaded = false;
var arBXEditorObjects = [];
function BXEditorLoad()
{
	if (!BXEditorLoaded)
	{
		BXEditorLoaded = true;
		for(var i = 0; i < arBXEditorObjects.length; i++)
			arBXEditorObjects[i].OnBeforeLoad();
	}
}

function BXEditorRegister(obj)
{
	arBXEditorObjects.push(obj);
}

function BXFindParentByTagName(pElement, tagName, className)
{
	if (pElement)
	{
		var
			//par = pElement.parentNode,
			par = pElement,
			tagName = tagName.toUpperCase();

		while(par && par.tagName)
		{
			if(par.tagName && par.tagName.toUpperCase() == tagName)
			{
				if (className)
				{
					if (className && par.className && par.className.indexOf(className) != -1)
						return par;
				}
				else
				{
					return par;
				}
			}
			par = par.parentNode;
		}
	}
	return false;
}

function BXGetSelection(oDoc,oWin)
{
	if (!oDoc)
		oDoc = document;
	if (!oWin)
		oWin = window;

	var oSel = false;
	if (oWin.getSelection)
		oSel = oWin.getSelection();
	else if (oDoc.getSelection)
		oSel = oDoc.getSelection();
	else if (oDoc.selection)
		oSel = oDoc.selection;
	return oSel;
}

function BXGetSelectionRange(oDoc, oWin)
{
	try
	{
		if (!oDoc)
			oDoc = document;
		if (!oWin)
			oWin = window;

		var oRange, oSel = BXGetSelection(oDoc,oWin);
		if (oSel)
		{
			if (oDoc.createRange)
				oRange = oSel.getRangeAt(0);
			else
				oRange = oSel.createRange();
		}
		else
		{
			oRange = false;
		}

		return oRange;
	}
	catch(e){}
}

function BXSelectRange(oRange, oDoc, oWin)
{
	if (!oDoc)
		oDoc = document;
	if (!oWin)
		oWin = window;

	BXClearSelection(oDoc, oWin);
	if (oDoc.createRange && oWin.getSelection)
	{
		//FF, Opera, IE9
		var oSel = oWin.getSelection();
		oSel.removeAllRanges();
		if (oRange && oSel.addRange)
			oSel.addRange(oRange);
	}
	else
	{
		//IE
		if (oRange && oRange.select)
			oRange.select();
	}
}

var preventselect = function(e){return false;};

function BXClearSelection(oDoc, oWin)
{
	if (!oDoc)
		oDoc = document;
	if (!oWin)
		oWin = window;

	if (oWin.getSelection)
		oWin.getSelection().removeAllRanges();
	else
		oDoc.selection.empty();
}

function __BXSetOptionSelected(pOption, bSel) {return function(){pOption.selected = bSel;};}

// API
function BXEditorUtils()
{
	this.PHPParser = (window.__PHPParser) ? new __PHPParser() : {};
}

BXEditorUtils.prototype = {
	addContentParser: function(func){arContentParsers.push(func);},
	addDOMHandler: function(func) {arDOMHandlers.push(func);},
	addUnParser: function(func) {arUnParsers.push(func);},
	addContentUnParser: function(func) {arContentUnParsers.push(func);},
	addNodeUnParser: function(func) {arNodeUnParsers.push(func);},
	addCssLinkToFrame: function(href, frame, doc){return this.addLinkToFrame(href, 'stylesheet', 'text/css', frame, doc);}
};

BXEditorUtils.prototype.addLinkToFrame = function(href, rel, type, fo, oDoc)
{
	if (!oDoc)
	{
		if (!fo.contentWindow.document.getElementsByTagName) return;
		var oDoc = fo.contentWindow.document;
	}
	var l = oDoc.createElement('LINK');
	l.href = href;
	if (rel) l.rel = rel;
	if (type) l.type = type;

	var heads = oDoc.getElementsByTagName('HEAD');
	if (heads && heads[0])
		heads[0].appendChild(l);

	oDoc = heads = null;
	return l;
};

BXEditorUtils.prototype.ResetSelectionState = function(pMainObj)
{
	if (BX.browser.IsIE())
	{
		pMainObj.pEditorDocument.body.contentEditable = false;
		pMainObj.pEditorDocument.body.contentEditable = true;
	}
	else
	{
		pMainObj.pEditorDocument.designMode='off';
		pMainObj.pEditorDocument.designMode='on';
	}
};

BXEditorUtils.prototype.CancelEvent = function(e) {return BX.PreventDefault(e);};

BXEditorUtils.prototype.GetSelectionAnchor = function(pMainObj)
{
	// Get selection
	// TODO: Multiselection
	if (!BX.browser.IsIE())
		return pMainObj.pEditorFrame.contentWindow.getSelection().anchorNode;
	var r = pMainObj.pEditorDocument.selection.createRange();
	var x = null;
	if (r.parentElement)
		x = r.parentElement();
	else if (r.item)
		x = r.item(0);
	r = null;
	return x;
};

// API for adding taskbars
BXEditorUtils.prototype.addTaskBar = function(taskbarClassName, iTaskbarSetPos, sTaskbarTitle, arParams, _sort)
{
	for (var i = 0, l = arBXTaskbars.length; i < l; i++)
		if (arBXTaskbars[i].name == taskbarClassName)
			return;

	if (_sort == undefined)
		_sort = 100;

	if (!arTaskbarSettings_default[taskbarClassName])
		arTaskbarSettings_default[taskbarClassName] = {show : true, set: 3, active: true};

	arBXTaskbars.push({name: taskbarClassName, pos: iTaskbarSetPos, title:sTaskbarTitle, arParams:arParams, sort:_sort});
}

BXEditorUtils.prototype.createToolbar = function(name, title, arButtons, defaultPosition)
{
	if (!name)
		name = 'untitled_' + Math.random();

	if (!title)
		title = name;

	if (!arButtons)
		arButtons = [];

	if (!defaultPosition)
		defaultPosition = {
			show 		: true,
			docked 		: true,
			position	: [0,2,0]
		};

	var res = [name,title,arButtons,defaultPosition];
	res.appendButton = function(buttonName,oButton){oBXEditorUtils.appendButton(buttonName,oButton,name);};
	return res;
}


BXEditorUtils.prototype.createButton = function(){};


BXEditorUtils.prototype.addToolbar = function(arToolbar)
{
	arToolbars = window.arToolbars || {};
	arToolbars[arToolbar[0]] = [
		arToolbar[1],
		arToolbar[2]
	];

	arToolbarSettings_default[arToolbar[0]] = arToolbar[3];
}

BXEditorUtils.prototype.appendButton = function(name, arButton, toolbarName)
{
	if (!arToolbars[toolbarName])
		return false;

	arToolbars[toolbarName][1].push(arButton);
}


BXEditorUtils.prototype.addPropertyBarHandler = function(tagname, handler)
{
	pPropertybarHandlers[tagname] = handler;
}

BXEditorUtils.prototype.ConvertArray2Post = function(arr, arName)
{
	var s = '';
	for (var i in arr)
	{
		if (typeof arr[i] == 'object')
			for (var j in arr[i])
			{
				if (typeof arr[i][j] == 'object')
					for (var k in arr[i][j])
						s += '&'+arName+'['+i+']['+j+']['+k+']='+arr[i][j][k];
				else
					s += '&'+arName+'['+i+']['+j+']='+arr[i][j];
			}
		else
			s += '&'+arName+'['+i+']='+ BX.util.urlencode(arr[i]);
	}
	return s.substr(1);
}

function BXReplaceSpaceByNbsp(str)
{
	if(typeof(str)!='string')
		return str;
	str = str.replace(/\s/g, '&nbsp;');
	return str;
}

BXEditorUtils.prototype.setCheckbox = function(oCheckbox, mode, YNmode)
{
	mode = (mode === true);
	if (YNmode === false)
		oCheckbox.value = mode ? "True" : "False";
	else
		oCheckbox.value = mode ? "Y" : "N";
	oCheckbox.checked = oCheckbox.defaultChecked = mode;
}

oBXEditorUtils = new BXEditorUtils();
arContentParsers = [];
arDOMHandlers = [];
arBXTaskbars = [];

function copyObj(obj)
{
	var res = {}, i;
	for (i in obj)
	{
		if (typeof obj[i] == 'object')
			res[i] = copyObj(obj[i])
		else
			res[i] = obj[i];
	}
	return res;
}

function compareObj(obj1, obj2)
{
	try
	{
		for (var i in obj1)
		{
			if (typeof(obj1[i]) == 'object')
			{
				if (typeof(obj2[i]) != 'object' || !compareObj(obj1[i], obj2[i]))
					return false;
			}
			else
			{
				if (obj1[i] !== obj2[i])
					return false;
			}
		}
		return true;
	}
	catch(e)
	{
		return false;
	}
}

function JS_addslashes(str)
{
	str=str.replace(/\\/g,'\\\\');
	//str=str.replace(/\'/g,'\\\'');
	str=str.replace(/\"/g,'\\"');
	return str;
}

function JS_stripslashes(str)
{
	//str=str.replace(/\\'/g,'\'');
	str=str.replace(/\\"/g,'"');
	str=str.replace(/\\\\/g,'\\');
	return str;
}

function str_pad_left(input, pad_length, pad_string)
{
	input = String (input);
	if (pad_string.length > 0)
	{
		var buffer = "";
		var padi = 0;
		pad_length = parseInt(pad_length);
		for (var i = 0, z = pad_length - input.length; i < z; i++)
			buffer += pad_string;
		input = buffer + input;
	}
	return input;
}

function BXCutNode(pNode)
{
	while(pNode.childNodes.length > 0)
		pNode.parentNode.insertBefore(pNode.childNodes[0], pNode);

	pNode.parentNode.removeChild(pNode);
}

function CheckChilds(node, params)
{
	if(!node || !node.childNodes)
		return;

	var child, i;
	for (i = node.childNodes.length - 1; i >= 0; i--)
	{
		if (child = node.childNodes[i])
		{
			params.func.apply(params.obj, [child]);
			CheckChilds(child, params);
		}
	}
}user_search.php000064400000000124150240170740007555 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/tools/user_search.php");?>seo_sitemap.php000064400000000123150240170740007561 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_sitemap.php");?>captcha.php000064400000000125150240170740006656 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/captcha.php");?>perfmon_sql_list.php000064400000000137150240170740010636 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_sql_list.php");
?>
public_menu_edit.php000064400000000123150240170740010560 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/menu_edit.php");?>user_index.php000064400000000123150240170740007416 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_index.php");?>vote_dialog.php000064400000000126150240170740007550 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_dialog.php");
?>smile_gallery_edit.php000064400000000142150240170740011107 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_gallery_edit.php");
?>group_edit.php000064400000000132150240170740007412 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_edit.php");
?>perfmon_index_list.php000064400000000141150240170740011141 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_index_list.php");
?>
fileman_load_comp2_params.php000064400000000147150240170740012334 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_load_comp2_params.php");?>
iblock_section_search.php000064400000000141150240170740011565 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_section_search.php");?>
type_edit.php000064400000000133150240170740007240 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/type_edit.php");
?>iblock_templates.ajax.php000064400000000140150240170740011513 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_templates.ajax.php");?>b24connector_chat.php000064400000000127150240170740010556 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/chat.php");
?>posting_attachment.php000064400000000143150240170740011146 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/posting_attachment.php");
?>
agent_edit.php000064400000000136150240170740007360 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/agent_edit.php");
?>
form_list.php000064400000000125150240170740007251 0ustar00<? require ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_list.php"); ?>get_topics.php000064400000000126150240170740007414 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/tools/get_topics.php");
?>aspro.resort_options.php000064400000000141150240170740011465 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/aspro.resort/admin/options.php");
?>iblock_section_edit.php000064400000000136150240170740011251 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_section_edit.php");?>favorite_act.php000064400000000131150240170740007716 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/favorite_act.php");?>fileman_medialib.php000064400000000135150240170740010515 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_medialib.php");?>
form_result_list_xls.php000064400000000140150240170740011532 0ustar00<? require ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_result_list_xls.php"); ?>agent_list.php000064400000000133150240170740007403 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/agent_list.php");
?>
culture_edit.php000064400000000134150240170740007743 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/culture_edit.php");
?>services_index.php000064400000000127150240170740010267 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/services_index.php");?>smile_gallery.php000064400000000135150240170740010104 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_gallery.php");
?>blog_blog_edit.php000064400000000133150240170740010205 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/admin/blog_edit.php");
?>main_controller.php000064400000000141150240170740010440 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/main_controller.php");
?>site_edit.php000064400000000122150240170740007221 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/site_edit.php");?>rating_list.php000064400000000133150240170740007571 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/rating_list.php");
?>message_theme_edit.php000064400000000126150240170740011067 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_edit.php");?>translate_edit_php.php000064400000000137150240170740011127 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_edit_php.php");highloadblock_directory_ajax.php000064400000000156150240170740013140 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/highloadblock/admin/highloadblock_directory_ajax.php");?>highloadblock_export.php000064400000000150150240170740011444 0ustar00<?php
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/highloadblock/admin/highloadblock_export.php');scale_image.php000064400000000121150240170740007500 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/scale/admin/image.php");
?>security_ddos.php000064400000000132150240170740010131 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_ddos.php");?>template_load.php000064400000000126150240170740010066 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_load.php");?>security_otp.ajax.php000064400000000141150240170740010724 0ustar00<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_otp.ajax.php");
public_file_property.php000064400000000127150240170740011476 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_property.php");?>forum_group_edit.php000064400000000133150240170740010623 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/group_edit.php");
?>fileman_block_editor.php000064400000000143150240170740011406 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_block_editor.php");
?>
bitrixcloud_monitoring_edit.php000064400000000155150240170740013060 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/bitrixcloud_monitoring_edit.php");
?>fileman_component_params.php000064400000000144150240170740012314 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_component_params.php");?>form_edit.php000064400000000122150240170740007220 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_edit.php");?>site_speed.php000064400000000122150240170740007374 0ustar00<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/site_speed.php");userfield_edit.php000064400000000127150240170740010244 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/userfield_edit.php");?>fileman_file_download.php000064400000000147150240170740011560 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_file_download.php");?>
forum_points2post.php000064400000000134150240170740010767 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/points2post.php");
?>forum_edit.php000064400000000133150240170740007407 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_edit.php");
?>public_seo_tools.php000064400000000121150240170740010613 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_tools.php");?>bitrixcloud_backup_job.php000064400000000150150240170740011760 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/bitrixcloud_backup_job.php");
?>settings.php000064400000000130150240170740007107 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/settings.php");
?>wizard_export.php000064400000000126150240170740010155 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/wizard_export.php");?>forum_group.php000064400000000126150240170740007620 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/group.php");
?>get_search.php000064400000000133150240170740007356 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/get_search.php");
?>b24connector_telefonia.php000064400000000134150240170740011603 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/telefonia.php");
?>update_system_call.php000064400000000142150240170740011133 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_call.php");
?>perfmon_clear.php000064400000000134150240170740010067 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_clear.php");
?>
blog_group_edit.php000064400000000134150240170740010417 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/admin/group_edit.php");
?>template_test.php000064400000000136150240170740010127 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/template_test.php");
?>
bitrix.xscan_worker.php000064400000000130150240170740011254 0ustar00<? require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrix.xscan/admin/worker.php");?>search_customrank_admin.php000064400000000145150240170740012140 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_customrank_admin.php");
?>
perfmon_php.php000064400000000132150240170740007566 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_php.php");
?>
iblock_property_admin.php000064400000000141150240170740011630 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_property_admin.php");?>
site_admin.php000064400000000123150240170740007365 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/site_admin.php");?>sys_update_list.php000064400000000136150240170740010470 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/update_list.php");?>security_redirect.php000064400000000141150240170740011001 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_redirect.php");
?>
security_stat_activity.php000064400000000146150240170740012074 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_stat_activity.php");
?>
wizard_install.php000064400000000127150240170740010303 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/wizard_install.php");?>subscr_admin.php000064400000000135150240170740007725 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/subscr_admin.php");
?>
agreement_consents.php000064400000000133150240170740011135 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/agreement_consents.php");?>mobile_designer.php000064400000000140150240170740010377 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/mobileapp/admin/mobile_designer.php");
?>
mobile/.mobile_menu.php000064400000000150150240170740011071 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/mobileapp/admin/mobile/.mobile_menu.php");
?>mobile/bitrixcloud_monitoring_edit.php000064400000000150150240170740014322 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_edit.php");
?>mobile/bitrixcloud_monitoring_list.php000064400000000150150240170740014350 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_list.php");
?>mobile/bitrixcloud_monitoring_ipage.php000064400000000151150240170740014463 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_ipage.php");
?>mobile/push.php000064400000000140150240170740007476 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/mobileapp/admin/mobile/push.php");
?>mobile/left.php000064400000000140150240170740007451 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/mobileapp/admin/mobile/left.php");
?>mobile/bitrixcloud_monitoring_detail.php000064400000000152150240170740014641 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_detail.php");
?>mobile/index.php000064400000000141150240170740007627 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/mobileapp/admin/mobile/index.php");
?>mobile/bitrixcloud_monitoring_push.php000064400000000150150240170740014354 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_push.php");
?>vote_user_list.php000064400000000131150240170740010316 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_user_list.php");
?>iblock_subelement_edit.php000064400000000141150240170740011744 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_subelement_edit.php");?>seo_search_yandex.php000064400000000131150240170740010733 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex.php");?>smile_import.php000064400000000134150240170740007756 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_import.php");
?>user_settings.php000064400000000126150240170740010152 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_settings.php");?>public_file_delete.php000064400000000125150240170740011052 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_delete.php");?>subscr_edit.php000064400000000134150240170740007561 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/subscr_edit.php");
?>
form_status_edit.php000064400000000131150240170740010623 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_edit.php");?>blog_comment.php000064400000000134150240170740007720 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/admin/blog_comment.php");
?>public_structure.php000064400000000123150240170740010647 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/structure.php");?>bitrixcloud_cdn.php000064400000000141150240170740010425 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/bitrixcloud_cdn.php");
?>subscr_import.php000064400000000136150240170740010150 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/subscr_import.php");
?>
iblock_edit_property.php000064400000000137150240170740011472 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_edit_property.php");?>security_frame.php000064400000000136150240170740010276 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_frame.php");
?>
translate_csv_download.php000064400000000143150240170740012012 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_csv_download.php");group_admin.php000064400000000133150240170740007556 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_admin.php");
?>promo_https.php000064400000000137150240170740007634 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/promo_https.php");
?>
fileman_file_upload.php000064400000000145150240170740011233 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_file_upload.php");?>
translate_show_php.php000064400000000137150240170740011162 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_show_php.php");fileman_access.php000064400000000140150240170740010204 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_access.php");?>
form_result_edit.php000064400000000134150240170740010621 0ustar00<? require ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_result_edit.php"); ?>search_tags.php000064400000000131150240170740007533 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_tags.php");
?>
lang_edit.php000064400000000131150240170740007176 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/lang_edit.php");
?>b24connector_b24connector.php000064400000000137150240170740012142 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/b24connector.php");
?>get_start_menu.php000064400000000132150240170740010271 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/get_start_menu.php");
?>forum_dictionary_edit.php000064400000000145150240170740011637 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_dictionary_edit.php");?>
perfmon_cache_list.php000064400000000141150240170740011075 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_cache_list.php");
?>
posting_admin.php000064400000000136150240170740010110 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/posting_admin.php");
?>
fileman_load_components2.php000064400000000146150240170740012217 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_load_components2.php");?>
perfmon_hit_list.php000064400000000137150240170740010623 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_hit_list.php");
?>
all_settings_index.php000064400000000133150240170740011131 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/all_settings_index.php");?>user_edit.php000064400000000131150240170740007233 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_edit.php");
?>perfmon_explain.php000064400000000136150240170740010443 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_explain.php");
?>
update_system_partner_act.php000064400000000151150240170740012522 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_partner_act.php");
?>security_403.php000064400000000134150240170740007510 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_403.php");
?>
fileman_menu_edit.php000064400000000143150240170740010717 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_menu_edit.php");?>
security_antivirus.php000064400000000142150240170740011225 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_antivirus.php");
?>
security_session.php000064400000000140150240170740010662 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_session.php");
?>
message_admin.php000064400000000135150240170740010050 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/message_admin.php");
?>fileman_medialib_admin.php000064400000000143150240170740011664 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_medialib_admin.php");?>
vote_user_votes_table.php000064400000000141150240170740011653 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_user_votes_table.php");
?>
update_system.php000064400000000135150240170740010142 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system.php");
?>composite_diff_source.php000064400000000143150240170740011625 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/composite_diff_source.php");?>fileman_flash_preview.php000064400000000143150240170740011604 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_flash_preview.php");?>
blog_blog.php000064400000000126150240170740007202 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/admin/blog.php");
?>smile_set_edit.php000064400000000136150240170740010246 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_set_edit.php");
?>b24connector_recall.php000064400000000131150240170740011074 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/recall.php");
?>fileman_medialib_access.php000064400000000144150240170740012036 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_medialib_access.php");?>
scale_ajax.php000064400000000120150240170740007340 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/scale/admin/ajax.php");
?>seo_sitemap_run.php000064400000000127150240170740010451 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_sitemap_run.php");?>posting_bcc.php000064400000000134150240170740007545 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/posting_bcc.php");
?>
mobile_app_list.php000064400000000141150240170740010413 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/mobileapp/admin/mobile_app_list.php");


forum_subscribe_edit.php000064400000000145150240170740011453 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_subscribe_edit.php");
?>iblock_type_admin.php000064400000000134150240170740010727 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_type_admin.php");?>public_folder_edit.php000064400000000125150240170740011071 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/folder_edit.php");?>template_edit.php000064400000000126150240170740010074 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_edit.php");?>clouds_storage_list.php000064400000000141150240170740011321 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/clouds/admin/clouds_storage_list.php");
?>
translate_search.php000064400000000135150240170740010576 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_search.php");iblock_reindex.php000064400000000131150240170740010231 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_reindex.php");?>blog_group.php000064400000000127150240170740007414 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/admin/group.php");
?>seo_search_yandex_direct_banner_edit.php000064400000000154150240170740014624 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_direct_banner_edit.php");?>security_iprule_list.php000064400000000144150240170740011536 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_iprule_list.php");
?>
security_panel.php000064400000000136150240170740010303 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_panel.php");
?>
iblock_subelement_admin.php000064400000000142150240170740012110 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_subelement_admin.php");?>update_system_act.php000064400000000141150240170740010766 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_act.php");
?>vote_preview.php000064400000000127150240170740007773 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_preview.php");
?>sql.php000064400000000123150240170740006050 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/sql.php");
?>iblock_section_admin.php000064400000000137150240170740011415 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_section_admin.php");?>wizard_load.php000064400000000124150240170740007551 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/wizard_load.php");?>checklist_report.php000064400000000137150240170740010622 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/checklist_report.php");
?>
vote_user_results.php000064400000000134150240170740011047 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_user_results.php");
?>fileman_manage_snippets.php000064400000000145150240170740012125 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_manage_snippets.php");?>
webanalytics_index.php000064400000000133150240170740011126 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/webanalytics_index.php");?>vote_user_votes.php000064400000000132150240170740010504 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_user_votes.php");
?>seo_search_yandex_direct_edit.php000064400000000145150240170740013277 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_direct_edit.php");?>component_props.php000064400000000132150240170740010476 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/component_props2.php");?>culture_admin.php000064400000000136150240170740010110 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/culture_admin.php");
?>
seo_search_yandex_direct_banner.php000064400000000147150240170740013621 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_direct_banner.php");?>event_log.php000064400000000135150240170740007236 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/event_log.php");
?>
short_uri_admin.php000064400000000133150240170740010440 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/short_uri_admin.php");
?>
bitrixcloud_backup.php000064400000000144150240170740011131 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/bitrixcloud_backup.php");
?>iblock_data_import.php000064400000000126150240170740011102 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/data_import.php");?>form_field_edit_simple.php000064400000000140150240170740011734 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_field_edit_simple.php");?>
hot_keys_act.php000064400000000132150240170740007725 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/hot_keys_act.php");?>
fileman_server_access.php000064400000000143150240170740011575 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_server_access.php");?>
vote_list.php000064400000000124150240170740007262 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_list.php");
?>get_menu.php000064400000000131150240170740007053 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/get_menu.php");
?>perfmon_history.php000064400000000136150240170740010504 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_history.php");
?>
php_command_line.php000064400000000140150240170740010544 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/php_command_line.php");
?>type_admin.php000064400000000134150240170740007404 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/type_admin.php");
?>urlrewrite_list.php000064400000000135150240170740010513 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/urlrewrite_list.php");?>dhtmled.js000064400000005406150240170740006530 0ustar00// DHTML Editing Component Constants for JavaScript
// Copyright 2000 Microsoft Corporation.  All rights reserved.
//

//
// Command IDs
//
DECMD_BOLD =                      5000
DECMD_COPY =                      5002
DECMD_CUT =                       5003
DECMD_DELETE =                    5004
DECMD_DELETECELLS =               5005
DECMD_DELETECOLS =                5006
DECMD_DELETEROWS =                5007
DECMD_FINDTEXT =                  5008
DECMD_FONT =                      5009
DECMD_GETBACKCOLOR =              5010
DECMD_GETBLOCKFMT =               5011
DECMD_GETBLOCKFMTNAMES =          5012
DECMD_GETFONTNAME =               5013
DECMD_GETFONTSIZE =               5014
DECMD_GETFORECOLOR =              5015
DECMD_HYPERLINK =                 5016
DECMD_IMAGE =                     5017
DECMD_INDENT =                    5018
DECMD_INSERTCELL =                5019
DECMD_INSERTCOL =                 5020
DECMD_INSERTROW =                 5021
DECMD_INSERTTABLE =               5022
DECMD_ITALIC =                    5023
DECMD_JUSTIFYCENTER =             5024
DECMD_JUSTIFYLEFT =               5025
DECMD_JUSTIFYRIGHT =              5026
DECMD_LOCK_ELEMENT =              5027
DECMD_MAKE_ABSOLUTE =             5028
DECMD_MERGECELLS =                5029
DECMD_ORDERLIST =                 5030
DECMD_OUTDENT =                   5031
DECMD_PASTE =                     5032
DECMD_REDO =                      5033
DECMD_REMOVEFORMAT =              5034
DECMD_SELECTALL =                 5035
DECMD_SEND_BACKWARD =             5036
DECMD_BRING_FORWARD =             5037
DECMD_SEND_BELOW_TEXT =           5038
DECMD_BRING_ABOVE_TEXT =          5039
DECMD_SEND_TO_BACK =              5040
DECMD_BRING_TO_FRONT =            5041
DECMD_SETBACKCOLOR =              5042
DECMD_SETBLOCKFMT =               5043
DECMD_SETFONTNAME =               5044
DECMD_SETFONTSIZE =               5045
DECMD_SETFORECOLOR =              5046
DECMD_SPLITCELL =                 5047
DECMD_UNDERLINE =                 5048
DECMD_UNDO =                      5049
DECMD_UNLINK =                    5050
DECMD_UNORDERLIST =               5051
DECMD_PROPERTIES =                5052

//
// Enums
//

// OLECMDEXECOPT  
OLECMDEXECOPT_DODEFAULT =         0 
OLECMDEXECOPT_PROMPTUSER =        1
OLECMDEXECOPT_DONTPROMPTUSER =    2

// DHTMLEDITCMDF
DECMDF_NOTSUPPORTED =             0 
DECMDF_DISABLED =                 1 
DECMDF_ENABLED =                  3
DECMDF_LATCHED =                  7
DECMDF_NINCHED =                  11

// DHTMLEDITAPPEARANCE
DEAPPEARANCE_FLAT =               0
DEAPPEARANCE_3D =                 1 

// OLE_TRISTATE
OLE_TRISTATE_UNCHECKED =          0
OLE_TRISTATE_CHECKED =            1
OLE_TRISTATE_GRAY =               2

seo_robots.php000064400000000122150240170740007426 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_robots.php");?>highloadblock_index.php000064400000000145150240170740011236 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/highloadblock/admin/highloadblock_index.php");?>task_admin.php000064400000000132150240170740007363 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/task_admin.php");
?>seo_search_google.php000064400000000131150240170740010717 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_google.php");?>checklist_detail.php000064400000000137150240170740010551 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/checklist_detail.php");
?>
highloadblock_row_edit.php000064400000000150150240170740011737 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/highloadblock/admin/highloadblock_row_edit.php");?>admin_notify.php000064400000000131150240170740007730 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/admin_notify.php");?>forum_points_edit.php000064400000000134150240170740011004 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/points_edit.php");
?>quota.php000064400000000125150240170740006404 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/quota.php");
?>form_status_list.php000064400000000131150240170740010651 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_list.php");?>clear_component_cache.php000064400000000137150240170740011551 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/clear_component_cache.php");?>perfmon_hit_grouped.php000064400000000142150240170740011311 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_hit_grouped.php");
?>
file_dialog.php000064400000000124150240170740007510 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/tools/file_dialog.php");?>b24connector_buttons.php000064400000000132150240170740011331 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/buttons.php");
?>user_import.php000064400000000124150240170740007622 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_import.php");?>404.php000064400000000124150240170740005561 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/404.php");
?>dump_list.php000064400000000135150240170740007254 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/dump_list.php");
?>
update_system_partner_call.php000064400000000152150240170740012667 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_partner_call.php");
?>form_field_edit.php000064400000000130150240170740010362 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_field_edit.php");?>sysupdate.php000064400000000135150240170740007275 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system.php");
?>rubric_admin.php000064400000000135150240170740007712 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/rubric_admin.php");
?>
search_customrank_edit.php000064400000000144150240170740011774 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_customrank_edit.php");
?>
b24connector_open_lines.php000064400000000135150240170740011771 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/open_lines.php");
?>vote_channel_edit.php000064400000000134150240170740010725 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_channel_edit.php");
?>forum_topics.php000064400000000135150240170740007765 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_topics.php");
?>iblock_redirect_entity.php000064400000000130150240170740011767 0ustar00<?require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/iblock/admin/redirect_entity.php');clouds_file_list.php000064400000000136150240170740010600 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/clouds/admin/clouds_file_list.php");
?>
cache.php000064400000000123150240170740006314 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/cache.php");?>iblock_element_search.php000064400000000141150240170740011552 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_element_search.php");?>
translate_check_files.php000064400000000142150240170740011566 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_check_files.php");forum_words_edit.php000064400000000141150240170740010624 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_words_edit.php");
?>agreement_edit.php000064400000000127150240170740010231 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/agreement_edit.php");?>fileman_doc_roots.php000064400000000137150240170740010744 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_doc_roots.php");?>
tools_index.php000064400000000124150240170740007601 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/tools_index.php");?>composite_log.php000064400000000133150240170740010115 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/composite_log.php");?>form_validator_props.php000064400000000127150240170740011510 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/form_validator_props.php");?>filter_act.php000064400000000127150240170740007371 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/filter_act.php");?>scale_order.php000064400000000116150240170740007535 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/scale/admin/order.php");public_file_edit_src.php000064400000000127150240170740011406 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_edit_src.php");?>fileman_load_templates.php000064400000000142150240170740011742 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_load_templates.php");?>get_user.php000064400000000121150240170740007064 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/tools/get_user.php");?>b24connector_crm_forms.php000064400000000134150240170740011624 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/b24connector/admin/crm_forms.php");
?>fileman_html_editor_action.php000064400000000146150240170740012620 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_html_editor_action.php");?>iblock_element_admin.php000064400000000137150240170740011402 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_element_admin.php");?>clouds_storage_edit.php000064400000000141150240170740011273 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/clouds/admin/clouds_storage_edit.php");
?>
seo_sitemap_edit.php000064400000000130150240170750010565 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_sitemap_edit.php");?>fileman_comp2_render.php000064400000000140150240170750011323 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_comp2_render.php");?>vote_results.php000064400000000127150240170750010014 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_results.php");
?>fileman_stickers.php000064400000000134150240170750010576 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_stickers.php");?>iblock_edit.php000064400000000126150240170750007525 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_edit.php");?>iblock_xml_import.php000064400000000134150240170750010771 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_xml_import.php");?>userfield_admin.php000064400000000137150240170750010411 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/userfield_admin.php");
?>highloadblock_entity_edit.php000064400000000153150240170750012450 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/highloadblock/admin/highloadblock_entity_edit.php");?>phpinfo.php000064400000000120150240170750006712 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/phpinfo.php");?>module_admin.php000064400000000134150240170750007711 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/module_admin.php");
?>search_phrase_stat.php000064400000000140150240170750011113 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_phrase_stat.php");
?>
hot_keys_edit.php000064400000000126150240170750010107 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/hot_keys_edit.php");?>user_options.php000064400000000131150240170750010002 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/user_options.php");?>iblock_reindex_admin.php000064400000000137150240170750011410 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_reindex_admin.php");?>fileman_admin.php000064400000000137150240170750010042 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_admin.php");?>
search_sitemap.php000064400000000134150240170750010243 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_sitemap.php");
?>
public_file_new.php000064400000000122150240170750010377 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_new.php");?>security_iprule_edit.php000064400000000144150240170750011511 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_iprule_edit.php");
?>
form_mail.php000064400000000122150240170750007216 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_mail.php");?>forum_points2post_edit.php000064400000000141150240170750011773 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/points2post_edit.php");
?>iblock_element_edit.php000064400000000136150240170750011237 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_element_edit.php");?>security_otp.php000064400000000134150240170750010005 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_otp.php");
?>
search_tags_stat.php000064400000000136150240170750010574 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_tags_stat.php");
?>
forum_dictionary.php000064400000000141150240170750010627 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_dictionary.php");
?>vote_user_results_table.php000064400000000143150240170750012217 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_user_results_table.php");
?>
perfmon_panel.php000064400000000134150240170750010101 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_panel.php");
?>
perfmon_db_server.php000064400000000140150240170750010752 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_db_server.php");
?>
form_index.php000064400000000123150240170750007404 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_index.php");?>perfmon_comp_list.php000064400000000140150240170750010770 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_comp_list.php");
?>
rating_settings.php000064400000000137150240170750010463 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/rating_settings.php");
?>favorite_list.php000064400000000137150240170750010131 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/favorite_list.php");
?>message_theme_admin.php000064400000000127150240170750011234 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_admin.php");?>rubric_edit.php000064400000000134150240170750007547 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/rubric_edit.php");
?>
update_system_market_detail.php000064400000000153150240170750013030 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_market_detail.php");
?>rating_rule_list.php000064400000000140150240170750010617 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/rating_rule_list.php");
?>favorite_edit.php000064400000000143150240170750010100 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/favorite_edit.php");
?>

mobileapp_push.php000064400000000140150240170750010260 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/mobileapp/admin/mobileapp_push.php");


template_create_preview.php000064400000000140150240170750012150 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_create_preview.php");?>fileman_file_edit.php000064400000000143150240170750010673 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_file_edit.php");?>
vote_question_edit.php000064400000000135150240170750011166 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_question_edit.php");
?>composite.php000064400000000127150240170750007260 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/composite.php");?>iblock_xml_export.php000064400000000134150240170750011000 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_xml_export.php");?>fileman_js.php000064400000000126150240170750007364 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_js.php");?>template_copy.php000064400000000127150240170750010123 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/template_copy.php");?>scale_panel.php000064400000000121150240170750007516 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/scale/admin/panel.php");
?>translate_edit.php000064400000000133150240170750010255 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/translate/admin/translate_edit.php");perfmon_activity.php000064400000000137150240170750010641 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_activity.php");
?>
posting_edit.php000064400000000135150240170750007745 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/posting_edit.php");
?>
iblock_type_edit.php000064400000000133150240170750010564 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_type_edit.php");?>security_scanner.php000064400000000140150240170750010631 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_scanner.php");
?>
rating_edit.php000064400000000135150240170750007546 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/rating_edit.php");
?>smile_set.php000064400000000131150240170750007235 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_set.php");
?>site_checker.php000064400000000125150240170750007704 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/site_checker.php");?>security_hosts.php000064400000000136150240170750010345 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_hosts.php");
?>
geoip_handlers_list.php000064400000000144150240170750011273 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/geoip_handlers_list.php");
?>
security_file_verifier.php000064400000000146150240170750012020 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_file_verifier.php");
?>
iblock_convert.php000064400000000132150240170750010255 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_convert.php");?>
restore_export.php000064400000000142150240170750010337 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/restore_export.php");
?>
fileman_editor_action.php000064400000000141150240170750011570 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_editor_action.php");?>seo_search_yandex_direct.php000064400000000140150240170750012266 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_direct.php");?>fileman_html_edit.php000064400000000143150240170750010720 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_html_edit.php");?>
user_admin.php000064400000000132150240170750007400 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/user_admin.php");
?>fileman_rename.php000064400000000140150240170750010213 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_rename.php");?>
enable_component.php000064400000000132150240170750010562 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/enable_component.php");?>perfmon_table.php000064400000000134150240170750010071 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_table.php");
?>
iblock_list_admin.php000064400000000134150240170750010722 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_list_admin.php");?>scale_graph.php000064400000000121150240170750007520 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/scale/admin/graph.php");
?>forum_words.php000064400000000134150240170750007622 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_words.php");
?>public_file_edit.php000064400000000123150240170750010534 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/file_edit.php");?>iblock_bizproc_selector.php000064400000000242150240170750012147 0ustar00<?
define("MODULE_ID", "iblock");
define("ENTITY", "CIBlockDocument");
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bizproc/admin/bizproc_selector.php");
?>message_edit.php000064400000000134150240170750007705 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/message_edit.php");
?>lang_admin.php000064400000000132150240170750007343 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/lang_admin.php");
?>security_iprule_admin.php000064400000000145150240170750011655 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_iprule_admin.php");
?>
form_field_list.php000064400000000130150240170750010411 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_field_list.php");?>dump.php000064400000000130150240170750006215 0ustar00<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/dump.php");
?>
smile_edit.php000064400000000132150240170750007370 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile_edit.php");
?>fileman_file_view.php000064400000000143150240170750010720 0ustar00<?

require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_file_view.php");?>
perfmon_row_edit.php000064400000000137150240170750010621 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_row_edit.php");
?>
forum_subscribe.php000064400000000140150240170750010442 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_subscribe.php");
?>composite_pages.php000064400000000135150240170750010436 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/composite_pages.php");?>highloadblock_rows_list.php000064400000000151150240170750012152 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/highloadblock/admin/highloadblock_rows_list.php");?>perfmon_error_list.php000064400000000141150240170750011164 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_error_list.php");
?>
iblock_admin.php000064400000000130150240170750007663 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_admin.php");?>
highloadblock_import.php000064400000000150150240170750011436 0ustar00<?php
require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/highloadblock/admin/highloadblock_import.php');form_status_mail.php000064400000000131150240170750010621 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_status_mail.php");?>bitrixcloud_monitoring_detail.php000064400000000157150240170750013400 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_detail.php");
?>index.php000064400000000130150240170750006357 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/interface/desktop.php");
?>aspro.resort_mc.php000064400000000134150240170750010374 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/aspro.resort/admin/mc.php");
?>partner_modules.php000064400000000137150240170750010462 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/partner_modules.php");
?>task_edit.php000064400000000131150240170750007220 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/task_edit.php");
?>forum_letter_edit.php000064400000000142150240170750010767 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_letter_edit.php");
?>forum_points.php000064400000000127150240170750010002 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/points.php");
?>posting_search.php000064400000000137150240170750010267 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/subscribe/admin/posting_search.php");
?>
forum_letter.php000064400000000135150240170750007764 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_letter.php");
?>settings_index.php000064400000000127150240170750010305 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/settings_index.php");?>update_system_market.php000064400000000144150240170750011506 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/update_system_market.php");
?>vote_edit.php000064400000000124150240170750007235 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_edit.php");
?>clouds_file_search.php000064400000000140150240170750011066 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/clouds/admin/clouds_file_search.php");
?>
hot_keys_list.php000064400000000126150240170750010135 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/hot_keys_list.php");?>short_uri_edit.php000064400000000132150240170750010275 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/short_uri_edit.php");
?>
form_result_list.php000064400000000134150240170750010650 0ustar00<? require ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_result_list.php"); ?>perfmon_tables.php000064400000000135150240170750010255 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_tables.php");
?>
seo_search_yandex_direct_autolog.php000064400000000150150240170750014021 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/seo/admin/seo_search_yandex_direct_autolog.php");?>forum_admin.php000064400000000134150240170750007554 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/forum/admin/forum_admin.php");
?>agreement_admin.php000064400000000130150240170750010367 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/agreement_admin.php");?>fileman_common_js.php000064400000000135150240170750010734 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_common_js.php");?>public_undo.php000064400000000116150240170750007557 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/public/undo.php");?>template_export.php000064400000000137150240170750010473 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/template_export.php");
?>bitrixcloud_monitoring_push.php000064400000000155150240170750013113 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/mobile/monitoring_push.php");
?>perfmon_cluster_graph.php000064400000000144150240170750011645 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_cluster_graph.php");
?>
vote_question_list.php000064400000000135150240170750011214 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/admin/vote_question_list.php");
?>search_phrase_list.php000064400000000140150240170750011113 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/search/admin/search_phrase_list.php");
?>
form_result_view.php000064400000000134150240170750010647 0ustar00<? require ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/admin/form_result_view.php"); ?>fileman_medialib_upload.php000064400000000144150240170750012062 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_medialib_upload.php");?>
geoip_handler_edit.php000064400000000143150240170750011061 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/geoip_handler_edit.php");
?>
fileman_manage_settings.php000064400000000145150240170750012121 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_manage_settings.php");?>
urlrewrite_reindex.php000064400000000140150240170750011173 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/urlrewrite_reindex.php");?>iblock_data_export.php000064400000000126150240170750011112 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/data_export.php");?>bitrixcloud_monitoring_admin.php000064400000000156150240170750013225 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/bitrixcloud/admin/bitrixcloud_monitoring_admin.php");
?>fileman_editor_dialog.php000064400000000141150240170750011552 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/fileman/admin/fileman_editor_dialog.php");?>perfmon_index_complete.php000064400000000145150240170750012003 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/perfmon/admin/perfmon_index_complete.php");
?>
security_otp_recovery_codes.php000064400000000150150240170750013076 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_otp_recovery_codes.php");
smile.php000064400000000125150240170750006365 0ustar00<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/smile.php");
?>security_filter.php000064400000000137150240170750010473 0ustar00<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/security/admin/security_filter.php");
?>
iblock_history_list.php000064400000000136150240170750011335 0ustar00<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/iblock/admin/iblock_history_list.php");?>composite_diff.php000064400000000134150240170750010246 0ustar00<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/composite_diff.php");?>