thank you so much
function EnableRightClick( ) {
var elements = [ document, document.body, window ],
images = document.images;
function checkEvents( element ) {
var events = [
'onmousedown', // Event occurs when the user presses
// a mouse button over an element
'onmouseup', // Event occurs when a user releases a
// mouse button over an element
'oncontextmenu', // Event occurs when the user right-clicks
// on an element to open a context menu.
'onselectstart',
'oncopy', // Event occurs when the user copies content.
'oncut' // Event occurs when the user cuts content.
],
button = /\.button/gi,
regex = /[return\s?false|preventdefault]/gi;
/*
// Jquery
try {
var jbound = $( element ).data( "events" ),
len = Object.keys( jbound );
if( len ) {
console.dir( jbound );
//$( element ).unbind( );
}
} catch( e ) {
//
}
*/
for( var i = 0, len = events.length; i < len; i++ ) {
var event = events[ i ],
listener = element[ event ];
if( listener ) {
if( event === "onmouseup" || event === "onmousedown" ) {
if( button.test( String( listener ) ) ) {
element[ event ] = null;
}
} else {
if( regex.test( String( listener ) ) ) {
element[ event ] = null;
}
}
}
}
};
for( var i = 0, len = elements.length; i < len; i++ ) {
checkEvents( elements[ i ] );
}
for( var i = 0, len = images.length; i < len; i++ ) {
checkEvents( images[ i ] );
}
}EnableRightClick( );