added multi-page support with page/panel switcher button