function SE_RegisterCustomPlugins(oEditor, elAppContainer){
//	oEditor.registerPlugin(new nhn.husky.SE_ToolbarToggler(elAppContainer));
	oEditor.registerPlugin(new nhn.husky.SE_ImgInsert(elAppContainer));
}

// Sample plugin. Use CTRL+T to toggle the toolbar
nhn.husky.SE_ToolbarToggler = $Class({
	name : "SE_ToolbarToggler",

	$init : function(oAppContainer){
		this._assignHTMLObjects(oAppContainer);
	},

	_assignHTMLObjects : function(oAppContainer){
		oAppContainer = $(oAppContainer) || document;
		this.toolbarArea = cssquery.getSingle(".tool", oAppContainer);
	},

	$ON_MSG_APP_READY : function(){
		this.oApp.exec("SE_TOGGLE_TOOLBAR", []);
		this.oApp.exec("REGISTER_HOTKEY", ["ctrl+t", "SE_TOGGLE_TOOLBAR", []]);
	},

	$ON_SE_TOGGLE_TOOLBAR : function(){
		this.toolbarArea.style.display = (this.toolbarArea.style.display == "none")?"block":"none";
		this.oApp.exec("MSG_EDITING_AREA_SIZE_CHANGED", []);
	}
});

//image insertion plugin (by gojeong)
nhn.husky.SE_ImgInsert = $Class({
	name : "SE_ImgInsert",

	$init : function(elAppContainer){
		this._assignHTMLObjects(elAppContainer);
	},

	_assignHTMLObjects : function(elAppContainer){
		this.oImageInsertLayer = cssquery.getSingle("DIV.husky_seditor_ImgInsert_layer", elAppContainer);
		this.oBtnConfirm = cssquery.getSingle("BUTTON.confirm", this.oImageInsertLayer);
		this.oBtnCancel = cssquery.getSingle("BUTTON.cancel", this.oImageInsertLayer);
		this.oBtnClose = cssquery.getSingle("BUTTON.close", this.oImageInsertLayer);

		var oTmp = cssquery("INPUT", this.oImageInsertLayer);
		this.oUrlInput = oTmp[0];
		this.oAltInput = oTmp[1];
	},

	$ON_MSG_APP_READY : function(){
		this.oApp.exec("REGISTER_UI_EVENT", ["ImgInsert", "click", "SE_TOGGLE_IMGINSERT_LAYER"]);
		this.oApp.registerBrowserEvent(this.oBtnConfirm, "mousedown", "SE_APPLY_IMAGEINSERT");
		this.oApp.registerBrowserEvent(this.oBtnCancel, "mousedown", "SE_CLOSE_IMAGEINSERT");
		this.oApp.registerBrowserEvent(this.oBtnClose, "mousedown", "SE_CLOSE_IMAGEINSERT");
	},

	$ON_SE_APPLY_IMAGEINSERT : function() {
		var sURL = this.oUrlInput.value;
		this.oSelection = this.oApp.getSelection();
		if (sURL != "") {
			var str = "<img src='" + sURL + "' alt='" + this.oAltInput.value + "' />";
			this.oSelection.pasteHTML(str);
			this.oUrlInput.value = "";
			this.oAltInput.value = "";
			this.oApp.exec("HIDE_ACTIVE_LAYER");
		} else {
			alert("input file path!");
			this.oUrlInput.focus();
		}
	},

	$ON_SE_CLOSE_IMAGEINSERT : function() {
		this.oUrlInput.value = "";
		this.oAltInput.value = "";
		this.oApp.exec("HIDE_ACTIVE_LAYER");
	},

	$ON_SE_TOGGLE_IMGINSERT_LAYER : function(){
		this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER", [this.oImageInsertLayer]);
	}
});