jQuery.fn.protectImage = function(setting) {
	config = jQuery.extend({
		image	: "blank.gif",
		zIndex	: 10,
		elements: this
	},setting);

	function protect(config){
		var makers = config.elements;
		var img = '<img src="'+config.image+'" />';
		jQuery.each(makers,function(){
			var my = jQuery(this);
			var w = my.attr('width');
			var h = my.attr('height');
			var p = my.position();
			my.after(img).next().css({
                //"border"    : "1px solid #00f",
				"position"	: "absolute",
				"top"       : p.top,
                "left"      : p.left,
				"width"		: w+"px",
				"height"	: h+"px",
				//"margin-left"	: "-"+w+"px",
				"z-index"	: config.zIndex
			});
		});
	}

	function resizeContainer(){
        var makers = config.elements;
        jQuery.each(makers,function(){
            var my = jQuery(this);
   			var p = my.position();
			my.next().css({
				"top"       : p.top,
                "left"      : p.left
			});
        });
    }
	$(window).bind("resize", resizeContainer);

	protect(config);
};

$(window).bind('load', function() {
	$('img.protect').protectImage();
});


