
map = [2, 3, 4, 5, 6, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45];

gallery = {
	low: 1,
	high: map.length,
	current: 1,
	path: 'images/BeforeAfterPairs/'
}


gallery.beforeImgEmt = document.getElementById('beforeImg');
gallery.afterImgEmt  = document.getElementById('afterImg');

gallery.changeImages = function () {
		num = map[this.current - 1];
		this.beforeImgEmt.src = this.path + num + '-Before.jpg';		
		this.afterImgEmt.src = this.path + num + '-After.jpg';		
	}

function gal_next() {
		gallery.current = 
			(gallery.current < gallery.high) ? 
			(gallery.current + 1) : gallery.low;
		gallery.changeImages();
	}

function gal_prev() {
		gallery.current = 
			(gallery.current > gallery.low) ? 
			(gallery.current - 1) : gallery.high;
		gallery.changeImages();
	}

gallery.changeImages();
