auth on load javascript sdk

Auth the app on the page load if the user is not authed.

FB.getLoginStatus(function(response) {
  if (response.status === 'connected') {
    var uid = response.authResponse.userID;
    var accessToken = response.authResponse.accessToken;
    alert(uid);
  } else if (response.status === 'not_authorized') {
  	  FB.login(
  	    function(response) {
  	      if (response.authResponse) {
  		      top.location.href='http:domain.comdirectorymobile';
  		 } else {}
  	    },
  	    { scope: 'email,user_birthday,user_location,user_likes' }
  	  );
  } else {
    FB.login(
  	    function(response) {
  	      if (response.authResponse) {
  		      top.location.href='http:domain.comdirectorymobile';
  		 } else {}
  	    },
  	    { scope: 'email,user_birthday,user_location,user_likes' }
  	  );
  }
});