var isnn,isie, isff;

if(navigator.appName=='Microsoft Internet Explorer') //check the browser
{  isie=true; }

if(navigator.appName=='Netscape')
{  isnn=true; }



function right(e) //to trap right click button 
{
	

	if (isnn && (e.which == 3 || e.which == 2 )){
		//alert("Sorry, you do not have permission to right click on this page.......");
		document.oncontextmenu=new Function("return false");
		//return false;
	}
	else if (isie && (event.button == 2 || event.button == 3)) 
	{
		alert("Sorry, you do not have permission to right click on this page...");
		return false;
	}
	
		
}



function key(e)   
{
	//alert("aa"+e.keyCode);
	//	false;
	//IE
	if(isie){ 
		//if(event.keyCode==17 || event.keyCode==18 || event.keyCode==93) { 
		if(event.keyCode==67) { 
			alert("Sorry, you do not have permission to press this key..") ;
			return false;
		 } 
	}
	//Firefox mozilla, Netscape
	if(isnn){
		//if(e.keyCode==17 || e.keyCode==18 || e.keyCode==93) { 
		//if(e.keyCode==67) {   //17 = ctrl, 67 = c
			//alert("Sorry, you do not have permission to press this key....") ;
			
			return false;
		 } 
	}   
}

if (document.layers) 
	window.captureEvents(Event.KEYPRESS);  
if (document.layers) 
	window.captureEvents(Event.MOUSEDOWN);
if (document.layers) 
	window.captureEvents(Event.MOUSEUP);

document.onkeydown=key;  
document.onmousedown=right;
//document.onmouseup=right;


