// Version: 1.2

/**
This replaces  getNextHighestDepth()
It's useful when you're using components  (which mess up that function)
It's also useful when you're coding for the PSP  (flash player 6 lacks that function)
*/

_global.nextDepth = function(this_mc)
{
	this_mc = (this_mc) ? this_mc : _root;		// default = _root
	var outputDepth = 1;
	var componentDepth = 1048676;		// was: 1048574
	for (var nam in this_mc)
	{
		var thisDepth = this_mc[nam].getDepth();
		//trace("");
		//trace("\t"+nam+"'s depth is: "+thisDepth);
		if (thisDepth < componentDepth  &&  thisDepth >= outputDepth)
		{
			outputDepth = thisDepth+1;
		}// if (   > outputDepth)
	}// for...in (this_mc)
	//trace("outputDepth: "+outputDepth);
	return outputDepth;
}// nextDepth()