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

        $("#contenthome h2>a").mouseover(function () {
            imgsrc = $(this).children("img").attr("src");
            matches = imgsrc.match(/_over/);
            if (!matches) {
                imgsrcON = imgsrc.replace(/.jpg$/gi, "_over.jpg");
                $(this).children("img").attr("src", imgsrcON);
            }
        });

        $("#contenthome h2>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(/_over/);
            if (!matches) {
                imgsrcON = imgsrc.replace(/.jpg$/gi, "_over.jpg");
                $(this).children("img").attr("src", imgsrcON);
            }
        });

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