/*---------------------------------------------------------------------------*/

function info_entry( title, name, url )
{
    this.title = title;
    this.name  = name;
    this.url   = url;
}

/*---------------------------------------------------------------------------*/

function display_title( n )
{
    d = document;
    d.write( '<title>' + course_number + " " + info[n].title + '</title>' );
}

/*---------------------------------------------------------------------------*/

function display_banner( n )
{
    // Assume that the URL for the current page as it appears in the info
    // list is relative and therefore that any forward slashes indicate how
    // many directory levels we must back up.

    dir = '';
    s = info[n].url;
    k = s.indexOf( '/' );
    while ( k != -1 )
    {
	dir = dir + '../';
	s = s.substr( k + 1 );
	k = s.indexOf( '/' );
    }

    // Display the banner with the GC logo on the left

    d = document;
    d.write( '<table><tr valign="top"><td class="logo">' );
    d.write( '<img src="' + dir );
    d.write( 'images/logo_with_seal_left.gif" align="left" />' );
    d.write( '</td><td class="info">' );
    d.write( '<h1>' + course_number + " " + info[n].title + '</h1>' );
    d.write( '</td></tr><tr valign="middle"><td class="logotext">' );
    d.write( 'MATHEMATICS&nbsp;AND<br />COMPUTER&nbsp;SCIENCE' );
    d.write( '</td><td>' );
    d.write( '<h2>' + course_term + '</h2>' );
    d.write( '</td></tr></table>' );

/*
 * this version does not work well if the course title is long enough to
 * require more than one line
    d = document;
    d.write( '<table><tr valign="top"><td>' );
    d.write( '<table><tr valign="top"><td class="logo">' );
    d.write( '<img src="' + dir + 'images/logo_with_seal_left.gif" align="left" />' );
    d.write( '</td></tr><tr valign="middle"><td class="logotext">' );
    d.write( 'MATHEMATICS&nbsp;AND<br />COMPUTER&nbsp;SCIENCE' );
    d.write( '</td></tr></table>' );
    d.write( '</td><td class="info">' );
    d.write( '<h1>' + course_number + " " + info[n].title + '</h1>' );
    d.write( '<h2>' + course_term + '</h2>' );
    d.write( '</td></tr></table>' );
*/
}

/*---------------------------------------------------------------------------*/

function display_navigation_list( n )
{
    // Assume that the URL for the current page as it appears in the info
    // list is relative and therefore that any forward slashes indicate how
    // many directory levels we must back up.

    dir = '';
    s = info[n].url;
    k = s.indexOf( '/' );
    while ( k != -1 )
    {
	dir = dir + '../';
	s = s.substr( k + 1 );
	k = s.indexOf( '/' );
    }

    // Show the navigation list.  The name of the current page is not
    // displayed as a link.

    d = document;
    d.write( '<ul>' );
    for ( i = 0; i < info.length; i++ )
    {
	d.write( '<li>' );
	if ( i == n )
	{
	    d.write( info[i].name  );
	}
	else
	{
	    d.write( '<a href="' + dir + info[i].url + '">' + info[i].name + '</a>' );
	}
	d.write( '</li>' );
    }
    d.write( '</ul>' );
}

/*---------------------------------------------------------------------------*/

function showPage( url )
{
    messageWindow = window.open( url, '_blank',
    'location=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,width=1017,height=735' );
}

/*---------------------------------------------------------------------------*/
