//untuk tooltip
$('a,img,img.related-post-item-thumbnail,a.related-post-item-title,span.homeblog a,.authorphoto,blockquote,pre,ul#recent-posts a,.share-sosmed ul li.main,.share-sosmed ul li.main2,.share-sosmed ul li a span,input.search-field').not('a.related-post-item-titleimg,.post-body .separator a,.share-sosmed ul li a').attr('rel', 'tooltip');
$('.post-body .separator a,.share-sosmed ul li a').data("title", $('.post-body .separator a,.share-sosmed ul li a').attr("title")).removeAttr("title");
$('pre').attr('title', 'Double click to select all text!');
$(document).ready(function(){var e=$("[rel~=tooltip]"),t=false,n=false,r=false;e.bind("mouseenter",function(){t=$(this);tip=t.attr("title");n=$('<div id="tooltip"></div>');if(!tip||tip=="")return false;t.removeAttr("title");n.css("opacity",0).html(tip).appendTo("body");var e=function(){if($(window).width()<n.outerWidth()*1.5)n.css("max-width",$(window).width()/2);else n.css("max-width",340);var e=t.offset().left+t.outerWidth()/2-n.outerWidth()/2,r=t.offset().top-n.outerHeight()-20;if(e<0){e=t.offset().left+t.outerWidth()/2-20;n.addClass("left")}else n.removeClass("left");if(e+n.outerWidth()>$(window).width()){e=t.offset().left-n.outerWidth()+t.outerWidth()/2+20;n.addClass("right")}else n.removeClass("right");if(r<0){var r=t.offset().top+t.outerHeight();n.addClass("top")}else n.removeClass("top");n.css({left:e,top:r}).animate({top:"+=10",opacity:.9},50)};e();$(window).resize(e);var r=function(){n.animate({top:"-=10",opacity:0},50,function(){$(this).remove()});t.attr("title",tip)};t.bind("mouseleave",r);n.bind("click",r)})});//selesai