BitSeven Hide Buy Buttons

Prevent hitting the buy buttons accidently on Bitseven. We'll hide/unhide them with a double click.

// ==UserScript==
// @name         BitSeven Hide Buy Buttons
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Prevent hitting the buy buttons accidently on Bitseven. We'll hide/unhide them with a double click. 
// @author       LordSnooze
// @match        https://www.bitseven.com/Trading
// @grant        none
// ==/UserScript==


window.ondblclick = myScript;

var booDisabled = false;

//Function to clear selection when someone double clicks on a page
function clearSelection(){
    if (window.getSelection) {
        window.getSelection().removeAllRanges();
    } else if (document.selection) {
        document.selection.empty();
    }
}

function myScript() {
    var x = document.getElementById("orderForm");
    var y = x.getElementsByTagName("div");
    var i;
    for (i = 0; i < y.length; i++) {
        if (y[i].getAttribute("class") == "order-action") {
            if(booDisabled === false){
                 y[i].hidden = true;
                booDisabled = true;
                clearSelection();
            } else {
                y[i].hidden = false;
                booDisabled = false;
                clearSelection();
            }
        }
    }
}