$(document).ready(function() {
	$('a#galleryLink').click(function() {
		$('#tabs-4 > div.bodyCopy > div#photoGalleryScroller > div.items > abbr').each(function(index) {
			var alt = $(this).attr("alt");
			var src = $(this).attr("src");
			var title = $(this).attr("title");
			$(this).replaceWith('<img src="' + src + '" alt="' + alt + '" title="' + title + '"' + ' />');
			$("#photoGalleryScroller .items img").slimbox({}, function(el) {
				return [el.src, el.title];
			} );
		});	 
	});
	$('a#patientGalleryLink').click(function() {
		$('#tabs-5 > div.bodyCopy > div#beforeAfterGalleryScroller > div.items > abbr').each(function(index) {
			var alt = $(this).attr("alt");
			var src = $(this).attr("src");
			var title = $(this).attr("title");
			$(this).replaceWith('<img src="' + src + '" alt="' + alt + '" title="' + title + '"' + ' />');
			$("#beforeAfterGalleryScroller .items img").slimbox({}, function(el) {
				return [el.src, el.title];
			} );		
		});	 
	});
	$("#beforeAfterGalleryScroller").scrollable();
	$("#photoGalleryScroller").scrollable();
});
