<?php
  $interests = array( 0=>'astronomy', 'math', 'design', 'biology', 'software', 'books', 'projects', 'more' );
  $sidenames = array( 'astronomy'=>'Astronomy Resources', 'math'=>'Mathematics', 'biology'=>'Biology Information', 
                      'software'=>'Software and Programming', 'design'=>'Design and DIY', 'books'=>'Books', 'projects'=>'Recent Projects', 'more'=>'And More...' );
 ?>

<script language="JavaScript"><!--
function moveToTop(which)
{
    switch( which )
    {
<?php 
        foreach( $interests as $i )
        {
            echo "        case '$i':\n";
        }
?>

            var theContent = document.getElementById( "interest-" + which );
            var theParent  = document.getElementById( 'interests' );
            var theSide    = document.getElementById( 'sidelinks' );
            var theLists   = document.getElementById( 'side-' + which );
            // uncomment to have the nav buttons rearrange in the same way
            //var theNav     = document.getElementById( 'subnav' );
            //var theButton  = document.getElementById( 'button-' + which );

            theParent.removeChild( theContent );
            theSide.removeChild( theLists );
            //theNav.removeChild( theButton );

            theParent.insertBefore( theContent, theParent.firstChild );
            theSide.insertBefore( theLists, theSide.firstChild );
            //theNav.insertBefore( theButton, theNav.firstChild );

        break;
    }

    return true;
}
// --></script>

<DIV CLASS="contents">
    <DIV CLASS="sidebar" ID="sidelinks">
<?php
    foreach( $interests as $i )
    {
        echo "          <DIV ID=\"side-$i\">\n";
        echo "          <SPAN class=\"sidetitle\">$sidenames[$i]</SPAN><BR/>";
        require( "interests/side-$i.php" );
        echo "          <BR/><BR/></DIV>\n\n";
    }
 ?>
    </DIV>
    <DIV class="main">

      <BLOCKQUOTE>
        We want experiences, fitting ones, of profound connection with others,
        of deep understanding of natural phenomena, of love, of being
        profoundly moved by music or tragedy, or doing something new and
        innovative, experiences very different from the bounce and rosiness of
        happy moments. What we want, in short, is a life and a self that
        happiness is a fitting response to -- and then to give it that
        response.<BR/>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&mdash; Robert Nozick, <EM>The Examined Life</EM>
      </BLOCKQUOTE>
      <BR/>

      <CENTER STYLE="font-weight: bold;">Still under construction...</CENTER><BR/>

      <A NAME="subtop"></A><SPAN STYLE="font-size: small;" ID="subnav">
      <?php

        foreach( $interests as $i )
        {
            echo "<SPAN id=\"button-$i\">&nbsp;<SPAN style=\"border-style: solid; border-width: 1pt; background-color: #FFFFCC;\"><A HREF=\"#section-$i\" ID=\"link-$i\" onMouseOver='this.setAttribute(\"href\",\"#tabbar\")' onClick='moveToTop(\"$i\")'>" . ucwords($i) . "&nbsp;</A></SPAN>&nbsp;</SPAN>";
        }
 
       // echo "&nbsp;|";
      ?>
      </SPAN><BR/><BR/>

      <?php
        echo "<DIV id=\"interests\">\n";

        foreach( $interests as $i )
        {
            echo "      <A NAME=\"section-$i\"></A>";
            echo "<DIV id=\"interest-$i\">\n";
            require( "interests/$i.php" );
            echo "      </DIV>\n\n";
        }

        echo "</DIV>\n";
      ?>     

      <P>
      still under construction
      </P>
    </DIV>
  <DIV STYLE="clear: both;">
  </DIV>
</DIV>
