Here are some examples of using Drupal's states API. It shows the use of OR and XOR (which only work with jQuery 1.8 or above, apparently). More examples can be found in the examples project in the form example module.
Here's an example of how to theme a book navigation menu. This example creates a theme function that can be used to output the book outline in any place. There is an example in this module that create a panels pane.
By default, in between all your panel panes you'll have a <divclass="panel-separator"></div>. To get rid of it or change it, implement theme_panels_default_style_render_region() like below: