window.fbAsyncInit = function() {
  FB.init({
	appId: '294829260527181',
	cookie: true,
	xfbml: true,
	oauth: true
  });
  FB.Event.subscribe('auth.login', function(response) {
	//Hack to pause the JS before reload to let PHP script catch up!
	setTimeout('document.location.reload()',0);
  });
  FB.Event.subscribe('auth.logout', function(response) {
	setTimeout('document.location.reload()',0);
  });
};
(function() {
  var e = document.createElement('script'); e.async = true;
  e.src = document.location.protocol +
	'//connect.facebook.net/en_US/all.js';
  document.getElementById('fb-root').appendChild(e);
}());
