rem: nextMessage = FindNextMessageInThreads(parentMessage.nextSibling, originalStartMessage, nextFunction, nextResourceFunction, startFromBeginning, true); 
add: nextMessage = FindNextMessageInThreads(parentMessage.nextSibling, originalStartMessage, nextFunction, nextResourceFunction, nextThreadFunction, startFromBeginning, true); 
context: function FindNextMessageInThreads(startMessage, originalStartMessage, nextFunction, nextResourceFunction, startFromBeginning, checkStartMessage){	//First check startMessage if we are supposed to	if(checkStartMessage)	{		if(nextFunction(startMessage))			return startMessage;	}	//Next, search the current messages children.	nextChildMessage = FindNextInChildren(startMessage, originalStartMessage, nextFunction, nextResourceFunction);	if(nextChildMessage)		return nextChildMessage;	//Next we need to search the current messages siblings	nextMessage = startMessage.nextSibling;	while(nextMessage)	{		//In case we've already been here before		if(nextMessage == originalStartMessage)			return nextMessage;		if(nextFunction(nextMessage))			return nextMessage;		var nextChildMessage = FindNextInChildren(nextMessage, originalStartMessage, nextFunction, nextResourceFunction);		if(nextChildMessage)			return nextChildMessage;			 		nextMessage = nextMessage.nextSibling;	}	//Finally, we need to find the next of the start message's ancestors that has a sibling	var parentMessage = startMessage.parentNode.parentNode;	while(parentMessage.nodeName == 'treeitem')	{		if(parentMessage.nextSibling != null)		{			nextMessage = FindNextMessageInThreads(parentMessage.nextSibling, originalStartMessage, nextFunction, nextResourceFunction, startFromBeginning, true);			return nextMessage;		}		parentMessage = parentMessage.parentNode.parentNode;	}	//otherwise it's the tree so we need to stop and potentially start from the beginning	if(startFromBeginning)	{		nextMessage = FindNextMessageInThreads(FindFirstMessage(parentMessage), originalStartMessage, nextFunction, nextResourceFunction, false, true);		return nextMessage;	}	return null;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/d00e9f81176610be631d8801fdfb2daee808f967/msgViewNavigation.js/buggy/mailnews/base/resources/content/msgViewNavigation.js