var secs
var timerID = null
var timerRunning = false
var delay = 100
var counter = 0

aCaptions = new Array(9);
aCaptions[0] = "<h3>Kim B. -- Mother of Benjamin, Abbey and Billy</h3><span>\"Benjamin and I have both enjoyed making some new friends!  I have enjoyed being with other moms and babies and toddlers. Also, this class incorporates more strengthening than the aerobics classes I was taking.\"</span>"
aCaptions[1] = "<h3>Stephanie P. -- Mother of Grace</h3><span>\"I feel really good about my body and myself, and my energy level has gone up. But the most important thing I've gained is meeting other moms. I also love how excited Grace gets when we do floor exercises together!\"</span>"
aCaptions[2] = "<h3>Tracy B. -- mother of Ivy, and Remington</h3><span>\"I'm more motivated to exercise on days I don't attend classes, which has helped my own level of fitness. I also think I'm promoting a healthy lifestyle for Ivy, so when she's older, exercising will be something she's done her whole life.\"</span>"
aCaptions[3] = "<h3>Nancy S., Grandmother of Alex, Caleb, and Maddie</h3><span>\"I love to walk and I enjoy the stretching and strength training. Also, I love being with the younger people - they are so friendly and enthusiastic. It makes me feel young to be able to keep up with them.\"</span>"
aCaptions[4] = "<h3>Anita S. -- Mother of Iona</h3><span>\"Joining <span class=\"highlight\">OneFitMama&#8482;</span> is the best medicine to get you up and out and about, for and your child. My fitness level has increased, along with my energy levels. Just buying new clothes (Who wants to see those maternity clothes anymore?!) in a smaller size than pre-pregnancy was wonderfully rewarding.\"</span>"
aCaptions[5] = "<h3>Hannah R., Mama to Josiah</h3><span>\"I really appreciate the time with other moms whom I have found to be very supportive.  The most remarkable thing about <span class=\"highlight\">OneFitMama&#8482;</span> is that the atmosphere at the classes is one of acceptance and caring. On a more vain note: I’ve made it below my pre-pregnancy weight which feels great!\"</span>"
aCaptions[6] = "<h3>Theresa, Mama of Thomas and Baby #2 on the way</h3><span>\"I gained 60+ pounds when I was pregnant with Thomas, and now I can run again! It is so much fun to be with other mothers and babies, and the big plus is you don’t even realize that you’re exercising.\"</span>"
aCaptions[7] = "<h3>Amy - Mom to Tommy</h3><span>\"A few months into my pregnancy I started to worry about the weight gain.  It was the middle of the winter and I was having a hard time getting motivated to get out and exercise.  I asked my doctor to recommend a program specifically for pregnant women and she suggested <span class=\"highlight\">OneFitMama&#8482;</span>!\"</span>"
aCaptions[8] = "<h3>Diana C., Mama of Isabella</h3><span>\"I was excited to find <span class=\"highlight\">OneFitMama&#8482;</span> so I could finally start to get back in shape AND Isabella can come with me. I’ve only been a member for a little over a month and already I’ve noticed a difference in my energy level.\"</span>"

//aCaptions[9] = "<h3>Diana M., Mama of Ayla</h3><span>\"I was excited to find <span class=\"highlight\">OneFitMama&#8482;</span> so I could finally start to get back in shape AND Isabella can come with me. I’ve only been a member for a little over a month and already I’ve noticed a difference in my energy level.\"</span>"

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 100
    StopTheClock()
    StartTheTimer()
      document.getElementById("cap").innerHTML = aCaptions[counter];
      document.getElementById("pic").innerHTML = "<span><img src=\"images_ss/" + counter + ".jpg\" class=\"articleimg\" /></span>"
      //document.getElementById("pic").innerHTML = "<span><img src=\"images_ss/" + counter + ".jpg\" class=\"articleimg\" /></span><span>"+aCaptions[counter]+"</span>"      
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
    if (counter==9){
      counter = 0
    }
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        //alert("You have just wasted 10 seconds of your life.")
        ++counter
        InitializeTimer()
        
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
