$(document).ready(function(){
	// Preload all rollovers
    $(".category_image img").each(function () {
        // Set the original src
        rollsrc = $(this).attr("src");
        rollON = rollsrc.replace(/.png$/ig, "-roll.png");
        $("<img>").attr("src", rollON);
    });
    // Rollovers
    $(".category_image a").mouseover(function () {
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/-roll/);
        // don't do the rollover if state is already ON
        if (!matches) {
            imgsrcON = imgsrc.replace(/.png$/ig, "-roll.png"); // strip off extension
            $(this).children("img").attr("src", imgsrcON);
        }
    });
    $(".category_image a").mouseout(function () {
        $(this).children("img").attr("src", imgsrc);
    });
});
