Fix to display the 3 digit code of filenames as captions under gallery thumbnails.

This only works if the filename has the format xxxxxx-xxxxxx-012.jpg in other words it must have a 3 digit number followed by a 3 digit extension

this script needs to be added as a code block at the bottom of the page after all the thumbnails

<script>
  function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag == null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp('(^|\\\\s)'+searchClass+'(\\\\s|$)');
    for (i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}

theslides = getElementsByClass("image-slide-anchor content-fit");

for(i=0; i < theslides.length; i++) {
    theimage = theslides[i];
    wherefrom = theimage.getAttribute('href').length - 8;
    whereto = theimage.getAttribute('href').length - 4;
    what = theimage.getAttribute('href').slice(wherefrom,whereto);
  theimage.innerHTML = theimage.innerHTML + '<div style="text-align:center;position:absolute;opacity:.8;bottom:20px; left:40%;width:20%;background-color:#FFFFFF;border:black solid 1px;">' + what + '</div>';
}

</script>