function HTMLEditor(action) {
	if (action == undefined) { action=''; }
	if (window.CKEDITOR !== undefined && window.CKEDITOR != null && action=='start') {
		var editors = getElementsByStyleClass("html_editor");
		for (var i=0;i<editors.length;i++) {
			if (document.getElementById(editors[i].id).HTMLeditor !== undefined && document.getElementById(editors[i].id).HTMLeditor !== null) {
				document.getElementById(editors[i].id).HTMLeditor.destroy();
				document.getElementById(editors[i].id).HTMLeditor=undefined;
			}
			if (document.getElementById(editors[i].id).style.width) { ewidth=document.getElementById(editors[i].id).style.width; } else { ewidth="100%"; }
			if (document.getElementById(editors[i].id).style.height) { eheight=document.getElementById(editors[i].id).style.height; } else { eheight="380px"; }
			document.getElementById(editors[i].id).HTMLeditor=CKEDITOR.replace(editors[i].id,{skin:'kama',uiColor:'#e6edf3',width:ewidth,height:eheight,filebrowserBrowseUrl:'./data/addones/ckeditor/imglib/index.html',toolbar:[['Source','-','Find','-','Undo','Redo','-','Preview','Print','-','Maximize'],'/',['Font','FontSize','-','Bold','Italic','Underline','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],'/',['TextColor','BGColor','-','Outdent','Indent','-','NumberedList', 'BulletedList','-','Image','Table','Link','Iframe','SpecialChar','-','ShowBlocks','-','RemoveFormat']]});
		}
	} else {
		window.CKEDITOR=undefined;
		CKEDITOR=undefined;
		include('./data/addones/ckeditor/ckeditor.js','ckeditor');
	}
}

function HTMLEditor_save(id) {
	if (document.getElementById(id)) {
		if (document.getElementById(id).value) {
			document.getElementById(id).value=CKEDITOR.instances[id].getData();
		} else {
			document.getElementById(id).innerHTML=CKEDITOR.instances[id].getData();
		}
	}
}

