﻿/*
	Class:    	dwIMageProtector
	Author:   	David Walsh
	Website:    http://davidwalsh.name
	Version:  	1.0.0
	Date:     	08/09/2008
	Built For:  jQuery 1.2.6
*/

jQuery.fn.protectImage = function(settings) {   
    settings = jQuery.extend({   
        image: 'assets/images/layout/blank.gif',   
        zIndex: 10   
    }, settings);   
    return this.each(function() {   
        var position = $(this).offset();   
        var height = $(this).height();   
        var width = $(this).width();   
        $('<img />').attr({   
            width: width,   
            height: height,   
            src: settings.image   
        }).css({   
            border: '1px',   
            top: position.top,   
            left: position.left,   
			padding:'4px',
            position: 'absolute',   
			float: 'left',   
            zIndex: settings.zIndex   
        }).appendTo('body')   
    });   
};  

$(window).bind('load', function() {   
  if(typeof $('img.protect') != 'null'){ 
    $('img.protect').protectImage();   
 }
});  
