/*
	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: 'blank.gif',
		zIndex: 2
	}, settings);
	return this.each(function() {
		var position = $(this).position();
		var height = $(this).height();
		var width = $(this).width();
		var margin = $(this).css('margin');
		var border_width = $(this).css('border-width');
		var border_style = $(this).css('border-style');
		var border_color = $(this).css('border-color');
		$('<img />').attr({
			width: width,
			height: height,
			src: settings.image,
			'class': 'blank_image'
		}).css({
			//border: '1px solid #f00',
			//'border-width' : border_width,
			//'border-color': border_color,
			//'border-style': border_style,
			top: position.top,
			left: position.left,
			position: 'absolute',
			zIndex: settings.zIndex,
			margin: margin
		}).appendTo($(this).parent());
	});
};
