﻿var obj = [];
obj.push({ Heading: 'Responsibility', Text: 'Trust borne of loyalty and accountability' });
obj.push({ Heading: 'Determination', Text: 'A critical predictor of success' });
obj.push({ Heading: 'Endurance', Text: 'Strength through concentrated patience' });
obj.push({ Heading: 'Passion', Text: 'Persistence toward perfection' });

var Current = 0;
$(document).ready(function () {
    if (obj.length > 0) {
        LoadCurrent();
    }
});
function LoadCurrent() {    
    document.getElementById('Phrase').innerHTML = '<span>' + obj[Current].Heading + '</span>';
    document.getElementById('Phrase').innerHTML += obj[Current].Text;
    $('#Phrase').fadeIn('slow');
    if ((Current + 1) > (obj.length - 1)) {
        Current = 1;
    }
    else {
        Current++;
    }
    setTimeout('FadeOut()', 4000);
}
function FadeOut() {
    $('#Phrase').fadeOut('slow');
    setTimeout('LoadCurrent()', 700);
}
