implementing animation for pane switching