jQuery pagerAnchorBuilder countSlide

jQuery pagerAnchorBuilder countSlide

Hello,
within cycle pagerAnchorBuilder function how do I get the total amount of slides ?

To generate a navigation within jQuery cycle I use the function pagerAnchorBuilder.
This works fine.
Now I want to separate the navigation anchors with a vertical line in between.
I do this with a css border-right on nav.a
The last anchor should have no right border!
So I want to give this specific last anchor a class noborder.

How I get the total amount of slides within cycle pagerAnchorBuilder function ?? 









Here's my code:


  1. var index=0;
    var imgTitles = new Array(###ARRAY_TITLE###);
    var imgCredits = new Array(###ARRAY_DESCRIPTION###);
    var imgLinks = new Array(###ARRAY_LINK###);
    var idx=0;

    function goto(id) {
     index = id;
     document.getElementById('img_title').innerHTML =  imgTitles[index];
     document.getElementById('img_credits').innerHTML =  imgCredits[index];
     document.getElementById("img_link").href = imgLinks[index];
     
    }

    function onBefore(curr, next, opts) {
      setTimeout(function() {
          id = opts.currSlide;
          goto(id);
      }, 10);
    }

    $(function() {
        $('#slideimage')
        .before('<div id="nav">')
        .cycle({
            fx:     'fade',
            speed:  2000,
            timeout: 10000,
            pager:  '#nav',

            // callback fn that creates a thumbnail to use as pager anchor
            pagerAnchorBuilder: function(idx, slide) {
              var counter = idx+1;
             


































  2.           // Here i need the total amount of slides
              var totalslide = ???;


  3.           if(counter < totalslide) {
                return '<a onClick="goto(idx);">' + counter + '</a>';
              } else {
                return '<a class=noborder onClick="goto(idx);">' + counter + '</a>';
              }
            },
            before: onBefore
        });
    });










Thanx for help.
Julien