//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

/**
* @update 13-06-2007, Alin
* Script updated so it is now optional to
* alert a user of "no richt click allowed".
* NB: update can not work as intended!!!
*
* @warning
*		THIS SCRIPT IS NOT OBJECT ORIENTED AND IT IS
*		POSSIBLE THAT IT WILL RESULT IN CONFLIGTS WITH
*		OTHER JAVASCRIPT-CODE. USE IT WITH CARE.
*/

var message = "Det er ikke tilladt at kopiere indhold fra denne hjemmeside!";

/**
* If false, alert will not
* be displayed.
*
* @var boolean
*/
var displayAlert = true;

///////////////////////////////////
function clickIE4(){
	if (event.button==2){
		if(displayAlert == true){
			alert(message);
		}
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			if(displayAlert == true){
				alert(message);
			}
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
} else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}

document.oncontextmenu = new Function("alert(message); return false");
