﻿
var ListLength;
var RotateSpeed = 4000;

function RunLanguageRotator() {
    ListLength = $('#LanguageRotatorList li').length;
    var count = 1;
    $('#LanguageRotatorList li').each(function () {
        if (count > 1) {
            $(this).hide();
        }
        count++;
    });

    setTimeout('RotateLanguage(1)', RotateSpeed);
}

function RotateLanguage(indexId) {
    var nextId = indexId + 1;
    if (nextId > ListLength) {
        nextId = 1;
    }
    $('#LanguageRotatorList li:nth-child(' + indexId + ')').fadeOut(1000);
    $('#LanguageRotatorList li:nth-child(' + nextId + ')').fadeIn(1000);

    setTimeout('RotateLanguage(' + nextId + ')', RotateSpeed);
}
