/**
*
* @param {bool} showFanDiv if true, the fan view is shown, the non-fan view otherwise
*/

function showHideDivs(showFanDiv) {
	if (showFanDiv) {
		$('#no-fan').hide();
	} else {
		$('#no-fan').show();
	}
}

var init = {
	meinpril : function () {
		showHideDivs(fbRequest.page.liked);
		FB.Event.subscribe('edge.create', function (href, widget) { showHideDivs(true); });
		FB.Event.subscribe('edge.remove', function (href, widget) {  });
	}
};

function starter() {
	var bodyIdent = $('body').attr('id');
	if (bodyIdent in init) { init[bodyIdent](); }
}

window.fbAsyncInit = function() {
	FB.init({
		appId : fbRequest.app.id,
		status : true,
		cookie : true,
		xfbml : true
	});
	FB.Canvas.setAutoResize();
	starter();
};

(function() {
	var e = document.createElement('script');
	e.type = 'text/javascript';
	e.src = document.location.protocol + '//connect.facebook.net/de_DE/all.js';
	e.async = true;
	document.getElementById('fb-root').appendChild(e);
}());
