/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

(function(d){var b={};d.fn.socialButtons=function(a){a=d.extend({wrapper:'<div class="tm-socialbuttons uk-clearfix">'},a);if(!a.twitter&&!a.plusone&&!a.facebook)return this;a.twitter&&!b.twitter&&(b.twitter=d.getScript("//platform.twitter.com/widgets.js"));a.plusone&&!b.plusone&&(b.plusone=d.getScript("//apis.google.com/js/plusone.js"));if(!window.FB&&a.facebook&&!b.facebook){d("body").append('<div id="fb-root"></div>');var c,e=document.getElementsByTagName("script")[0];document.getElementById("facebook-jssdk")||
(c=document.createElement("script"),c.id="facebook-jssdk",c.src="//connect.facebook.net/en_US/all.js#xfbml=1",e.parentNode.insertBefore(c,e));b.facebook=!0}return this.each(function(){var b=d(this).data("permalink"),c=d(a.wrapper).appendTo(this);a.twitter&&c.append('<div><a href="http://twitter.com/share" class="twitter-share-button" data-url="'+b+'" data-count="none">Tweet</a></div>');a.plusone&&c.append('<div><div class="g-plusone" data-size="medium" data-annotation="none" data-href="'+b+'"></div></div>');
a.facebook&&c.append('<div><div class="fb-like" data-href="'+b+'" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div></div>')})}})(jQuery);
