 
 		if not encoded?
 			return encoded
-		else if Array.isArray(encoded)
+		else if isArray(encoded)
 			return decodeArray(encoded)
 		else if typeof encoded == 'object'
 			return decodeObject(encoded)

JSOG = {}

nextId = 1

#
# Take a JSON structure with cycles and turn it into a JSOG-encoded structure. Adds


		if not original?
			return original
		else if isArray(original)
			return encodeArray(original)
		else if typeof original == 'object'
			return encodeObject(original)
