﻿// JavaScript Document
function ImageChanger(givenUrl, givenTotal, givenObject, givenWhere)
  {
   	var findInt;
	var newInt;

	findInt = givenUrl.substring(givenUrl.length-5,givenUrl.length-4);

	//move to the left
	if (givenWhere == 1)
		{
			if (findInt == 1)
				newInt = givenTotal;
			else
				newInt = findInt - 1;
		
			if (givenObject == 'centerImage')
				document.centerImage.src = givenUrl.replace(findInt,newInt);
		}

	if (givenWhere == 2)
		{
			if (findInt == givenTotal)
				newInt = 1;
			else
				newInt = parseInt(findInt) + 1;
		
			if (givenObject == 'centerImage')
				document.centerImage.src = givenUrl.replace(findInt,newInt);
		}

  }	
