$(document).ready(function(){
	$("ul#imageGalleryPreviews li p a").mouseenter(function() {
		$(this).parent().parent().stop().animate({
			left: "20px"
		}, 200, "swing");
	});
	$("ul#imageGalleryPreviews li p a").mouseleave(function() {
		$(this).parent().parent().stop().animate({
			left: 0
		}, 200, "swing");
	});
	$("ul#imageGalleryPreviews li a").click(function() {
		this.blur();
		var targetObject = $("#imageGallery img[src=" + this.href + "]").parent();
		var otherObjects = $("#imageGallery img:not(img[src=" + this.href + "])").parent();
		if (targetObject.css("z-index") != 100) {
			targetObject.css({
				zIndex: 110,
				opacity: 0,
				display: "block"
			}).fadeTo("fast", "1", function(){
				otherObjects.css({
					zIndex: 10
				})
				$(this).css({
					zIndex: 100
				})
			});
		}
		return false;
	});
	$("#content a[href$=png],#content a[href$=gif],#content a[href$=jpg],#content a[href$=jpeg]").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'overlayShow': true,
		'overlayOpacity': 0.6
	});
})
