/* 
 * General routines used by the whole of the studio pottery site
 */
// popup to display small amount of potter info on hover

$(document).ready(function(){
	$('a.selectedPopup').tooltip(
		{
			tip: 'div.tooltipSelectedPotter',
			position: 'bottom right',
			offset: [-50, 20],
			effect: 'fade',
			onShow: function(){
				var herefString = this.getTrigger().attr("href");
				herefString = potteryDomain + herefString.replace(/profile/i, "profilePopup");
				var toolTip = this.getTip();
				$.get(herefString, function(data){
					toolTip.html(data);
				});
			},
			onHide: function(){
				this.getTip().html('<img src="/src/loading_timer.gif" alt="loading timer" />');
			}
		});
});

function pot_facebookSDKLoad(d, s, id) {
	// load facebook libraries
	var js, fjs = d.getElementsByTagName(s)[0];
	if (d.getElementById(id)) return;
	js = d.createElement(s); js.id = id;
	js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=109554612470971";
	fjs.parentNode.insertBefore(js, fjs);
};
