
var FCKToolbarMacrosCombo = function() {
	this.Command	= FCKCommands.GetCommand('Macro') ;
	this.Label		= this.GetLabel();
	this.Tooltip	= window.parent.SbGetLocaleByKey('WysiwygMacroTooltip');
	this.Style		= FCK_TOOLBARITEM_ICONTEXT;
}

FCKToolbarMacrosCombo.prototype = new FCKToolbarSpecialCombo;

FCKToolbarMacrosCombo.prototype.GetLabel = function() {
	return window.parent.SbGetLocaleByKey('WysiwygMacro');
}

FCKToolbarMacrosCombo.prototype.CreateItems = function(targetSpecialCombo) {
	targetSpecialCombo.FieldWidth = 70 ;
	var items = ['%placeToCut'];
	for (var i = 0; i < items.length; ++i) {
		this._Combo.AddItem(items[i], items[i]);
	}
}

var MacroPlugin = function() {
	/*...*/
};

MacroPlugin.prototype.Execute = function(){
	/*...*/
}

MacroPlugin.GetState = function() {
	return FCK_TRISTATE_OFF;
}

MacroPlugin.Execute = function(macro) {
	FCK.Focus();
	if (FCKBrowserInfo.IsIE) {
		var sel = FCK.EditorDocument.selection.createRange();
		sel.text = macro;
	} else {
		FCK.EditorDocument.execCommand("insertHTML", false, macro);
	}
}

FCKCommands.RegisterCommand('Macro', MacroPlugin);
var MacroPluginButton = new FCKToolbarMacrosCombo();
FCKToolbarItems.RegisterItem('Macro', MacroPluginButton);
