$(document).ready(function() {
    poiFlash($("div.poiButton"));
});

var poiIntervals = new Array();
function poiFlash(what)
{
    for (var i in what)
    {
        if (typeof what[i] == 'object' && what[i].tagName)
        {
            poiId = what[i].getAttribute('id');
            window.setTimeout("startPoiToggle('" + poiId + "')", i+100);
        }
    }
}
function startPoiToggle(poiId)
{
    poiIntervals[poiId] = window.setInterval("togglePoi('" + poiId + "')" , 1000);
}
function togglePoi(poiId)
{
    if ($("#" + poiId + " a").hasClass('top'))
    {
        $("#" + poiId + " a").removeClass('top');
        $("#" + poiId + " a").addClass('bottom');
    }
    else
    {
        $("#" + poiId + " a").removeClass('bottom');
        $("#" + poiId + " a").addClass('top');
    }
}
