  window.fbAsyncInit = function() {
	FB.init({
	  appId   : '197088346988235',
	  status  : true, // check login status
	  cookie  : true, // enable cookies to allow the server to access the session
	});

	// whenever the user logs in, we refresh the page
	FB.Event.subscribe('auth.login', function() {
	  window.location.href = 'register_fb.php';
	}); 
  };

  (function() {
	var e = document.createElement('script');
	e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
	e.async = true;
	document.getElementById('fb-root').appendChild(e);
  }());
  
  function GetRegisterPerms() {
	FB.login(function(response) {
	  window.location.href = 'register_fb.php';
	}, {perms:'user_about_me,user_activities,user_likes,user_interests,user_birthday,user_website,user_location,email,offline_access'});
  }
  
  function GetProfilPerms() {
	FB.login(function(response) {
	  window.location.href = 'user_profil_fb.php';
	}, {perms:'user_about_me,user_activities,user_likes,user_interests,user_birthday,user_website,user_location,offline_access'});
  }
