jQuery.fn.protectImage = function(settings) {
  settings = jQuery.extend({
    image: 'http://media.kokon.nl/img/blank.gif',
    zIndex: 10
  }, settings);
  return this.each(function() {
    var position = $(this).position();
    var height = $(this).height();
    var width = $(this).width();
    $('<img />').attr({
      width: width,
      height: height,
      src: settings.image
    }).css({
      top: position.top + 3,
      left: position.left + 3,
      position: 'absolute',
      zIndex: settings.zIndex
    }).appendTo('#container')
  });
};

$(window).bind('load', function() {
    if ($("body").attr("id") == "frontpage") {
        $("<img />").attr({            
            width: 1280, height: 450,
            src: "http://media.kokon.nl/img/blank.gif"
        }).css({
            top: 81,
            zIndex: 100,
            position: "absolute"
        }).prependTo("#container")        
    } else {
        $("<img />").attr({            
            width: 633, height: 100,
            src: "http://media.kokon.nl/img/blank.gif"
        }).css({
            zIndex: 100,
            border: 0,
            position: "absolute"
        }).prependTo(".largephoto").addClass("blank");

        $(".photo").click(function(){ 
            curphoto = $(this).attr("id") - 1 
            var img = new Image();
            img.src = photos[curphoto];
            $(img).load(function(){ 
                $(".blank").height($(".largephoto").height())
            })           
        })
    }


    if ($(".largephoto").length) {
        $(".blank").height($(".largephoto").height())
    }

    $(document).bind("contextmenu",function(e){
        return false;
    });

    $('#tekst img').protectImage();
});

