﻿function nextImage(dir) {
	if (dir == "right") {
		if (imgNum < (imageRow.length - 1)) {
			imgNum++;
		} else {				
			imgNum = 0;	
		}
	} else {
		if (imgNum > 0) {
			imgNum--;
		} else {
			imgNum = imageRow.length - 1;
		}
	}		
	newImage = jQuery(imageRow[imgNum]);		
	currentImg.css("display","none");
	currentImg = newImage;
	currentImg.fadeIn("slow");
}
