﻿// JavaScript image protection code
function right(e)
{
  var msg = "This image is copyrighted by Lindsay Colbus. For additional information, please email LindsayColbus.com <webmaster@lindsaycolbus.com>.";
  //window.alert(e.which);
  if (navigator.appName == 'Netscape')
  // || (navigator.userAgent.indexOf('Mac') != -1 && e.which == 1)
    if ( e.which == 3  )
    {
      window.alert(msg);
      return false;
    }
    else return true;
  else if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2)
  {
    window.alert(msg);
    return false;
  }
  else return true;
}

function trap()
{
  //window.alert("in trap...");
  removeEvent(window, 'load', trap);
  if (document.layers)
  {
    window.captureEvents(Event.MOUSEDOWN);
    window.captureEvents(Event.MOUSEUP);
    window.onmousedown=right;
    window.onmouseup=right;
  }
  else
  {
    if(document.images)
      for(i=0;i<document.images.length;i++)
      {
        document.images[i].onmousedown = right;
        document.images[i].onmouseup = right;
      }
  }
}

addEvent(window, 'load', trap);
