(function($) {

$(document).ready(function() {

//turn feed table into divs
$("div.feedreader_box").append(' <div id="axiom_blogs"></div> ');
$("div.feedreader_box td").each(function() {
    $(this).wrapInner('<div class="blog-box"></div>');
    var html = $(this).html();

    $("#axiom_blogs").append(html);
});
$("#axiom_blogs div.blog-box").each(function() {
    $(this).append('<div class="ReadMore"></div>');
    var a = $(this).children(".ItemDetails").find("a.ReadMoreLink");
    $(this).children(".ReadMore").append(a);
});
$("#axiom_blogs div.blog-box").each(function() {
    $(this).append('<div class="sharing"></div>');

    //grab title link
    var postLink = $(this).children(".ItemLink").find("a:last").attr("href");
    var postLinkEncode = encodeURIComponent(postLink);
    var postTitle = $(this).children(".ItemLink").find("a:last").html();

$(this).find(".sharing").append(' <div class="fb_like"><iframe src="http://www.facebook.com/plugins/like.php?app_id=115636101871432&amp;href='+postLinkEncode+'&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:21px;" allowTransparency="true"></iframe></div> ');

$(this).find(".sharing").append(' <div class="addthis_toolbox addthis_default_style "><a class="addthis_counter addthis_pill_style" addthis:url="'+postLinkEncode+'" addthis:title="'+postTitle+'"></a></div><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4e56e53913594b78"></script> ');

});

$("#axiom_blogs").each(function() {
    var h = $("#axiom_blogs").height();
    var blogHeight = h-33;

    $("#axiom_blogs div.blog-box").each(function() {
        $(this).height(blogHeight);
    });
});

$("#axiom_blogs div.blog-box:first").addClass("first");
$("#axiom_blogs div.blog-box:last").addClass("last");

$("div.feedreader_box table").remove();

});

})(jQuery);
