var CopyProtect = {}
CopyProtect.conf_container_id = 'antcp'; // container ID for disabling selecting text
CopyProtect.conf_clear_buffer = 'off'; // turn on/off clearing buffer
CopyProtect.conf_disable_right_click = 'on'; // turn on/off disabling right click
CopyProtect.text_container = null;

CopyProtect.init = function() {
	CopyProtect.text_container = document.getElementById(CopyProtect.conf_container_id);
	CopyProtect.disableSelection(CopyProtect.text_container);	
	// clear copy buffer every 100ms
	if(CopyProtect.conf_clear_buffer == 'on')
		setInterval(CopyProtect.clearClipboard, 100);		
	if (CopyProtect.conf_disable_right_click == 'on') {
		if (document.layers) {
			document.captureEvents(Event.MOUSEDOWN);document.onmousedown=CopyProtect.clickNS;
		} else {
			document.onmouseup=CopyProtect.clickNS;document.oncontextmenu=CopyProtect.clickIE;
		}
		document.oncontextmenu=new Function("return false");
	}
}
CopyProtect.disableSelection = function(target) {
	target.ondragstart = function() { return false; };
	target.onclick = function() { return true; };	
	if (typeof target.onselectstart!="undefined") //IE route
		target.onselectstart=function(){return false};
	else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
		target.style.MozUserSelect="none";
	else //All other route (ie: Opera)
		target.onmousedown=function(){return false};
	target.style.cursor = "default";
}
// works in IE only
CopyProtect.clearClipboard = function() {
	if(CopyProtect.conf_clear_buffer != 'on') return false;
	if ( window.clipboardData ) {
		window.clipboardData.clearData();
	}
}
//Disable right click script
CopyProtect.clickIE = function() {if (document.all) {return false;}}
CopyProtect.clickNS = function(e) {
	if(document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {return false;}
	}
}
