change the style of book page

change the style of book page and separate the function from other js
file for muliple usage.