public static void setZIndex(int index) {
		if (getSelectedIndex() == index) {
			return;
		}
		if (Main.selectedId != -1 && !Main.getSelected().locked) {
			RSInterface rsi = Main.getInterface();
			if (rsi.children != null) {
				int selected = getSelectedIndex();
				int id = rsi.children.get(selected);
				int x = rsi.childX.get(selected);
				int y = rsi.childY.get(selected);
				rsi.children.remove(selected);
				rsi.children.add(index, id);
				rsi.childX.remove(selected);
				rsi.childX.add(index, x);
				rsi.childY.remove(selected);
				rsi.childY.add(index, y);
				//rsi.children = ArrayUtils.setZOrder(rsi.children, selected, index);
				////rsi.childX = ArrayUtils.setZOrder(rsi.childX, selected, index);
				//rsi.childY = ArrayUtils.setZOrder(rsi.childY, selected, index);
			}
			UserInterface.ui.rebuildTreeList();
		}
	}