function bd_disable_select(e) {
        el.select(); // as simple as this
        if(document.all) scrollTo(0,0); // but IE will jump to the bottom of the page... ~_~
        if(md) document.onmouseup = function() { bd_disable_select(); md = false; captain_hook(); return true; }
}
function captain_hook() {
        document.onmousedown = function() { t = setTimeout("bd_disable_select();",250); md = true; return true; }
        document.onmouseup = function() { clearTimeout(t); md = false; return true; }
}
function addLoadEvent(func) {
        var oldonload = window.onload;
        if (typeof window.onload != 'function') {
                window.onload = func;
        } else {
                window.onload = function() {
                        if (oldonload) { oldonload(); }
                        func();
                }
        }
}
var el,t; var md = false;
addLoadEvent(function() {
        if(document.onselectstart) { document.onselectstart = function () { return false; } } // old ie
        else {
                el = document.createElement("input");
                el.setAttribute("type","text");
                el.setAttribute("value","Bandit Design's Disable Text Selection: http://lab.bandit.co.nz/scripts/disableselect/");
                el.setAttribute("style","position: absolute; left: -9999px; "); // this doesn't work in ie ~_~
                el.style.position = "absolute"; el.style.left = "-9999px";
                document.body.appendChild(el); // append fake selection box
                captain_hook();
        }
});
