/**
 * SbCrop plugin for FCKeditor
 *
 * @copyright (c) 2004-2008, SWsoft
 */
var FCKSbCrop = function() {
	this.Name = 'SbCrop';
}

FCKSbCrop.prototype.Execute = function() {
	self.parent.SbProduceModalForm('SbCropForm', self.parent.baseUrl +'/Ajax/Wizard/Edit/Wysiwyg/SbCropForm');
	self.parent.sbCropFormObject.open();
}

FCKSbCrop.prototype.GetState = function() {
	var image = FCKSelection.GetSelectedElement();

	return (image && (image.tagName == 'IMG'))
		? FCK_TRISTATE_OFF
		: FCK_TRISTATE_DISABLED;
}

FCKCommands.RegisterCommand('SbCrop', new FCKSbCrop());

var sbCropButton = new FCKToolbarButton(
	'SbCrop',
	self.parent.SbGetLocaleByKey('cropImage'),
	null,
	null,
	false,
	true
);
FCKToolbarItems.RegisterItem('SbCrop', sbCropButton);