﻿/*
 * name: rotator JS
 * author: Andrea Martin 
 */

function rotator (position)
{
    var rotationTime = 5000;
    var counter, i = 1;
    var tag = "focuson_";
    
    if (position == undefined)
    {
        counter = 1;
    }
    else
    {
        counter = position;
    }
	                
    while (window.document.getElementById(tag + i))
    {
        window.document.getElementById(tag + i).style.display = 'none';
        i++;
    }
    window.document.getElementById(tag + counter).style.display = 'block';

    if (counter == (i - 1))
    {
        counter = 1;
    }
    else
    {
        counter++;
    }

    setTimeout("rotator(" + counter + ")", rotationTime);
}

