function solAutoRotateTab()
{
     var solutionsTabs = jQuery('#solutionsSlideshow');
     var numTabs = jQuery('#solutionsSlideshowControls li').size();
     var curTab = solutionsTabs.tabsSelected();
     if (curTab < numTabs)
     {
         curTab++;
     }
     else
     {
         curTab = 1;
     }
     solutionsTabs.tabsClick(curTab);
}



jQuery(document).ready(function () {
     
     // get the total number of tabs (-2 is for prev/next buttons)
     var numTabs = jQuery('#solutionsSlideshowControls li').size() - 2;
     
     var solutionsTabs = jQuery('#solutionsSlideshow');
     
     // setup the tabs interface with the previous and next buttons disabled
     solutionsTabs.tabs(1,{ selectedClass: 'solutionsSlideshowControls-ButtonOn', fxFade: true});
     
     // setup auto rotation of the tabs
     solInt = setInterval(solAutoRotateTab, 5000);



     // setup the previous a next button functionalities
     jQuery('#solutionsSlideshowControls-Next a').click(function (e) 
     {
	  // get the current tab index (1 based, subtract one for prev button)
          var curTab = solutionsTabs.tabsSelected() - 1;
          if (curTab < numTabs)
          {
              curTab++;
          }
          else
          {
              curTab = 1;
          }
	  solutionsTabs.tabsClick(curTab + 1);
	  return false;
     });

     jQuery('#solutionsSlideshowControls-Prev a').click(function (e) 
     {
	  // get the current tab index (1 based, subtract one for prev button)
          var curTab = solutionsTabs.tabsSelected() - 1;
          if (curTab > 1)
          {
              curTab--;
          }
          else
          {
              curTab = numTabs; //+1 to account for the prev button
          }
          solutionsTabs.tabsClick(curTab + 1);
	  return false;
     });

});
