<!-- preferences -->
<div class="toolbarTabs">
    <menu id="preferencesTabs" class="tab-menu">
        <li id="PrefBehaviorLink" class="selected">
            <a><img alt="QBT_TR(Behavior)QBT_TR[CONTEXT=OptionsDialog]" src="images/preferences-desktop.svg" width="16" height="16">QBT_TR(Behavior)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefDownloadsLink">
            <a><img alt="QBT_TR(Downloads)QBT_TR[CONTEXT=OptionsDialog]" src="images/download.svg" width="16" height="16">QBT_TR(Downloads)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefConnectionLink">
            <a><img alt="QBT_TR(Connection)QBT_TR[CONTEXT=OptionsDialog]" src="images/network-connect.svg" width="16" height="16">QBT_TR(Connection)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefSpeedLink">
            <a><img alt="QBT_TR(Speed)QBT_TR[CONTEXT=OptionsDialog]" src="images/slow_off.svg" width="16" height="16">QBT_TR(Speed)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefBittorrentLink">
            <a><img alt="QBT_TR(BitTorrent)QBT_TR[CONTEXT=OptionsDialog]" src="images/preferences-bittorrent.svg" width="16" height="16">QBT_TR(BitTorrent)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefRSSLink">
            <a><img alt="QBT_TR(RSS)QBT_TR[CONTEXT=OptionsDialog]" src="images/application-rss.svg" width="16" height="16">QBT_TR(RSS)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefWebUILink">
            <a><img alt="QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]" src="images/preferences-webui.svg" width="16" height="16">QBT_TR(WebUI)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
        <li id="PrefAdvancedLink">
            <a><img alt="QBT_TR(Advanced)QBT_TR[CONTEXT=OptionsDialog]" src="images/preferences-advanced.svg" width="16" height="16">QBT_TR(Advanced)QBT_TR[CONTEXT=OptionsDialog]</a>
        </li>
    </menu>
    <div class="clear"></div>
</div>

<script>
    "use strict";

    (() => {
        MochaUI.initializeTabs("preferencesTabs");

        const showTab = (element) => {
            for (const tab of document.querySelectorAll(".PrefTab"))
                tab.classList.toggle("invisible", (tab !== element));
        };

        document.getElementById("PrefBehaviorLink").addEventListener("click", (e) => {
            showTab(document.getElementById("BehaviorTab"));
        });
        document.getElementById("PrefDownloadsLink").addEventListener("click", (e) => {
            showTab(document.getElementById("DownloadsTab"));
        });
        document.getElementById("PrefConnectionLink").addEventListener("click", (e) => {
            showTab(document.getElementById("ConnectionTab"));
        });
        document.getElementById("PrefSpeedLink").addEventListener("click", (e) => {
            showTab(document.getElementById("SpeedTab"));
        });
        document.getElementById("PrefBittorrentLink").addEventListener("click", (e) => {
            showTab(document.getElementById("BittorrentTab"));
        });
        document.getElementById("PrefRSSLink").addEventListener("click", (e) => {
            showTab(document.getElementById("RSSTab"));
        });
        document.getElementById("PrefWebUILink").addEventListener("click", (e) => {
            showTab(document.getElementById("WebUITab"));
        });
        document.getElementById("PrefAdvancedLink").addEventListener("click", (e) => {
            showTab(document.getElementById("AdvancedTab"));
        });
    })();
</script>
