(function () {
	var URL = window.UEDITOR_HOME_URL || getUEBasePath();
	var ESPCMSURL = URL.replace('espcms_admin_includes/ueditor/', '');
	window.UEDITOR_CONFIG = {
		UEDITOR_HOME_URL: URL,
		serverUrl: ESPCMSURL + "index.php?act=FileManage/uploadFileConfig",
		toolbars: [[
				'fullscreen', 'source', '|', 'undo', 'redo', '|',
				'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
				'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
				'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
				'directionalityltr', 'directionalityrtl', 'indent', '|',
				'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
				'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
				'seapoaaddpic', 'simpleupload', 'insertimage', 'seapoaaddvideo', 'insertvideo', 'seapoaaddfilelink', '|', 'scrawl', 'wordimage', 'snapscreen', '|', 'map', 'gmap', 'template', '|',
				'horizontal', 'date', 'time', 'spechars', '|', 'insertcode',
				'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
				'pagebreak', 'searchreplace', 'preview'
			]],
		enableAutoSave: false,
		autoHeightEnabled: false,
		wordCount: false,
		imagePopup: false,
		allowDivTransToP: false,
		elementPathEnabled: false
	};
	function getUEBasePath(docUrl, confUrl) {
		return getBasePath(docUrl || self.document.URL || self.location.href, confUrl || getConfigFilePath());
	}
	function getConfigFilePath() {
		var configPath = document.getElementsByTagName('script');
		return configPath[ configPath.length - 1 ].src;
	}
	function getBasePath(docUrl, confUrl) {
		var basePath = confUrl;
		if (/^(\/|\\\\)/.test(confUrl)) {
			basePath = /^.+?\w(\/|\\\\)/.exec(docUrl)[0] + confUrl.replace(/^(\/|\\\\)/, '');
		} else if (!/^[a-z]+:/i.test(confUrl)) {
			docUrl = docUrl.split("#")[0].split("?")[0].replace(/[^\\\/]+$/, '');
			basePath = docUrl + "" + confUrl;
		}
		return optimizationPath(basePath);
	}
	function optimizationPath(path) {
		var protocol = /^[a-z]+:\/\//.exec(path)[ 0 ],
			tmp = null,
			res = [];
		path = path.replace(protocol, "").split("?")[0].split("#")[0];
		path = path.replace(/\\/g, '/').split(/\//);
		path[ path.length - 1 ] = "";
		while (path.length) {
			if ((tmp = path.shift()) === "..") {
				res.pop();
			} else if (tmp !== ".") {
				res.push(tmp);
			}
		}
		return protocol + res.join("/");
	}
	window.UE = {
		getUEBasePath: getUEBasePath
	};
})();
var miniconfing = [[
		'fullscreen', 'source', '|',
		'undo', 'redo', '|',
		'bold', 'italic', 'underline', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
		'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', '|',
		'fontfamily', 'fontsize', '|',
		'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
		'touppercase', 'tolowercase', '|',
		'link', 'unlink', '|',
		'seapoaaddpic', 'simpleupload', 'insertimage', 'seapoaaddvideo', 'insertvideo', 'seapoaaddfilelink',
	]];
var bbsconfing = [[
		'undo', 'redo', '|', 'emotion',
		'bold', 'italic', 'underline', 'pasteplain', '|',
		'insertorderedlist', 'insertunorderedlist', '|',
		'fontfamily', 'fontsize', '|',
		'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify'
	]];
var fullconfing = [[
		'fullscreen', 'source', '|',
		'undo', 'redo', '|',
		'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
		'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
		'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
		'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
		'directionalityltr', 'directionalityrtl', 'indent', '|',
		'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
		'touppercase', 'tolowercase', '|',
		'link', 'unlink', 'anchor', '|',
		'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
		'seapoaaddpic', 'simpleupload', 'insertimage', 'seapoaaddvideo', 'insertvideo', 'seapoaaddfilelink', '|',
		'scrawl', 'wordimage', 'snapscreen', '|',
		'map', 'gmap', 'template', '|',
		'horizontal', 'date', 'time', 'spechars', '|',
		'insertcode', 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
		'pagebreak', 'searchreplace', 'preview'
	]];
var editconfing = [[
		'fullscreen', 'source', '|',
		'undo', 'redo', '|',
		'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
		'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
		'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
		'fontfamily', 'fontsize', '|',
		'directionalityltr', 'directionalityrtl', 'indent', '|',
		'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|',
		'touppercase', 'tolowercase', '|',
		'link', 'unlink', 'anchor', '|',
		'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
		'seapoaaddpic', 'simpleupload', 'insertimage', 'seapoaaddvideo', 'insertvideo', 'seapoaaddfilelink', '|',
		'wordimage', 'snapscreen', '|',
		'map', 'gmap', '|',
		'horizontal', 'date', 'time', 'spechars', 'seapoapagebreak', '|',
		'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols'
	]];