Improved JS div swap code

More elegant method for switching divs in the content panel. Also fixed
relative path problem with connect.php (N.B. HTML base tag affects
relative path references).