//--------------------------------------------------------------------
// DAVID WINKLER MUSIC
// mouseOver.js
//  -- does the cool little mouseover thingy for the sidebar
//--------------------------------------------------------------------
// (c) 2001-2007 Elliot Winkler
// Created: I have no idea??
// Last modified: 22 April 2007
//--------------------------------------------------------------------

variants = {};

imagesPath = "assets/images/layout/sidebar";

function changeVariant(id, variant)
// Changes the src of the given image to the 'on' version of that image.
{
  $(id).src = variants[id][variant].src;
}

// Main subroutine

function preloadVariants()
{
  $$('#sidebar img').each(function(img) {
    var on = new Image(185, 32);
    on.src = imagesPath+'/'+img.id+'_on.gif';
    var off = new Image(185, 32);
    off.src = imagesPath+'/'+img.id+'_off.gif';
    variants[img.id] = { 'on': on, 'off': off };
  });
}

Event.observe(window, 'load', function(event) { preloadVariants() });