        function formatText(index, panel) {
    		  return index + "";
    	  };
		$(document).ready(function(){
			
			var feature_count = $(".each-box").size();				//get the number of features present
			var panels_required = Math.round(feature_count/3);		//we show 3 features per panel so find out how many panels will be required
			var first_each_box = $(".each-box:first");				//get the first each-box
			var first_each_box = $(".each-box:last");				//get the last each-box	
			wrapItems($(".each-box"), 3);							//wrap panels of 3 in UL
			//wrapItems($("ul.horPost li.post-holder"), 6);			//wrap panels of 6 in UL for latest articles slider
			
			//alert("Features present: " + feature_count + "\nPanels required: " + panels_required);
		});
        
		$(function () {
            $('.anythingSlider').anythingSlider({
                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
                delay: 6000,                    // How long between slide transitions in AutoPlay mode
                startStopped: false,            // If autoPlay is on, this can force it to start stopped
                animationTime: 600,             // How long the slide transition takes
                hashTags: true,                 // Should links change the hashtag in the URL?
                buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
            		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
            		startText: "Go",                // Start text
    		        stopText: "Stop",               // Stop text
    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)
            });
            $("#slide-jump").click(function(){
                $('.anythingSlider').anythingSlider(6);
            });
            
        });

		function wrapItems(itemToWrap, itemsPerBundle) {
			var divs = $(itemToWrap);
			for(var i = 0; i < divs.length; i+=itemsPerBundle) {
				divs.slice(i, i+itemsPerBundle).wrapAll("<li></li>");
				var sliced = divs.slice(i, i+itemsPerBundle);
				sliced.last().attr("class", "each-box last-box");
			}
			
			$("div.each-box").parent().wrapAll('<ul></ul>');
			
		};
