// Loads the mouse-over images for the menu buttons prior to use, so that they
// don't have to be fetched after the user first hovers over a button.  This is
// especially important for the Opera browser, which handles mouse-over images
// particularly badly.
(function ()
{
    // Define page names for all buttons.
    var vPages =
      [ 'Home', 'Events', 'Location', 'Joining', 'Diary', 'Members', 'Contact' ]

    // Determine current page, to allow its button to be excluded.
    var vLocation =
	window.location.pathname.replace( /.*\//, '' ).replace( /\..*/, '' )
    if ( vLocation == '' || vLocation.toLowerCase() == 'index' )
    {
	vLocation = 'Home'
    }

    // For each button...
    for ( var vIndex = 0; vIndex < vPages.length; vIndex++ )
    {
	// If the button isn't for the current page, load its mouse-over image.
	if ( vPages[ vIndex ] != vLocation )
	{
	    var vImage = new Image( 1, 1 )
	    vImage.src = 'images/btn/' + vPages[ vIndex ] + '_hov.png'
	}
    }
})()

