<?xml version="1.0"?>
<xbl:bindings xmlns     = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
              xmlns:xbl = "http://www.mozilla.org/xbl"
              type      = "text/javascript">

    <xbl:binding id="extrasBtn">
        <xbl:implementation>
            <xbl:method name="openExtras">
                <xbl:body>
                    <![CDATA[
                        try {
                            //get the nsiFile object of "extras.htm"
                            var oFile = Components.classes["@mozilla.org/file/directory_service;1"]
                                                  .getService(Components.interfaces.nsIProperties)
                                                  .get("CurProcD", Components.interfaces.nsIFile);
                            oFile.append("ocoll2e.data");
                            oFile.append("extras");
                            oFile.append("extras.htm");

                            if (!oFile)
                                return;

                            //get its location starting by "file://"
                            var oIoService = Components.classes["@mozilla.org/network/io-service;1"]
                                                       .getService(Components.interfaces.nsIIOService);
                            var oFileHandler = oIoService.getProtocolHandler("file")
                                                        .QueryInterface(Components.interfaces.nsIFileProtocolHandler);
                            var sUrl = oFileHandler.getURLSpecFromFile(oFile);
                            
                            //open the html in the default browser
                            if (sUrl)
                                openDefBrowser(sUrl);
                        } catch (err) { }
                    ]]>
                </xbl:body>
            </xbl:method>
        </xbl:implementation>
        <xbl:handlers>
            <xbl:handler event="click" action="this.openExtras();"/>
        </xbl:handlers>
    </xbl:binding>
    <xbl:binding id="gamesBtn">
        <xbl:handlers>
            <xbl:handler event="click" action="openGamesPopup();"/>
        </xbl:handlers>
    </xbl:binding>

</xbl:bindings>
