This all seems to work great just the really strange thing is when I try to reference the var with .html('g'+index) it throws an object expected error. I guessing building the var isn't the best thing?
var g0 = "<?php getFiles("gallery/Audience"); ?>";
var g1 = "<?php getFiles("gallery/Exhibition"); ?>";
var g2 = "<?php getFiles("gallery/registration"); ?>";
var g3 = "<?php getFiles("gallery/Speakers"); ?>";
$(".galleryButton").each(function (index) {
$(this).click(function(){
$('#galleria').html();
$('#galleria').html('g'+index);
initiateGallery();
}).mouseover(function() {
$(this).css('cursor', 'pointer');
$(this).css('backgroundColor', '#002E53');
}).mouseout(function(){
$(this).css('backgroundColor', '#000');
});
});