 JSOG = {}
 
 nextId = 1
+
+# Older browser compatibility
+isArray = Array.isArray || (obj) -> toString.call(obj) == '[object Array]'
 
 #
 # Take a JSON structure with cycles and turn it into a JSOG-encoded structure. Adds


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


		if not encoded?
			return encoded
		else if isArray(encoded)
			return decodeArray(encoded)
		else if typeof encoded == 'object'
			return decodeObject(encoded)
