(function($){
	$.fn.thumb=function(src, options) {
		var defaults={position:'absolute',border:'1px solid #000'};
		var options=$.extend(defaults,options);
		return this.each(function(){
			$(this)
				.mouseover(function(e){
					$('body').prepend('<img id="zoom" alt=""/>');
					$('img#zoom')
						.hide()
						.attr('src',src+($.browser.msie?'?r='+new Date().getTime():''))
						.css($.extend(options,{left:e.clientX,top:e.clientY}))
						.load(function(){
							$(this).show();
							if ($(this).position().top-$(window).scrollTop()+$(this).outerHeight(true)>$(window).height()-10)
								$(this).css({top:$(window).height()-$(this).outerHeight(true)+$(window).scrollTop()});
						});
				})
				.mouseout(function(){$('img#zoom').remove();})
				.mousemove(function(e){
					var $zoom = $('img#zoom');
					$zoom.css({left:e.clientX+10,top:$(window).scrollTop()+(e.clientY+$zoom.outerHeight(true)>$(window).height()-10?$(window).height()-$zoom.outerHeight(true):e.clientY+10)});
				});
		});
	};
})(jQuery);