Not sure if this is just me but I can't really understand why there is a debate here (and strangely Adrian Durham was agreeing yesterday). At the point the free kick is initially taken, Ayala is clearly offside (only just but his head and part of his torso is clearly in front of the Birmingham defender). The free kick is headed towards the goal by another Borough player (who was not offside at the point the kick was taken) and flicked further on by Ayala (who although not offside at this point - is now active and so offside for when the free kick was originally taken). Linesman flags at this point probably (although we can not see). Rhodes passes ball back to Ayala who is probably just onside again now, who scores. The offside is from the Ayala flick - not his shot.