While I searching for disabling right click option using Javascript code. I found this code on one of web site, This code will disable right click popup and also it will protect our website content, source from stealing. This code can be used in any HTML page.

Features:

a) This javascript function will disable the right mouse click.
b) This will stop users from easily stealing your site content and from view source.
c) You can add the message as your wish.
d) Just copy the code in to your page and enjoy the effect.

Code:
<script language=javascript>

var msg_box =”Right click prohibited”;

function dis_rightclickIE(){
if (navigator.appName == ‘Microsoft Internet Explorer’ && (event.button == 2 || event.button == 3))
alert(msg_box)
}

function dis_rightclickNS(e){
if ((document.layers||document.getElementById&&!document.all) && (e.which==2||e.which==3))
{
alert(msg_box)
return false;
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=dis_rightclickNS;
}
else if (document.all&&!document.getElementById){
document.onmousedown=dis_rightclickIE;
}
document.oncontextmenu=new Function(“alert(msg_box);return false”)



</script>