No idea what I'm doing or why it isn't working. Clearly not using the right method and probably won't use the right language to explain the problem..

Photogallery.. Trying to have a single html page.. it has links to images.. buttons on the page 'aim to' modify the path to the images by finding the name currently in the path and replacing it with the name of the gallery corresponding to the button the user clicked on..

example:...