function(f)
	{
		var str = null;

		if (f != null)
		{
			if (f.name != null)
			{
				str = f.name;
			}
			else
			{
				str = mxUtils.trim(f.toString());
				
				if (/^function\s/.test(str))
				{
					str = mxUtils.ltrim(str.substring(9));
					var idx2 = str.indexOf('(');
					
					if (idx2 > 0)
					{
						str = str.substring(0, idx2);
					}
				}
			}
		}
		
		return str;
	}
function(f)
	{
		var str = null;

		if (f != null)
		{
			if (f.name != null)
			{
				str = f.name;
			}
			else
			{
				str = mxUtils.trim(f.toString());
				
				if (/^function\s/.test(str))
				{
					str = mxUtils.ltrim(str.substring(9));
					var idx2 = str.indexOf('(');
					
					if (idx2 > 0)
					{
						str = str.substring(0, idx2);
					}
				}
			}
		}
		
		return str;
	}
function ( f ) { var str = null ; if ( f != null ) { if ( f . name != null ) { str = f . name ; } else { str = mxUtils . trim ( f . toString ( ) ) ; if ( / ^function\s / . test ( str ) ) { str = mxUtils . ltrim ( str . substring ( 9 ) ) ; var idx2 = str . indexOf ( '(' ) ; if ( idx2 > 0 ) { str = str . substring ( 0 , idx2 ) ; } } } } return str ; }
Function: getFunctionName

Returns the name for the given function.

Parameters:

f - JavaScript object that represents a function.
Function : getFunctionName
Returns the name of the function