After i got attacked i was watching the replay i noticed on the side there was a number for gold/elixir available to be looted. the attack occurred during a short while i was checking my email so when i came back in i had to wait a couple of minutes for the attack to end however i noticed that the number in the replay on available loot was quite different to my stockpile (available in the replay was approx 6,000 elixir, stockpile was 10,000+. i hadn't collected anything since the attack).
I am wondering, when attacking another player, is the available loot a fraction from your stockpile or is it a separate value?