
var $j = jQuery.noConflict();

$j(window).load(function() {
    var img_width;
    var img_height;
    var img_src;
    var images = $j("img");
    var galleryImages = $j("#gallery img");
    
    disableRightClick(false);
    protectImages(images);

    $j("#gallery li").click(function() {
        protectImages(galleryImages, "#gallery span.protect");
    });
});

function protectImages(imageCollection, sectionId) 
{
    $j(sectionId).remove();

    imageCollection.each(function() {
        img_width = $j(this).attr("width");
        img_height = $j(this).attr("height");
        img_src = $j(this).attr("src");

        $j(this).after("<span class='protect' style='background: url(" + img_src + ") no-repeat top center; display:block;'><img src='" + blankImagePath + "' width='" + img_width + "' height='" + img_height + "' border='0' /></span>");
        $j(this).css("display", "none");

       
       
        $j(".protect").bind("contextmenu", function(e) {
            return false;
        });
        $j(".protect img").css("border", "0");
    });
}

