//Created by: Klutzkoder :: www.shoestringsoftware.com
var isNav = (navigator.appName.indexOf("Netscape") != -1);
var isIE = (navigator.appName.indexOf("Microsoft") != -1);

function handler(e) {
   if (isIE) {
      e = window.event;   // Grab the event.
      if(e.srcElement.tagName=="IMG" && e.button == 2){
         alert("Please do not copy, this image belongs to Shoestring Software.");
      }
      e.cancelBubble = true;
   }
   if (isNav) {
      if(e.target.tagName=="IMG" && e.which == 3) {
         document.oncontextmenu = function () { return false; }
        //contentAreaContextMenu
        // #context-viewsource { display: none !important; }
        // #context-copyimage { display: none !important; }
        // #context-saveimage { display: none !important; }
         e.preventDefault();
         e.stopPropagation();
         alert("Please do not copy, this image belongs to Shoestring Software.");
         document.oncontextmenu=null
      }
   }
}

function addhandlers(o) {
   o.onmousedown = handler;
}
addhandlers(window);
addhandlers(document);

// Add handlers to all links.
for(var d = 0; d < document.links.length; d++)
    addhandlers(document.links[d]);

// Add handlers to all images.
for(var d = 0; d < document.images.length; d++)
    addhandlers(document.images[d]);

// Add handlers on all forms and all form elements.
for(var d = 0; d < document.forms.length; d++) {
    addhandlers(document.forms[d]);
    for(var e = 0; e < document.forms[d].elements.length; e++)
        addhandlers(document.forms[d].elements[e]);
}

