public static void pokemonWasSelected(int pokeIndex, Item item)
	{
		if(item.effect1==Item.Effect.POKEBALL)
		{
			usePokeBall(item);
		}
		else if(item.effect1==Item.Effect.ROD)
		{
			useRod(item);
		}
		else if(item.effect1==Item.Effect.REPEL)
		{
			useRepel(item);
		}
		else if (item.effect1 != Item.Effect.TM && item.effect1 != Item.Effect.HM)
		{
			Battle.user[pokeIndex] = useItem(Battle.user[pokeIndex],fullInventory.get(getItemId(item)),false);
		}
		else
		{
			Battle.user[pokeIndex] = useTMHM(Battle.user[pokeIndex],fullInventory.get(getItemId(item)));
		}

		if (!itemCancel)
		inventoryWindow.itemUsed = true;
		else
		itemCancel = false;

		inventoryWindow.updateSelection();
		inventoryWindow.closeInventory();

		if (inventoryWindow.state == InventoryWindow.State.BATTLE && inventoryWindow.itemUsed)
		Battle.setUserCommand(-1);
	}