 
    /**
    *
    *  Unselectable text
    *  http://www.webtoolkit.info/
    *
    **/
 
    var Unselectable = {
 
        enable: function(e) {
            var e = e ? e : window.event;
 
            if (e.button != 1) {
                if (e.target) {
                    var targer = e.target;
                } else if (e.srcElement) {
                    var targer = e.srcElement;
                }
 
                var targetTag = targer.tagName.toLowerCase();
                if ((targetTag != "input") && (targetTag != "textarea")) {
                    return false;
                }
            }
        },
 
        disable: function() {
            return true;
        }
 
    }
 
    if (typeof (document.onselectstart) != "undefined") {
        document.onselectstart = Unselectable.enable;
    } else {
        document.onmousedown = Unselectable.enable;
        document.onmouseup = Unselectable.disable;
    }

/***********************************************
* Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
target.style.cursor = "default"
}

//Sample usages
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"


