a copy from knightlb of timelinejs