var mac = navigator.userAgent.indexOf('Mac')!=-1;

function cancelClick(e){
    var forbiddenKeys = new Array("a", "c", "x");
    if(document.all){
        if (event.ctrlKey){
            var key = window.event.keyCode;  
            for(i=0; i<forbiddenKeys.length; i++)
                {
                    //case-insensitive comparation
                    if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                    {
                        return false;
                    }
                }
        } else if (event.button == 2 || event.button == 3){
            return(false);
        } else if (mac&&(event.ctrlKey||event.keyCode==91)){
            return(false); 
        }
    } else {
        if (e.ctrlKey){
            var key = e.keyCode;
    	    if (mac){
                var key=e.modifiers;
            }
        
    	    for(i=0; i<forbiddenKeys.length; i++)
                {
                    //case-insensitive comparation
                    if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                    {
                        return false;
                    }
            }
        } else if(e.which==3||(mac&&(e.modifiers==2||e.ctrlKey))){
            return false;
        } else if(e.which==1){
            window.captureEvents(Event.MOUSEMOVE);
            window.onmousemove=function(){return false;};
        } else if (mac && e.metaKey){
            return false;
        }
    }
}

document.onselectstart = new Function("return false");
document.ondragstart = new Function("return false")
document.oncontextmenu = new Function("return false")

if (document.layers) window.captureEvents(Event.MOUSEDOWN); 

document.onmousedown = cancelClick; 
window.onmousedown = cancelClick; 
document.onkeydown = cancelClick;







