//  Disables F5 refresh and right-clicks, at least in Internet Explorer.
//  Free code provided by http://www.faqts.com/knowledge_base/entry/versions/index.phtml?aid=6516

//disable right click
function right(e) {

if (navigator.appName == 'Netscape' &&

(e.which == 3 || e.which == 2))

return false;

else if (navigator.appName == 'Microsoft Internet Explorer' &&

(event.button == 2 || event.button == 3)) {

alert("Sorry, you do not have permission to right click.");

return false;

}

return true;

}

 

document.onmousedown=right;

document.onmouseup=right;

if (document.layers) window.captureEvents(Event.MOUSEDOWN);

if (document.layers) window.captureEvents(Event.MOUSEUP);

window.onmousedown=right;

window.onmouseup=right;

 

document.onkeydown = function(){

 

if(window.event && window.event.keyCode == 116)

        { // Capture and remap F5

    window.event.keyCode = 505;

      }

 

if(window.event && window.event.keyCode == 505)

        { // New action for F5

alert("Sorry, you do not have permission to refresh.");        

    return false;

        // Must return false or the browser will refresh anyway

    }

}

 

