// This code is from http://www.quirksmode.org/js/mouseov.html
// Copyright notice: http://www.quirksmode.org/about/copyright.html
// In summary, free to copy, tweak, and sell
var W3CDOM = (document.createElement && document.getElementsByTagName);
var mouseOvers = new Array();
var mouseOuts = new Array();
function attach(id) {
    if (!W3CDOM) return;
    var nav = document.getElementById(id);
    if (!nav) return;
    var imgs = nav.getElementsByTagName('img');
    mouseOuts[id] = new Array();
    mouseOvers[id] = new Array();
    for (var i=0;i<imgs.length;i++) {
        imgs[i].onmouseover = mouseGoesOver;
        imgs[i].onmouseout = mouseGoesOut;
        var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
        mouseOuts[id][i] = new Image();
        mouseOuts[id][i].src = imgs[i].src;
        mouseOvers[id][i] = new Image();
        mouseOvers[id][i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf(
'.')) + "-hover" + suffix;
        imgs[i].number = i;
        imgs[i].mid = id;
    }
}

function mouseGoesOver() {
    this.src = mouseOvers[this.mid][this.number].src;
}

function mouseGoesOut() {
    this.src = mouseOuts[this.mid][this.number].src;
}


