var events = 0; var updates = 0; var outEvents = #{rich:element('events')}; var outUpdates = #{rich:element('updates')}; var outRequests = #{rich:element('requests')}; var requests=0; function addEvent(){ events++; } function addUpdate(){ updates++; } function addRequest(){ requests++; } function printCounts(){ outEvents.innerHTML=events; outUpdates.innerHTML=updates; outRequests.innerHTML=requests; }