/*
///////////////////////////////////
// Author: James Denny
// Creation date: 24/08/2002 
// www.jrd.barrysworld.net/scripts/PPS/
// © James Denny 2002
///////////////////////////////////
*/
var messages=new Array()
messages[0]="Click click click! As fast as u can! You can't copy me, I'm protected man!";
messages[1]="What's the matter are you defected? Or is just that my page is protected!";
messages[2]="Saftey first, - I ALWAYS USE PROTECTION!!!"
messages[3]="Page Protection System - www.jrd.barrysworld.net/sripts/PPS/"
// Feal free to add mroe messages! (If u make agood one tell me! :oD )
var n=1;  
	
function ProtectItAll() {
	if (n==messages.length) n=0;
	document.body.oncopy=CopyProtect
	document.body.ondragstart=DragProtect
	document.onselectstart=AntiSelect
	document.oncontextmenu=SuppressImageSave;
	var node=document.createElement('INPUT');
	node.value="input!"
	node.copy="true";
	node.style.display='none';
	node.style.position='absolute';
	node.style.filter='alpha(opacity=0);';
	node.value=messages[0];
	node.id="PPS_Message";
	document.body.appendChild(node)
}

function CopyProtect() {
	from=event.srcElement;
	if (from.copy!="true") {
		var node=document.getElementById('PPS_Message');
		node.style.display='';
		node.focus();
		node.select();
		var range=node.createTextRange();
		range.copy="true";
		range.execCommand('Copy');
		node.style.display='none';
		node.value=messages[n++];
		if (n==messages.length) n=0;
		DragProtect(from)
	}
	
}

function AntiSelect() {
	from=event.srcElement;
	if (from.copy!="true") {
		return false;
	}
	else return true;
}

function DragProtect(obj) {
	from=event.srcElement;
	if (from.copy!="true") {
		return false;
	}
	return true;
}

function SuppressImageSave() {
	/* Future developement: Replace the right-click menu rather than suppressing it! */
	if (event.srcElement.tagName=='IMG'&&event.srcElement.copy!="true") return false;
}

// © James Denny 2002