$(document).ready(function(){

	$("ul.gallery li a").each(function(){
		$tit = $("img", this).attr("alt");
		$(this)
			.prepend("<p>" + $tit + "</p>")
			.attr("desc","<h4>"+$tit+"</h4>"+$(this).attr("title").replace(/(\bhttp:\/\/\S+(\/|\b))/gi,"<a href=\"$1\">Read more about "+$tit+"</a>"))

	})
			  
			    $('a[href*=#]').click(function() {
				if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
				&& location.hostname == this.hostname) {
				  var $target = $(this.hash);
				  $target = $target.length && $target
				  || $('[name=' + this.hash.slice(1) +']');
				  if ($target.length) {
					var targetOffset = $target.offset().top;
					$('html,body')
					.animate({scrollTop: targetOffset}, 1000);
				   return false;
				  }
				}
			  });
			  
			  $("li.photo a").addClass("thickbox");
			  
			  
			  $(".preview").each(function(){
				$newslink = $(this).siblings("a.title").attr("href");
				$(this).append("&hellip; <a href=\""+$newslink+"\" title=\"read more\">Read More</a>")
			  });
});