Added id for event pages. Placed js codes inside pageinit function.