
$.fn.swapImage = function(e) {
	$(this).find(".thumb").each(function(){
		this.preload = new Image();
		this.preload.conteiner = $(this);
		this.preload.onload = function(){
			this.conteiner.css('cursor','pointer');
			this.conteiner.click(function(){
				
				$(this).hide("slow",function(){
					$(this).appendTo($(this).parent());
				}
				);				
			
				$(this).siblings().each(function(){
					$(this).show('slow');
					});
				
				

				var newSrc = $(this).attr("rel");
				$("#bigImage > div:first").slideUp(500,function(){
					//$(this).find('img:first').attr("src",newSrc );
					$(this).css('background-image',"url("+newSrc+")");
					$(this).slideDown(500);
				});

			});
		}
		
		this.preload.src = $(this).attr("rel");
	
	
	}
	);
}

