code: function(obj, array)
  	{
  		var result = null;
  		
  		if (typeof(array) == 'object')
  		{
  			var index = mxUtils.indexOf(array, obj);
  			
  			while (index >= 0)
  			{
  				array.splice(index, 1);
  				result = obj;
  				index = mxUtils.indexOf(array, obj);
  			}
  		}
  
  		for (var key in array)
  		{
  			if (array[key] == obj)
  			{
  				delete array[key];
  				result = obj;
  			}
  		}
  		
  		return result;
  	}
docs: Function: remove
  
  Removes all occurrences of the given object in the given array or
  object. If there are multiple occurrences of the object, be they
  associative or as an array entry, all occurrences are removed from
  the array or deleted from the object. By removing the object from
  the array, all elements following the removed element are shifted
  by one step towards the beginning of the array.
  
  The length of arrays is not modified inside this function.
  
  Parameters:
  
  obj - Object to find in the given array.
  array - Array to check for the given obj.