function setShortcuts(p) {
    if (!p) {
        p = (document.getElementById("_selector").selectedIndex == 0) ? 1 : 0;
    } else {
        if (p < 0) p = (navigator.platform.indexOf("Mac") != -1) ? 1 : 0;
    }
    var c = (p == 0) ? 1 : 0;
    var s = document.getElementById("_shortcutSelector" + p.toString());
    if (s) {
        if (!s.selected) s.selected = true;
    }
    processElements(p, c, "shortcut", "inline");
    processElements(p, c, "access", "block");
}

function processElements(p, c, cls, s) {
    var coll = document.getElementsByClassName(cls);
    for (var i = 0; i < coll.length; i++) {
        try {
            if (cls == "access") {
                var divs = coll[i].getElementsByTagName("div");
                divs[p].style.display = s;
                divs[c].style.display = "none";
            } else {
                coll[i].childNodes.item(p).style.display = s;
                coll[i].childNodes.item(c).style.display = "none";
            }
        } catch(e) {
            //It's just a malformed node, we don't need to do anything here at all.
        }
    }
}
