DN: second half, with javascript (lacks polish but works)