complete javascript version of timeline