$(function() {

// don't init gallery if it consists of a single photo
	if($("div.image").length > 1) {
		// wrap images
				$("div.image").show();
$("p#project-count").replaceWith('<p id="gallery-count" class="col twelve"><em>&#8470;</em> <span style="font-weight: bold; color: #999;">1/1</span></p>');
		$('<div id="gallery-navigation" class="col three"><h4><a href="#" id="previous-image">PREVIOUS</a> / <a href="#" id="next-image">NEXT</a></h4></div>').insertBefore("p#gallery-count");
		$("div.image").wrapAll("<div id='image-wrapper'><div id='image-holder'></div></div>");

		
		// init gallery: Gallery.init(imageHolder, imageWrapperWidth, imageCountHolder, nextButton, prevButton)
		Gallery.init($("div#image-holder"), 850, $("p#gallery-count").children("span")[0], $("a#next-image"), $("a#previous-image"));
		


	}
});