$(document).ready(function() {
	if ($('.gallery-thumb').length){
		var first_img_path=$(".gallery-thumb a:first").attr('href');
		$('.gallery-img').html('<img src="'+first_img_path+'"/>');
		$('.gallery-img').fadeIn(500);
		$(".gallery-thumb a:first img").css("margin-top","0");
		$(".gallery-thumb a:first").css("border-top","4px solid #e499c3");
	
		$(".gallery-thumb a").live('click',function(){
			var img_path=$(this).attr('href');
			$(".gallery-thumb a").css("border-top","0");
			$(".gallery-thumb a img").css("margin-top","4px");
			$(this).find("img").css("margin-top","0");
			$(this).css("border-top","4px solid #e499c3");
			$('.gallery-img').fadeOut(200, function() {
				$('.gallery-img').fadeIn(800);
				$('.gallery-img').html('<img src="'+img_path+'"/>');
																		
			});

			return false;
		});
	}
});
