var rel_dir = "";
var the_url = "";
var the_title = "";
var the_subtitle = "";
var the_description = "";
var the_icon = "";

var the_bgcolor = "#ccccff";
var the_width = 665;
var the_gutterwidth = 30;

var nav_button1_img = "";
var nav_button1_url = "";
var nav_button2_img = "";
var nav_button2_url = "";
var nav_button3_img = "";
var nav_button3_url = "";
var nav_button4_img = "";
var nav_button4_url = "";

var next_button_img = "nav/next.gif";
var next_button_url = "";
var prev_button_img = "nav/previous.gif";
var prev_button_url = "";


/////////////////////////////////////////////////////////////////////
//
// misc
//
/////////////////////////////////////////////////////////////////////

function set_window_title()
{
    document.write( '<title>Big Adventures' );
    if( "" != the_description )
    {
        document.write( ': ' + the_description );
    }
    document.write( '</title>' );
}


function start_table_row_ex( guttercolor )
{
    if( 0 != the_gutterwidth )
    {
        document.write( '<tr><td width=' + the_gutterwidth + ' bgcolor=' + guttercolor + '></td>' );
    }
    else
    {
        document.write( '<tr>' );
    }
}


function start_table_row_nogutter()
{
    start_table_row_ex( "#ffffff" );
}


function start_table_row()
{
    start_table_row_ex( the_bgcolor );
}

function start_table_row_icon()
{
    if( ( the_icon != "" ) && ( 0 != the_gutterwidth ) )
    {
        document.write( '<tr><td width=' + the_gutterwidth + '>' );
        document.write( '<img src=' + rel_dir + '/nav/' + the_icon + '>' );
        document.write( '</td>' );
    }
    else
    {
        start_table_row_nogutter();
    }
}

function do_copyright()
{
    document.write( '<table width=' + the_width + '>' );
    document.write( '<tr><td><hr>' );
    document.write( '<FONT SIZE=-1><I>all content &copy;1998-2002 Steve Leroux. All rights reserved.</I></FONT>' );
    document.write( '</td></tr></table>' );
}
        
        
        
/////////////////////////////////////////////////////////////////////
//
// buttons
//
/////////////////////////////////////////////////////////////////////

function make_button( link, image1 ) 
{
    var cchImage = image1.length;
    var image2 = image1.substring( 0, cchImage - 4 ) + '_hi' + image1.substring( cchImage - 4, cchImage );
    
    document.write( '<a href="' + rel_dir + link + '">' );
    document.write( '<img src="' + rel_dir + image1 + '" border=0 '  );
    document.write( 'onmouseenter="this.src=' + "'" + rel_dir + image2 + "'" + '"' ); 
    document.write( 'onmouseleave="this.src=' + "'" + rel_dir + image1 + "'" + '"></a>' );
}


function make_prev_next( prevlink, nextlink )
{
    document.write( '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' );
    make_button( prevlink, 'nav/previous.gif', '' )
    document.write( '&nbsp;&nbsp;&nbsp;&nbsp;' );
    make_button( nextlink, 'nav/next.gif', '')
}



/////////////////////////////////////////////////////////////////////
//
// navbar
//
/////////////////////////////////////////////////////////////////////

function standard_navbar_ex( icon )
{
    if( 1 == icon )
    {
        start_table_row_icon();
    }
    else
    {
        start_table_row_nogutter();
    }
    
    document.write( '<td>' );
    
    if( "" != nav_button1_url )
    {
        make_button( nav_button1_url, nav_button1_img );
    }    
    if( "" != nav_button2_url )
    {
        make_button( nav_button2_url, nav_button2_img );
    }    
    if( "" != nav_button3_url )
    {
        make_button( nav_button3_url, nav_button3_img );
    }    
    if( "" != nav_button4_url )
    {
        make_button( nav_button4_url, nav_button4_img );
    }    
    
    document.write( '</td><td align="right">' )
    
    if( "" != prev_button_url )
    {
        make_button( prev_button_url, prev_button_img );
    }  
    
    document.write( '&nbsp;&nbsp;&nbsp;&nbsp;' )
    
    if( "" != next_button_url )
    {
        make_button( next_button_url, next_button_img );
    }  
    
    document.write( '</td></tr>' )
}

function standard_navbar()
{
    standard_navbar_ex( 0 );
}

function icon_navbar()
{
    standard_navbar_ex( 1 );
}
    



/////////////////////////////////////////////////////////////////////
//
// header and footer
//
/////////////////////////////////////////////////////////////////////

function navbar_header()
{
    document.write( '<table cellpadding=5 cellspacing=0 width=' + the_width + '>' );
    
    icon_navbar();
    
    if( "" != the_title )
    {
        make_colorbar( the_title, "" );
    }
    if( "" != the_subtitle )
    {
        start_table_row();
        document.write( '<td colspan=100><font face=arial size=><b>' + the_subtitle + '</font></b></td></tr>' );
    }
    else
    {
    }

    start_table_row();
    document.write( '<td colspan=100>' );
}


function image_header_ex( image, icon, title )
{
    the_gutterwidth = 0;
    document.write( '<table width=' + the_width + '>' );
    
    standard_navbar();
    
    document.write( '<tr><td width=150 valign="top">');
    document.write( '<img src="' + image + '" border=0>' );
    document.write( '</td><td valign="top">' );
    
    if( "" != icon || "" != title )
    {
        document.write( '<h1>' );
        if( "" != icon )
        {
            document.write( '<img src="' + rel_dir + icon + '" border=0>' );
        }
        document.write( title );
        document.write( '</h2>' );
    }  
}


function image_header( image )
{
    image_header_ex( image, "", "" );
}


function navbar_footer()
{
    document.write( '</td></tr>' );
    make_colorline();
    
    icon_navbar();
    standard_footer();
}


function standard_footer()
{
    document.write( '</td></tr></table>' );
    do_copyright();
}



/////////////////////////////////////////////////////////////////////
//
// image placement functions
//
/////////////////////////////////////////////////////////////////////

function image_in_table( image, caption )
{
    var cchImage = image.length;
    var imaget = image.substring( 0, cchImage - 4 ) + 't' + image.substring( cchImage - 4, cchImage );
    
    document.write( '<td valign=top>' );
    document.write( '<p class="caption"><a href="' + image + '">' );
    document.write( '<img src="' + imaget + '" border=0 ' );
    document.write( ' alt="' + image + '"></A><BR>' );
    document.write( caption + '</p></td>' );
}


function inline_image( position, image, caption )
{
    document.write( '<table border=0 hspace=5 vspace=5 align=' + position + '><tr>' );
    image_in_table( image, caption );
    document.write( '</tr></table>' );
}


function inline_image2( image1, caption1, image2, caption2 )
{

    document.write( '<table border=0 hspace=5 vspace=5 align="center"><tr>' );
    image_in_table( image1, caption1 );
    image_in_table( image2, caption2 );
    document.write( '</tr></table>' );
}


function inline_image3( image1, caption1, image2, caption2, image3, caption3 )
{
    document.write( '<table border=0 hspace=5 vpsace=5 align="center"><tr>' );

    image_in_table( image1, caption1 );
    image_in_table( image2, caption2 );
    image_in_table( image3, caption3 );

    document.write( '</tr></table>' );
}



/////////////////////////////////////////////////////////////////////
//
// page addenda type stuff
//
/////////////////////////////////////////////////////////////////////

function sidebar( position, text )
{
    document.write( '<table width=200 border=0 cellspacing=5 bgcolor=' + the_bgcolor + ' align=' + position + '>' );
    document.write( '<tr><td><font size=-1>' );
    document.write( text );
    document.write( '</font></td></tr></table>' );
}


function make_colorbar( text )
{
    start_table_row();
    document.write( '<td colspan=100 align="left" bgcolor=' + the_bgcolor + '>' );
    document.write( '<font face=arial size=+1><b>' + text + '</font></b></td></tr>' );
}

function make_colorline()
{
    start_table_row();
    document.write( '<td colspan=100 height=10 align="left" bgcolor=' + the_bgcolor + '>' );
    document.write( '</td></tr>' );
}


function invisible_line()
{
    document.write( '</td></tr>' );
    start_table_row();
    document.write( '<td colspan=100>' );
};









