modify the layout of mainpage and subpage taking from webfrogs