jQuery(function ($) {
	bindSoc(".soc")
})

function bindSoc(element)
{
	$ = jQuery

	$(element).children(".socaction")
	.click(function() {
		var soc = this.parentNode
		$.get(this.href, function(data) {
			var newsoc = $(data)
			$(soc).replaceWith(newsoc);
			bindSoc(newsoc)
		});
		return false;
	});

	$(element).children(".soc-likes").children(".soclikes")
	.mouseenter(function() {
		var tooltip = $(this).next().children("span")
		if (!tooltip.contents().length)
			tooltip.load(this.href);
	});
}

