function findBoundControl(oOverlay, aStack) {
		var sAggregationName;
		var iIndex;
		var oParentOverlay = oOverlay.getParent();
		var bBoundControlFound = false;

		if (oOverlay.isA("sap.ui.dt.ElementOverlay")) {
			var oParentElementOverlay = oOverlay.getParentElementOverlay();

			if (oParentOverlay) {
				sAggregationName = oParentOverlay.getAggregationName();
				iIndex = oParentOverlay.getChildren().indexOf(oOverlay);
				bBoundControlFound = oParentElementOverlay
					&& oParentElementOverlay.getAggregationOverlay(sAggregationName, "AggregationBindingTemplateOverlays");
			} else {
				iIndex = -1;
			}

			aStack.push({
				overlayId: oOverlay.getId(),
				aggregation: sAggregationName,
				index: iIndex
			});

			if (bBoundControlFound) {
				return {
					overlayId: oParentElementOverlay.getId(),
					aggregation: sAggregationName,
					stack: aStack
				};
			}
		}

		if (!oParentOverlay || oParentOverlay instanceof UIArea) {
			return {
				overlayId: undefined,
				aggregation: undefined,
				stack: aStack
			};
		}
		return findBoundControl(oParentOverlay, aStack);
	}
Returns the index of an element in a parent aggregation
Only the elements of the aggregation which have overlays are counted
@param {object} oElement Element for which we want to find the index
@param {object} oParent Parent of the Element
@param {string} sAggregationName Name of the parent aggregation
@return {int} Returns the index