Solve conflict between documetn ready and window scroll events, improve separation between  html and js codes and so on.