var specialcase = ((navigator.userAgent.indexOf('Mac') != -1) || document.all)
var flag = 0;
var msg = 'Copyrigt 2006 by the Inna and Michael Rogatchi Foundation.\nPlease do not copy the image.';
var x,y,x1,y1,copyAttempt;

if (window.event)
{
   document.captureEvents(Event.MOUSEMOVE);
}

function checkIt(e)
{
  copyAttempt = 0;
  if (window.event)
  {
    x = window.event.clientX;
    y = window.event.clientY;
    ClickedButton = (window.event.button > 1);
  }
  else if (e)
  {
    x = e.screenX;
    y = e.screenY;
    ClickedButton = (e.which > 1);
  }
  if (ClickedButton)
  {
    copyAttempt = 1;
    flag = 0;
    //Catch the Mozilla Menu
		d = new Date() //Set today's date
		while (1)
    {
      mill=new Date() //When the date is now
      diff = mill-d   //and the difference is in milliseconds
      if( diff > 400 )
      {
		  	break;
	   	}
  	}
    alert(msg);
    return false; // This is for Netscape Navigator 4 only
  }
  if (specialcase) flag = 1;
    return false;
}

function special(e)
{
	theObj = '';
	if (window.event)
	{
		x1 = window.event.clientX;
		y1 = window.event.clientY;
		theObj = window.event.srcElement.parentElement.tagName;
	}
	else if (e)
	{
		x1 = e.screenX;
		y1 = e.screenY;
		if (e.target.parentNode)
      theObj = e.target.parentNode.tagName;
	}
	var isLink = (theObj == 'A');
	if (flag && (!isLink || ((Math.abs(x-x1) > 20) || (Math.abs(y-y1) > 20))))
	{
		copyAttempt = 1;
		flag = 0;
		alert(msg);
		return false;
	}
}

function clearIt()
{
	flag = 0;
	if (copyAttempt)
	{
		copyAttempt = 0;
		return false;
	}
}