window.fbAsyncInit = function() {
	
	// Initialize Facebooks buttons
	FB.init({
		status		: false, // Check login status
		cookie		: true, // Enable cookies to allow the server to access the session
		xfbml		: true  // Parse XFBML
	});
	
	// Push analytics information when a page is liked
	FB.Event.subscribe('edge.create', function(targetUrl) {
		_gaq.push(['global._trackSocial', 'facebook', 'like', targetUrl]);
		_gaq.push(['www._trackSocial', 'facebook', 'like', targetUrl]);
	});
	
	// Push analytics information when a page is unliked
	FB.Event.subscribe('edge.remove', function(targetUrl) {
		_gaq.push(['global._trackSocial', 'facebook', 'unlike', targetUrl]);
		_gaq.push(['www._trackSocial', 'facebook', 'unlike', targetUrl]);
	});
	
};

(function() {
	
	// Get Facebook JS and append it to the DOM
	var e = document.createElement('script'); 
	e.async = true;
	e.src = document.location.protocol+'//connect.facebook.net/en_US/all.js#xfbml=1';
	document.getElementById('fb-root').appendChild(e);
	
	// Get Google Plus JS and append it to the DOM
	var po = document.createElement('script'); 
	po.type = 'text/javascript'; 
	po.async = true;
	po.src = 'https://apis.google.com/js/plusone.js';
	var s = document.getElementsByTagName('script')[0]; 
	s.parentNode.insertBefore(po, s);
	
}());
