function statusChangeCallback(response){console.log('statusChangeCallback');console.log(response);if(response.status==='connected'){console.log('Welcome!  Fetching your information.... ');FB.api('/me',function(response){console.log('Successful login for: '+ response.name);console.log(response);document.getElementById('status').innerHTML='Thanks for logging in, '+ response.name+'!';});FB.getLoginStatus(function(response){console.log(response);if(response.status==='connected'){console.log(response.authResponse.accessToken);}});}}
function checkLoginState(){FB.getLoginStatus(function(response){statusChangeCallback(response);});}
window.fbAsyncInit=function(){FB.init({appId:'1567882690169566',cookie:true,xfbml:true,version:'v2.5'});FB.getLoginStatus(function(response){statusChangeCallback(response);});};(function(d,s,id){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_US/sdk.js";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));