jQuery(function($) {
    $(document).ready(function(){
        // Posts
        $("#content img").each(function () {
            rollsrc = $(this).attr("src");
            rollON = rollsrc.replace(/.png$/gi, "_col.png");
            $("<img>").attr("src", rollON);
        });

        $("#content a").mouseover(function () {
            imgsrc = $(this).children("img").attr("src");
            matches = imgsrc.match(/_col/);
            if (!matches) {
                imgsrcON = imgsrc.replace(/.png$/gi, "_col.png");
                $(this).children("img").attr("src", imgsrcON);
            }
        });

        $("#content a").mouseout(function () {
            $(this).children("img").attr("src", imgsrc);
        });

        // Sidebar
        $("li.cat-item>a").mouseover(function () {
            imgsrc = $(this).children("img").attr("src");
            matches = imgsrc.match(/_col/);
            if (!matches) {
                imgsrcON = imgsrc.replace(/.png$/gi, "_col.png");
                $(this).children("img").attr("src", imgsrcON);
            }
        });

        $("li.cat-item>a").mouseout(function () {
            $(this).children("img").attr("src", imgsrc);
        });
    });
});
