//Get names of nodes visited and put them in "nodesVisited" variableif (getCookie("NodesVisited") != null) {	nodesVisited = getCookie("NodesVisited")} else {	nodesVisited = ""}//If cookie is empty, put asterisk in the variable//to serve as initial separator character to keep node names distinct//within the variable stringif (nodesVisited == "") { nodesVisited = "*" }//Find out how many times this node has already been visited//and set cookie value appropriately;//asterisk serves as separator to keep node names distinct//from one another and therefore can't be used in filenames//If name of currentNode isn't in cookie, this is the first visitif (nodesVisited.indexOf("*" + currentNode + "*") == -1) {	//add currentNode name to cookie	setCookie("NodesVisited", nodesVisited + currentNode + "*")	//set var. recording no. of visits	visitNum = 1} else {	//if currentNode followed by "*/" is not in cookie, this is 2nd	//visit	if (nodesVisited.indexOf("*" + currentNode + "*/*") == -1) {		visitNum = 2		//add "/*"after nodeName in cookie to indicate 2nd visit		offset = nodesVisited.indexOf(currentNode) + currentNode.length + 1		firstHalf = nodesVisited.substring(0, offset)		secondHalf = nodesVisited.substring(offset, nodesVisited.length)		setCookie("NodesVisited", firstHalf + "/*" + secondHalf)	//otherwise this is the 3rd visit	} else {		visitNum = 3	}}
