var ImageProtection = {};

ImageProtection.message =  "These photos are copyright protected. All rights reserved. Unauthorized use prohibited.";

ImageProtection.rightClickProtect = function(e) {
    if (window.event){
        var el = event.srcElement ? event.srcElement : event.target;
    }
    else{
        var el = e.srcElement ? e.srcElement : e.target;
    }

    var tagName = el.tagName;

    if (tagName == 'IMG'){
        window.alert(ImageProtection.message);
        return false;
    }
    else{
        return true;
    }
}

document.oncontextmenu = ImageProtection.rightClickProtect;