 			else
 				@token.candidates = []
 				@setSuperNode(true)
+
+		clearIntervals: () ->
+			for timer in @timers
+				clearTimeout(timer)

		#
		# @param superNode [Boolean] wether or not to become supernode.
		#
		setSuperNode: (superNode) ->
			if @isSuperNode is superNode
				return


		initialize: () ->


			window.onbeforeunload = () =>
				if @exitNetwork()?
					return undefined

			@timers = []
			@timers.push(setInterval(@_updatePosition, @_updatePositionInterval))
			@timers.push(setInterval(@_ensureNetworkIntegrity, @_ensureNetworkIntegrityInterval))
			@timers.push(setInterval(@_recommendParent, @_recommendParentInterval))


			@_parent = null
