  // preload images in css files
  $(['/gfx_interface/pos_rhs.jpg',
     '/gfx_interface/sando_rhs.jpg',
     '/gfx_interface/tobago_rhs.jpg',
     '/gfx_interface/staug_rhs.jpg',
     '/gfx_interface/chag_rhs.jpg',
     '/gfx_interface/newtown_rhs.jpg']).preload();

$(document).ready(function() {

/*
When page loads we want to do the following:
1. Get the text that tells us what club we are inside.
2. Let jQuery use that value to display the default image
3. Depending on which link is hovered over, display the image for that link
*/

var currentclub = $("div#nav-clubs div").text();
if (currentclub == '') currentclub = "Port of Spain Club";
var clubimages = new Array();
clubimages["Newtown Club"]="/gfx_interface/newtown_rhs.jpg";
clubimages["Port of Spain Club"]="/gfx_interface/pos_rhs.jpg";
clubimages["San Fernando Club"]="/gfx_interface/sando_rhs.jpg";
clubimages["Scarborough Club"]="/gfx_interface/tobago_rhs.jpg";
clubimages["St. Augustine Club"]="/gfx_interface/staug_rhs.jpg";
clubimages["Chaguanas Club"]="/gfx_interface/chag_rhs.jpg";

$("span#clubimage").html('<img src="'+clubimages[currentclub]+'" />');

$("a.rhs").hover(function(){
    var clubname = $(this).text()+' Club';
    var imghtml = '<img src="'+clubimages[clubname]+'" />';
    $("span#clubimage").html(imghtml);
},function(){
    $("span#clubimage").html('<img src="'+clubimages[currentclub]+'" />');
})
});
