//Copyright 2010 Feedjit Inc. All rights reserved. 
var FJ_FBLoaded = false;
var FJ_FBInt1 = false;
function loadFB(){
	var s = document.createElement('SCRIPT');
	s.charset = 'utf-8';
	s.type = 'text/javascript';
	s.src = 'https://ssl.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php';
	s.onload = s.onreadystatechange = function(){
		if( (! FJ_FBLoaded) && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ){ 
			FB.init("fee737e52b616ad2d68029312a53cf77", "/fb/facebook_xd_receiver.html");
			FJ_FBInt1 = setInterval(function(){
				if(FB.Connect && FB.Connect.requireSession){
					FJ_FBLoaded = true;
					clearInterval(FJ_FBInt1);
				}
				}, 200);
		} 
	}; 
	document.getElementsByTagName("head")[0].appendChild(s);
}
function addFBClick(onLoading, onWaitingForLogin, onLogin, onCancelLogin){
	onLoading();
	window['FJ_FBInt2'] = setInterval(function(){
		if(FJ_FBLoaded){
			clearInterval(window['FJ_FBInt2']);
			onWaitingForLogin();
			FB.Connect.requireSession(onLogin, onCancelLogin);
		}
		}, 100);
}

