// automatische MouseOvers, this = DOM object $(this) = jQuery object
function initMouseOvers() {
    $("IMG.MOImg").each(function (i) {
        var img = this;

        var extensionIndex = img.src.lastIndexOf('.');
        var path = img.src.substr(0, extensionIndex);
        var extension = img.src.substring(extensionIndex, img.src.length);

        // preload MOimgs
        var MO = new Image();
        MO.src = path + '.on' + extension;
        
        $(this).mouseover(function() {
            img.src = MO.src;
            }
        );

        $(this).mouseout(function() {
            img.src = path + extension;
            }
        );
    });
}

$(document).ready(function() {
    initMouseOvers();
    
    $("IMG.slide").mouseover(function() {
        $("#projectimg").attr("src", this.src);
        return false;
    });
});
