A simple javascript counter