$(document).ready(function() {
/*
add link to all images
bind click to all links
*/

// add link to all images
$("div.post-body").find("img").each(function() {
//alert($(this).attr("src"));
if (!$(this).parent().hasClass("thickbox")) { // fix duplicate a.thickbox tag when calling multiple times
var link = $("<a></a>");
link.attr("href", $(this).attr("src"));
link.attr("title", $(this).attr("alt"));
link.attr("rel", "group1");
link.addClass("thickbox");
$(this).wrap(link);
}
});
// bind click to all links
$('a.thickbox', $("div.post-body")).click(function() {
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t, a, g);
this.blur();
return false;
});
});
