	walkTree: function (iDirection,iPrevDirection,iEnter,iFrom,iControl)	{		// This method implements Flow Subprocess SB.2.1		var next = null;		var parent = null;				var direction = iDirection;		var reversed = false;				var done = false;		var endSession = false;				if (iFrom == null)		{			// The sequencing session is over			endSession = true;			done = true;     		}		else		{			parent = iFrom.getParent();		}				// Test if we have skipped all of the children in a 'forward-only' 		// cluster traversing backward		if (!done && parent != null)		{			if (iPrevDirection == FLOW_BACKWARD)			{				if (iFrom.getNextSibling(false) == null)				{					// Switch traversal direction					direction = FLOW_BACKWARD;										// Move our starting point					iFrom = parent.getChildren(false)[0];										reversed = true;				}			}		}				if (!done && direction == FLOW_FORWARD)		{			if (iFrom.getID() == this.mSeqTree.getLastLeaf())			{				// We are at the last leaf of the tree, the sequencing 				// session is over				done = true;				endSession = true;			}						if (!done)			{				// Is the activity a leaf or a cluster that should not be entered				if (!iFrom.hasChildren(false) || !iEnter)				{					next = iFrom.getNextSibling(false);										if (next == null)					{						var walk = this.walkTree(direction, FLOW_NONE,							false, parent, iControl);												next = walk.at;						endSession = walk.endSession;					}				}				// Enter the Cluster				else				{					// Return the first child activity					// todo: check this					next = (iFrom.getChildren(false)[0]);				}			}		}		else if (!done && direction == FLOW_BACKWARD)		{			// Can't walk off the root of the tree			if (parent != null)			{				// Is the activity a leaf or a cluster that should not be entered				if (!iFrom.hasChildren(false) || !iEnter)				{					// Make sure we can move backward					if (iControl && !reversed)					{						if (parent.getControlForwardOnly())						{							done = true;						}					}										if (!done)					{						next = iFrom.getPrevSibling(false);												if (next == null)						{							var walk = this.walkTree(direction, FLOW_NONE,								false, parent, iControl);							next = walk.at;							endSession = walk.endSession;						}					}				}								// Enter the cluster backward				else				{					if (iFrom.getControlForwardOnly())					{						// Return the first child activity						// todo: check this						next = (iFrom.getChildren(false)[0]);												// And switch direction						direction = FLOW_FORWARD;					}					else					{						// todo: check this						var size = iFrom.getChildren(false).length;												// Return the last child activity						// todo: check this						next = iFrom.getChildren(false)[size - 1];					}				}			}		}				var walk = new Walk();		walk.at = next;		walk.direction = direction;		walk.endSession = endSession;				return walk;	},
6251	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6251/1411d268e590bd7d23033c9d5908b240a6aef0df/ADLSequencer.js/clean/Modules/Scorm2004/scripts/adl2js/ADLSequencer.js