Very interesting thanks both of you, I will have a play later. My back up plan was to create an array of all the locations but I didn't want to store too much data. My first draft of the code is messy enough as it is calling the id's and name's from all the divs etc. There has to be a better way. Thanks for the tips though, I wasn't sure how to use paths and I never seem to have much luck with 'parent' but I guess you have to call it more than once.
Thanks Simon