function galleryScroll(which) {
	var re = /(\d+)$/;
	var imgNum = re(which.id)[1];
	var theGallery = $('gallery-' + re($($(which).ancestors()[0]).id)[1]);//woah
	var sibs = $(which).siblings();
	var imgWidth = theGallery.getWidth() / (sibs.length + 1);
	var scrollX = 0 - (imgNum - 1) * imgWidth;
	
	//toggle nav
	sibs.each(function(item) {
		item.removeClassName('gallery_nav_disabled');
		item.addClassName('gallery_nav');
	});
	which.removeClassName('gallery_nav');
	which.addClassName('gallery_nav_disabled');
	
	//animate
	new Effect.Move(theGallery.id, {
		x: scrollX, y: 0, mode: 'absolute',
		transition: Effect.Transitions.sinoidal,
		duration: 0.5
	});
}

function printRecipe(which) {
recipeWindow = window.open('/print-recipe/' + which,"recipeWindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=700,height=800,screenX=0,screenY=0');
	recipeWindow.focus();
}