/*---Image Gallery---*/
 
function gallerySetup() {
	
	/*width of the stage container*/
	var $stageWidth = 684;
	/*how many columns should the thumbnail view have*/
	var $columns = 5
	/*width of the containing "box" for each thumbnail*/
	var $boxSize = 130;
	/*calculate how much space is left for margins*/
	var $leftover = $stageWidth - ($boxSize * $columns);
	/*margin is only applied to the first n-1 columns, so divide the leftover space by columns-1*/
	var $hSpacing = $leftover / ($columns - 1);
	/*get all thumbnail divs except for the last one in each row and apply the margin-right*/
	$(".thumbRow div:not(:last-child)").css("margin-right",$hSpacing);
	/*get all thumbnail rows except for the last one and apply the same amount of spacing as a margin-bottom*/
	$(".thumbRow:not(:last-child)").css("margin-bottom", $hSpacing);
	
}
