
/*this takes in an array from a pathname, the file name that you want changed out, and the name of the
	folder that the file is in.  The array is sorted through until the file name is next, the file name
	gets changed and then the pathname gets reconstructed in a string and returned.*/
function PathChange(oldPath,newName,fileName){
	var newPath = "";

	for (i=0; i<oldPath.length; i++){
		if (oldPath[i] == fileName){
			oldPath[i+1]=newName;
		}
		
		//this is making sure that a slash isn't getting tagged on to the end of the string
		if (i+1 == oldPath.length){
			newPath = newPath + oldPath[i];
		}
		else {
			newPath = newPath + oldPath[i] + '/';
		}
	}

	return newPath;
}