<?xml version="1.0"?>

<bindings id="buttonBindings"
   xmlns="http://www.mozilla.org/xbl"
   xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <binding id="button-base" extends="chrome://global/content/bindings/general.xml#basetext">
    <resources>
      <stylesheet src="chrome://global/skin/button.css"/>
    </resources>
    <implementation>
      <constructor>
      <![CDATA[
        var i;
        var children;
        if (this.tooltip == "") {
          children = this.childNodes;
          for (i = 0; i < children.length; i++) {
            if (children[i].localName == "tooltip") {
              this.tooltip = "_child";
              break;
            }
          }
        }
        ]]>
      </constructor>
    </implementation>
  </binding>

  <binding id="buttonleft" extends="chrome://global/content/bindings/button.xml#button-base">
    <content>
      <xul:hbox class="button-internal-box" align="center" flex="1">
        <xul:image class="button-icon" inherits="src"/>
        <xul:hbox class="button-text-container" align="center" flex="1">
          <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
        </xul:hbox>
      </xul:hbox>
      <children includes="menupopup"/>
    </content>
  </binding>

  <binding id="buttontop" extends="chrome://global/content/bindings/button.xml#button-base">
    <content>
      <xul:vbox class="button-internal-box" align="center" flex="1">
        <xul:image class="button-icon" inherits="src"/>
        <xul:hbox class="button-text-container" align="center" pack="center" flex="1">
          <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
        </xul:hbox>
      </xul:vbox>
      <children includes="menupopup"/>
    </content>
  </binding>
  
  <binding id="buttonright" extends="chrome://global/content/bindings/button.xml#button-base">
    <content>
      <xul:hbox class="button-internal-box" align="center" flex="1">
        <xul:hbox class="button-text-container" align="center" pack="center" flex="1">
          <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
        </xul:hbox>
        <xul:image class="button-icon" inherits="src"/>
      </xul:hbox>
      <children includes="menupopup"/>
    </content>
  </binding>

  <binding id="buttonbottom" extends="chrome://global/content/bindings/button.xml#button-base">
    <content>
      <xul:vbox class="button-internal-box" align="center" flex="1">
        <xul:hbox class="button-text-container" align="center" pack="center" flex="1">
          <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
        </xul:hbox>
        <xul:image class="button-icon" inherits="src"/>
      </xul:vbox>
      <children includes="menupopup"/>
    </content>
  </binding>

</bindings>