I have done something similar to what you want to do. I did mine in php.
OK so we have a structure kinda like this:
html(d)
-galleries(d)
--galleryone (d)
---index.php (f)
---gallery.xml(f)
---images (d)
---thumbs (d)
--gallerytwo (d)
---index.php (f)
---gallery.xml(f)
---images (d)
---thumbs (d)
--gallery...n (d)
---index.php (f)
---gallery.xml(f)
---images (d)
---thumbs (d)
--swfobject.js(f)
--viewer-code.php(f)
--viewer.swf(f)
--index.php(f)
OK so the explanation goes a bit like this... The root dir html has a directory in it called galleries (amongst others not listed)
In the galleries directory there are several subdirectories for each simpleviewer gallery that I want, there are also some files, but I will get to those in a minute. Each Simpleviewer Gallery directory has an images and a thumbs subdirectory and it also has an index.php and a gallery.xml.
The files in the galleries directory are an index.php, which contains a list of all the galleries, the swobject.js being the simpleviewer javascript file, the view.swf being the flash object that you don't want to have 300 copies of on your website, and finally the viewer-code.php.
Because I'm using php you can do nice simple file includes and if you are paying attention you can do the file includes from anywhere in your web structure.
I am essentially a fairly lazy person and avoid work where I can. :) I wanted to ba able to edit things in one place as much as I possibly can so I use file includes all over my websites for things like footers and headers and stuff, but I digress. In each simple viewer gallery index.php I call the viewer-code.php which references the js and the flash objects. Works very nicely. I have done the same thing on two websites already and there will be many more I am sure.
check it out at http://www.airbrushworld.com.au and http://www.badattituderacing.com.au/galleries.php.
If I haven't made sense then let me know.
Cheers,
DAVE
:)