/**
 * @author Jono Hutchison, with help from script.aculo.us!
 */
			// show next item
			function swapFadeForward() {
        if( i == divs_to_fade.length-1 )
          return;

        fade( 100, 0, 1 );
        i++;
        fade( 0, 100, 1 );
        
        fadebutton( 'button-back', 1, 0, 100);
        fadebutton( 'button-next', divs_to_fade.length-1, 100, 0);
			}
      // show previous
			function swapFadeBack() {
        if( i == 0 )
          return;

        fade(100, 0, 1);
        i--;
        fade(0, 100, 1);

        fadebutton( 'button-back', 0, 100, 0);
        fadebutton( 'button-next', divs_to_fade.length-2, 0, 100);
      }
			// do fade
			function fade( start_alpha, end_alpha, duration)
			{
        var el = document.getElementById(divs_to_fade[i]);
        if ( !el )
          return;

        bytefx.alpha(el, start_alpha);
        el.style.display = 'block';
        bytefx.fade(el, start_alpha, end_alpha, duration, null);
      }
      // fade the buttons 
      function fadebutton( btnid, condition, start_alpha, end_alpha )
      { 
        // bring in the back button if on 1
        if( i==condition )
        {
          var el = document.getElementById(btnid);
          if ( el )
          {
              bytefx.alpha(el, start_alpha);
              el.style.display = 'block';
              bytefx.fade(el, start_alpha, end_alpha, 1, null);
          }
        }
      }

