

$(function() {
    digg_skin='compact'
    digg_window = 'new'
    digg_bgcolor_cycle=true
    $('.item-body h4').each(function() {
        var article_url = $('a', this)[0].href

        digg_url=article_url
        if(digg_bgcolor_cycle){
          digg_bgcolor = '#ffffff'
        } else {
          digg_bgcolor = '#EBF8FF'
        }
        digg_bgcolor_cycle = !digg_bgcolor_cycle
		// Next block taken from "http://digg.com/tools/diggthis.js" and
		// modified to use write_string rather than document.write on the last
		// line.
		var D=typeof digg_skin=="string"?digg_skin:"";var C=80;var A=52;if(D=="compact"){C=18;A=120
		}else{if(D=="icon"){C=16;A=16}}var B=typeof digg_url=="string"?digg_url:(typeof DIGG_URL=="string"?DIGG_URL:window.location.href);
		var write_string ="<iframe src='http://digg.com/tools/diggthis.php?u="+escape(B).replace(/\+/g,"%2b")+(typeof digg_title=="string"?("&t="+escape(digg_title)):"")+(typeof digg_window=="string"?("&w="+escape(digg_window)):"")+(typeof digg_bodytext=="string"?("&b="+escape(digg_bodytext)):"")+(typeof digg_media=="string"?("&m="+escape(digg_media)):"")+(typeof digg_topic=="string"?("&c="+escape(digg_topic)):"")+(typeof digg_bgcolor=="string"?("&k="+escape(digg_bgcolor)):"")+(D?("&s="+D):"")+"' height='"+C+"' width='"+A+"' frameborder='0' scrolling='no'></iframe>"

        $(this).after(write_string)

        reddit_url=article_url
        reddit_title=$(this).text()
	    // Next block taken from "http://www.reddit.com/button.js?t=1"
	    var write_string='<iframe src="http://www.reddit.com/button_content?t=1&url=';
	    if (window.reddit_url)  { write_string += encodeURIComponent(reddit_url); }
	    else { write_string += encodeURIComponent('None');}
	    if (window.reddit_title) { write_string += '&title=' + encodeURIComponent(reddit_title); }
	    if (window.reddit_css) { write_string += '&css=' + encodeURIComponent(reddit_css); }
	    write_string += '" height="22" width="130" scrolling="no" frameborder="0"></iframe>';

	    $(this).after(write_string)
    })
})
