var CopyProtection = {
	cookie_name: 'copyright_note',
	is_notified: null,
	notify_message: null,
	
	init: function(message) {
	    CopyProtection.notify_message = message;
	    
	    if (Cp_Cookie.getCookie(CopyProtection.cookie_name)) {
	        CopyProtection.is_notified = true;
	    }
	    else {
	    	CopyProtection.is_notified = false;
	    	
	    	var ps = document.getElementsByTagName('P');
	    	for (i=0; i<ps.length; i++) {
	    	    if (ps[i].className.indexOf('copy-protected')!==-1) {
		    	    ps[i].oncopy = CopyProtection.notify;
	    	    }
	    	}
	    	
	    	var divs = document.getElementsByTagName('DIV');
	    	for (i=0; i<divs.length; i++) {
	    	    if (divs[i].className.indexOf('copy-protected')!==-1) {
		    	    divs[i].oncopy = CopyProtection.notify;
	    	    }
	    	}
	    }
	},
	
	notify: function() {
	    if (!CopyProtection.is_notified) {
		    alert(CopyProtection.notify_message);
		    CopyProtection.is_notified = true;
		    Cp_Cookie.setCookie(CopyProtection.cookie_name, 1, 14);
	    }
	},
	
	disableCopy: function() {
    	var ps = document.getElementsByTagName('P');
    	for (i=0; i<ps.length; i++) {
    	    if (ps[i].className.indexOf('copy-protected')!==-1) {
	    	    ps[i].oncopy = CopyProtection.prevent;
	    	    ps[i].onselectstart = CopyProtection.prevent;
    	    }
    	}
    	
    	var divs = document.getElementsByTagName('DIV');
    	for (i=0; i<divs.length; i++) {
    	    if (divs[i].className.indexOf('copy-protected')!==-1) {
	    	    divs[i].oncopy = CopyProtection.prevent;
	    	    divs[i].onselectstart = CopyProtection.prevent;
    	    }
    	}
	},
	
	prevent: function() {
		return false;
	}
}
