(function($){

	$.fn.addshadow = function() {
    return this.each(function() {
    	o = $(this).position();
			$(this).before('<div class="shadow" id="shadow_' + this.id + '"><div class="tl"></div><div class="t h"><span></span></div><div class="tr"></div><div class="l v"><span></span></div><div class="r v"><span></span></div><div class="bl"></div><div class="b h"><span></span></div><div class="br"></div></div>')
			e = $('#shadow_' + this.id);
			e.width($(this).width() + 16 + ($(this).innerWidth() - $(this).width()));
			e.children('.h').width($(this).width() - 16 + ($(this).innerWidth() - $(this).width()));
			e.height($(this).height() + 16 + ($(this).innerHeight() - $(this).height()));
			e.children('.v').height($(this).height() - 16 + ($(this).innerHeight() - $(this).height()));
			e.css('top', o.top - 8);
			e.css('left', o.left - 8);
    });
	};

	$.fn.removeshadow = function() {
    return this.each(function() {
    	$('#shadow_' + this.id).remove();
    });
	};

})(jQuery)