/**
 * jQuery plugin to load images asynchronously via AJAX
 *
 *
 */
(function($){
	$.fn.ajaxLoadImg = function(src, callback){
		return this.each(function(){
			$(this).addClass('loading');
		
			var i = new Image();
			var img = $('<img />')
				.attr('src', src)
				.attr('id', 'detailImg')
				.hide()
				.load(callback);
			
			$(img).appendTo($(this));
			
			$(this).removeClass('loading');
		});
	}	
})(jQuery);
