// Misc language-independent library
// (c) 2001 - Narelle Lewis Designs - Y. Rutschle

// select one item depending on the date
function DateSelect( List )
{
   var i = (new Date()).getDate();
   return arguments[ i % arguments.length ];
}

// Makes a Column Title
function makeColumn( msg ) {
    var i;
    document.writeln( "<P><B><I><FONT FACE=GARAMOND SIZE=+2 COLOR=#000080>" );
    document.writeln( msg.charAt( 0 ) );
    document.writeln( "<BR></FONT><FONT FACE=GARAMOND SIZE=+1 COLOR=#000080>");
    for( i=1; i < msg.length; i++ ) {
        document.writeln( msg.charAt( i ) );
        document.writeln( "<BR>" );
    }
    document.writeln( "</I></B></P>" );
}

// Makes a title+Subtitle combination 
// (such as "Scotland - Narelle's recollection")
function makeTitle( title, subtitle )
{
    document.writeln( "<FONT SIZE=+1 COLOR=#0000C0 FACE=GARAMOND><B>" );
    document.writeln( title );
    document.writeln( "</B></FONT><BR>" );
    document.writeln( "<FONT COLOR=#0000C0 FACE=GARAMOND><I>" );
    document.writeln( subtitle );
    document.writeln( "</I></FONT>" );
}

// global variable to keep track of how many tickers are on the page
var tickNum=0;

// function to advance the ticker number i
function advanceTicker( i )
{
    var foo;
    eval("foo=document.ticker_f"+i+".ticker_i.value");
    foo = foo.substr( 1 ) + foo.substr( 0, 1 );
    eval("document.ticker_f"+i+".ticker_i.value=foo");
}

// creates a ticker. outputs the html for the form, and creates
// a timer to advance it at requested speed
function makeTicker( css_class, speed, len, msg ) 
{
    document.writeln( "<form name=ticker_f"+tickNum +">" );
    document.writeln( "  <input type=text class="+
                      css_class+' value="'+ msg +
                      '" name=ticker_i onFocus="blur();" size='+len+'>' );
    document.writeln( "</form>" );
    document.writeln( "<script>setInterval( 'advanceTicker("
                       +tickNum+");', "+ speed +" );<\/script>" );
    tickNum++;
}

