function(a,b,c) { setInterval(function() { c=-~c; // incremented on each invocation for( b=0; // the segment index b<8; // 8 segments (dots) c-1||(a.innerHTML+='•'), // create markup upon the first call a.childNodes[b].className='b'+b+' o'+(c+b++)%8 // assign two classes: b<#> and o<#> ); },100) // invoke every 100ms }