var FoundFocus = false;

function setFoundFocus() {
	FoundFocus = true;
}

function resetFoundFocus() {
	FoundFocus = false;
}

function getFoundFocus() {
	return FoundFocus;
}

function SetupEvents() {
	
	if (window.sidebar)
	{	document.onmousedown=handleMouseDown;
		document.onclick=handleClick;
	}
	if (document.all)	
		document.onselectstart=handleSelectStart
	}
	
SetupEvents();

document.oncontextmenu=function() {
	event.returnValue=false;
}

document.oncopy=function() {
	event.returnValue=false;
}

document.onselectstart=function() {
	event.returnValue=false;
}

document.onpaste=function() {
	event.returnValue=false;
}

function handleSelectStart(evnt) {
	return false;
}

function handleMouseDown(evnt) {
	return (window.sidebar )?(getFoundFocus())?true:false:false;
}

function handleClick(evnt) {
	return true;
}

function CheckForFormFocus() {
	var i = j = 0;
	
	while (i < document.forms.length && !getFoundFocus()) {
			j = 0;
		
		while (j < document.forms[i].length && !getFoundFocus()) {
			document.forms[i].elements[j].onmouseover = setFoundFocus;
			document.forms[i].elements[j].onmouseout = resetFoundFocus;
			j++;
			}
		i++;
	}         
}













