﻿// JScript File

function setOpacity(eID, opacityLevel)
{
    var eStyle = document.getElementById(eID).style;

    eStyle.opacity = opacityLevel / 100;
    eStyle.filter = 'alpha(opacity=' + opacityLevel + ')';
}

function fade(eID, startOpacity, stopOpacity, duration)
{
//    var speed = Math.round(duration / 100);
    var speed = 20;
    var timer = 0;

    // fade in
    if (startOpacity < stopOpacity)
    {
        for (var i = startOpacity; i <= stopOpacity; i++)
        {
            setTimeout("setOpacity('" + eID + "'," + i + ")", timer * speed);
            timer++;
        }
        return;
    }

    // fade out
    for (var i = startOpacity; i >= stopOpacity; i--)
    {
        setTimeout("setOpacity('" + eID + "'," + i + ")", timer * speed);
        timer++;
    }
}

var myArray = [];

myArray[0] = 'Your customer service people are as helpful as any I have ever dealt with. &nbsp;<img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" /><br /> &nbsp; - Dave F.'
myArray[1] = 'The most terrific online course I have ever experienced!  It was comprehensive, fair and complete.  I would recommend McKissock to anyone who has a computer in their home.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />&nbsp; - Lauren B.'
myArray[2] = 'The course information and the exams really gave me an opportunity not just to learn, but to retain the information.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />&nbsp; - Juanita M.'
myArray[3] = 'I love the self-paced instruction. It was very easy to navigate through <br />the course.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" /> &nbsp; - Elizabeth B.'
myArray[4] = 'Continuing education finally made enjoyable.  You\'ll never sit through classes again.  McKissock is the only way to go.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />&nbsp; - Will N.'
myArray[5] = 'I was nervous about taking a class online, but I found McKissock to be well-organized and easy to use.  I highly recommend them!&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" /> <br /> &nbsp;- Scott M.'
myArray[6] = 'For people who have many things going on in their lives, this online opportunity was wonderful.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />&nbsp;- Janet C.'
myArray[7] = 'I was very pleased with the course format, clarity of instruction and easy maneuverability within the course material.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />&nbsp;- Randy E.'
myArray[8] = 'Your course selection is the best I could find, and the software is such that even the least computer-savvy could handle it.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" /> &nbsp;- Maureen M.' 
myArray[9] = 'I was challenged and able to learn at my own pace and from the comfort and ease of my office.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />  &nbsp;- Peter S.' 
myArray[10] = 'I continue to use McKissock\'s online courses as they are the most complete and easiest to learn from.&nbsp; <img alt=\"quote2\" src=\"../../McKissock/images/quotes_02.gif\" />  &nbsp;- Gail K.'

var quoteNum = 0;
var fadeTime = 2000;
var waitTime = 3000;

function throb() 
{
    //    var fadeTime = 2000;
    //    var waitTime = 3000;
    var qt = document.getElementById("myQuotes");

    // stuff a quote into the target div
    qt.innerHTML = "<img alt=\"quote\" src=\"../../McKissock/images/quotes_01.gif\" />&nbsp;" + myArray[quoteNum];
    
    // cycle our array offset value
    quoteNum = (++quoteNum % myArray.length);

    // fade In
    fade("myQuotes", 0, 100, fadeTime);

    // fade out after a certain amount of time
    setTimeout(function() { fade("myQuotes", 100, 0, fadeTime); }, 7000 );
    //setTimeout(function() { fade("myQuotes", 100, 0, fadeTime); }, (fadeTime * 2) + waitTime );

    //Call Next removed in favour of a setinterval in calling page
    //setTimeout(function() { throb(); }, 10000);
    //setTimeout(function() { throb(); }, (fadeTime * 2) + (waitTime * 2));
}
