obviously "galVariable" would be undefined... as i'm trying to get "_gallery2.images" but trying to use "galVariable" to point to "_gallery2"
thanks in advance. if anyone needs some more clarification. please feel free to ask, and I'll respond asap.
A closure might actually be the easiest for multiple galleries, but it might mean a bit of a rewrite. Basically I mean that each gallery would be an instance of a gallery object, with access to functions like start, stop, random etc., but with a different id each time. I'd also strongly suggest you read this. If you don't get what I'm talking about, ask, because I don't think I've explained that well.
As for your second question, I don't understand what you are getting at to be honest.
Great wit and madness are near allied, and fine a line their bounds divide.
This is kinda strange, I don't quite understand why your location would need to be set to something in order to display a gallery. In order to have seperate variables based off of your location, your location would need to be something like
galVariable1 = (i = location.hash.match(/#set1=(.+)&photo1=(\d+)/)) ? i : null;
galVariable2 = (i = location.hash.match(/#set2=(.+)&photo2=(\d+)/)) ? i : null;
and so one... However, this doesn't seem like a proper method. Maybe explaining the purpose of the location would help make sense of this. Also, how your gallery system works will determine the format in which you should store your gallery data & settings. Personally, Declan made a very good suggestion, instantiating the gallery would be your most versatile and unobtrusive approach, but like already mentioned it would most likely require a lot of modification.