
' Suppress errors in case ActiveXEditing.vbs is not available.
On Error Resume Next


Call EnableCompatibleToolbarHooks


Sub OnToolbarInitialize( ByVal pToolbarInterface )
	Dim CustomToolbar
	Set CustomToolbar = document.ToolbarInterface.Toolbars.CreateToolbar("Editing")
	
	Call CustomToolbar.AddButton("HorizontalRule", "", "under.gif", "Add Rule")
End Sub

Sub OnToolbarStateInitialize( ByVal strPlaceholderName, ByVal pState )
	If (pState.Item("FormatBlock").Allowed = True) Then
		pState.Item("HorizontalRule").Allowed = True		
	Else
		pState.Item("HorizontalRule").Allowed = False
	End If
End Sub



Sub OnToolbarUpdate( ByVal pActiveHtmlEditor, ByVal bEditingSource )
	If bEditingSource Then
		pActiveHtmlEditor.ToolbarState.Item("HorizontalRule").Enabled = False
	Else
		pActiveHtmlEditor.ToolbarState.Item("HorizontalRule").Enabled = True
	End If
End Sub

Sub OnToolbarEvent( Byval pActiveHtmlEditor, ByVal bstrId, ByVal pItem, ByVal bEditingSource )

	Select Case bstrId
		Case "HorizontalRule"
			Call WBC_horizontalRule(pActiveHtmlEditor.DOM, pActiveHtmlEditor)		
	End Select
End Sub
