var already_loggedin = 'false';
function setCookie(c_name,value,exdays) {
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
// Additional JS functions here
window.fbAsyncInit = function() {
FB.init({
appId: '152322924922290', // App ID
//channelUrl: 'http://djsoundstorm.de/channel.html', // Channel File
status: true, // check login status
cookie: false, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
/*
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status == 'connected') {
var access_token = response.authResponse.accessToken;
//FB.api('/me?access_token='+access_token, function(response) {
// alert('Hallo '+response.first_name);
//});
setCookie('fbtk_152322924922290',response.authResponse.accessToken,7);
document.getElementById('logout').innerHTML = 'Logout';
} else {
setCookie('fbtk_152322924922290'false,-1);
document.getElementById('logout').innerHTML = 'Login';
}
});*/
FB.Event.subscribe('auth.login', function(response) {
setCookie('fbtk_152322924922290',response.authResponse.accessToken,7);
document.getElementById('logout').innerHTML = 'Logout';
openPage(window.location.href,true);
});
FB.Event.subscribe('auth.logout', function(response) {
openPage(window.location.href,true);
setCookie('fbtk_152322924922290',false,-1);
document.getElementById('logout').innerHTML = 'Login';
});
};
// Load the SDK asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=152322924922290";
ref.parentNode.insertBefore(js, ref);
}(document));
function FacebookLogin() {
FB.login(function(){},{scope:'publish_stream,publish_actions,email,manage_notifications'});
}