// JS Image cycling

	var img_prefix = "";
	var img_path = "";
	var img_total = 0;
	var img_pointer = 0;
	
	function ricInit(imageLink, imagePrefix, imageTotal, imagePath, width, height) {
		
		img_prefix = imagePrefix;
		img_path = imagePath;
		img_total = imageTotal;
		img_pointer = Math.floor(Math.random() * imageTotal) + 1;
		
		document.getElementById("jsimages-nojs").style.display = "none";
		document.getElementById("jsimages-js").style.display = "block";
		document.write('<a href="' + imageLink + '"><img src="' + imagePath + imagePrefix + img_pointer + '.jpg" width="' + width + '" height="' + height + '" alt="Midas Consoles" id="ricImage" /></a>');
		
	}
	
	function ricSkip(skipDirection) {
		var img_next = img_pointer + skipDirection;
		if (img_next > img_total) {
			img_next = 1;
		} else {
			if (img_next == 0) {
				img_next = img_total;
			}
		}
		document.getElementById('ricImage').src = img_path + img_prefix + img_next + '.jpg';
		img_pointer = img_next;
	}
