/*
var dialog	= window.parent;
var oEditor	= dialog.InnerDialogLoaded() ;
var FCK		= oEditor.FCK;
var FCKLang	= oEditor.FCKLang;
var FCKConfig	= oEditor.FCKConfig;
var FCKTools	= oEditor.FCKTools;
*/

// globals
function insertHR( cname ) {
	OpenFileBrowser( '/akarmi',640,480 );
	FCKUndo.SaveUndoStep();

	var e = FCK.EditorDocument.createElement( 'HR' );
	e.className=cname;

	var oRange = new FCKDomRange( FCK.EditorWindow );
	oRange.MoveToSelection();
	var oSplitInfo = oRange.SplitBlock();
	oRange.InsertNode( e );
	FCK.Events.FireEvent( 'OnSelectionChange' );

}
// hr page
var FCK_HRPage = function(name) {
	this.Name = name;
}
FCK_HRPage.prototype.Execute = function() {
	insertHR( "hrpage" );
}
FCK_HRPage.prototype.GetState = function() {
	return FCK_TRISTATE_OFF;
}

// hr lead
var FCK_HRLead = function(name) {
	this.Name = name;
}

FCK_HRLead.prototype.Execute = function() {
	insertHR( "hrlead" );
}
FCK_HRLead.prototype.GetState = function() {
	return FCK_TRISTATE_OFF;
}

// register commands
FCKCommands.RegisterCommand( 'HRPage', new FCK_HRPage('HRPage') );
FCKCommands.RegisterCommand( 'HRLead', new FCK_HRLead('HRLead') );

// register toolbar buttons
var oHRPage = new FCKToolbarButton( 'HRPage' , FCKLang['HRPage'] );
oHRPage.IconPath = '/fckplugins/articles/hrpage.gif';

var oHRLead = new FCKToolbarButton( 'HRLead' , FCKLang['HRLead'] );
oHRLead.IconPath = '/fckplugins/articles/hrlead.gif';

FCKToolbarItems.RegisterItem( 'HRPage',oHRPage );
FCKToolbarItems.RegisterItem( 'HRLead',oHRLead );

