/* Ratio: 19.1% */

$(document).ready(function(){$(window).log('Facebook');FB_RequireFeatures(["Api"],function(){$(window).log('Require API');FB.Facebook.init('24c74e0e3bec4c538a0f6781c939c0a6',"/xd_receiver.php",{"ifUserConnected":onConnected,"ifUserNotConnected":onNotConnected});});FB.Bootstrap.requireFeatures(["Connect"],function(){$(window).log('Require Connect');FB.Connect.get_status().waitUntilReady(function(status){$(window).log('waitUntilReady');$(window).log(status);switch(status){default:case FB.ConnectState.userNotLoggedIn:$(window).log('User not Logged In');flashVars.loggedInStatus='userNotLoggedIn';break;case FB.ConnectState.connected:var sessionData=FB.Facebook.apiClient.get_session();if(sessionData==null||sessionData.session_key==null){$(window).log('Server Error');setTimeout(function(){location.reload(true);},2000);return;}
flashVars.session_key=sessionData.session_key;flashVars.secret=sessionData.secret;flashVars.loggedInStatus='connected';$(window).log('Connected');break;case FB.ConnectState.appNotAuthorized:$(window).log('app not authorized');flashVars.loggedInStatus='appNotAuthorized';break;}
$(window).log('Status ready');drawStage('flash',flashVars,null,null,'fanship2010');});});function onConnected(){$(window).log('onConnected');}
function onNotConnected(){$(window).log('onNotConnected');}
window.fbLogin=function(){FB.Connect.requireSession(onLogin,onLoginCancel,true);}
function onLogin(){flashCallback("onLogin");}
function onLoginCancel(){flashCallback("onLoginCancel");}
window.fbLogout=function(){$(window).log('fbLogout');FB.Connect.logout(onLogout);}
function onLogout(){$(window).log('Callback: onLogout');flashCallback("onLogout");}
window.showSocialBar=function(){$(window).log('Show Socialbar');$socialbar.show();$affiliations.show();}
window.fbRevokeAuthorization=function(){FB.Facebook.apiClient.revokeAuthorization(FB.Connect.get_loggedInUser(),onRevokeAuthorization);}
function onRevokeAuthorization(){$(window).log('onRevokeAuthorization');flashCallback("onRevokeAuthorization");}});
