var condividi;

$(function(){
	condividi = (function() {
		var share_titolo = null;
		var share_url = null;

		$("<script>").attr({
			src: "http://s7.addthis.com/js/250/addthis_widget.js#username=risteli",
			type: "text/javascript"
		}).load(function() {
			$("a.addthis_button").click(function(){
				var t;
				var u;

				if (share_titolo === null)
					t = document.title;
				else
					t = share_titolo;

				if (share_url === null)
					u = window.location.toString();
				else
					u = share_url;

				return addthis_open(this, "", u, t.replace(/[\001-\037]/g,""));
			});
		}).appendTo("body");

		this.url = function(u) {
			if (u === undefined)
				return share_url;
			return share_url = u;
		};

		this.titolo = function(t) {
			if (t === undefined)
				return share_titolo;
			return share_titolo = t;
		};

		return this;
	})();
});