
isNN = document.layers ? 1 : 0; 

function noContext(){return false;}

function noContextKey(e) {
    if(isNN){
        if (e.keyCode == 96){ return (false);}
    } else {
        if (e.keyCode == 96){ return (false);}
    }
}

function noClick(e) {    
    if(isNN){
        if(e.which > 1) {return false;}
    } 
    else if(e) { 
        if(e.button > 1){return false;}
    }
}

if(isNN){ 
    document.captureEvents(Event.MOUSEDOWN);
}

document.oncontextmenu = noContext;
document.onkeypress    = noContextKey;
document.onmousedown   = noClick;
document.onmouseup     = noClick;


function disableSelection(target)
{
    //IE route
    if (typeof target.onselectstart!="undefined") {
	   target.onselectstart=function() {return false}
    }
    
    //Firefox route
    else if (typeof target.style.MozUserSelect!="undefined") {
        target.style.MozUserSelect="none";
    }
    //All other route (ie: Opera)
    else {	
        target.onmousedown=function(){return false}
    }
    target.style.cursor = "default"
}

disableSelection(document.body);