// JavaScript Document
function noop() { return false;}

function BOD_ignoreRightClick(e) {

    if (e == null)
        e = window.event; // Microsoft event model

    if (navigator.appName.match(/^netscape/i) && (e.which == 2 || e.which == 3)) {
        return false;
    }

    if (navigator.appName.match(/^microsoft/i) && (e.button == 2 || event.button == 3)) {
        e.cancelBubble = true; // stop event handling
        e.returnValue = false;
        return false;
    }

    return true;

} // BOD_ignoreRightClick


function BOD_protectImages( strpat ) {

    var img = null;
    var re = null;

    if ( !document.images )
        return;

    if ( strpat != null )
        re = new RegExp( strpat, "i" );

    for( var i=0; i<document.images.length; i++) {
        img = document.images[i];
        if ( !img ) 
            continue;
        if ( (re != null) && !re.test(img.src) ) 
            continue;  // pattern not found in src name
        img.onmousedown = BOD_ignoreRightClick;
        img.oncontextmenu = noop;
    } // end for

    return;

} // BOD_protectImages
