Hi,
I am developing a fantasy football website & I'm trying to write a function that when the user clicks on a player it loads the photo & updates the hidden input field. It will also remove the photo & clear the field if the user clicks on the photo.

I have got it working for the goalkeeper (because there is only 1 input box) but when you come to defenders & midfielders there are a possible 4 options & my code keeps overwriting the 1st option

I currently have one input box per player but I'm not sure if I can achieve what I want via an array??

I have included the link to the live version so you can see it working & also see the hard code.

In summary I need some help so that my code will allow users to choose their team & at each selection it will check to see if that player has already been chosen.

Thanks in advance.

http://www.qiomts.co.uk/fitc/navigation/fitc_teamss.asp

John.