
var GM_fbc=GawkerBase.extend({initialize:function(appid,receiver){this.logging_enabled=false;this.appid=appid;this.receiver=receiver;this.fbInit();},fbInit:function(){FB.Facebook.init(this.appid,this.receiver);},fbReady:function(callback,option,optional){FB.Facebook.get_sessionWaitable().waitUntilReady(function(){this.fb_sess=FB.Facebook.apiClient.get_session();FB.Facebook.apiClient.users_getInfo(this.fb_sess['uid'],new Array('name'),function(result,ex){this.fb_user=result;try{this.fb_user=this.fb_user[0];if(this.fb_user.uid){if(callback){switch(callback){case'fbComment':gmfbc.fbComment(option,optional);break;case'fbFriends':gmfbc.fbFriends();break;}}
return true;}else{return false;}}catch(e){}});});},fbComment:function(id,cid){jQuery.post('/?op=fb&action=publishComment',{'id':id,'cid':cid},function(data){gmfbc.fbPublishComment(data);},"json");},fbFriends:function(){jQuery('#spinner').show();jQuery('#fb_friend_finder').load('/index.php',{'op':'fb','action':'fbFriends'},function(responseText,textStatus,XMLHttpRequest){if('success'==textStatus&&undefined!=pcc){pcc.fireEvent('fbFriendsUpdated',{'pc':pcc});}});},fbPublishComment:function(data){try{retval=FB.Connect.showFeedDialog(data.bundle,data.template);}catch(e){this._log(e);}},_print_r:function(obj){for(var key in obj){if(typeof(obj[key])=='object'){this._log("KEY "+key+" is OBJ:");this._print_r(obj[key]);}else{this._log(key+": "+obj[key]);}}},_log:function(str){if(this.logging_enabled){if(window.console){console.log(str);}}}});function redrawFBML(node)
{try{FB.Bootstrap.requireFeatures(["XFBML"],function(){if(node==undefined){FB.XFBML.Host.parseDomTree();}else{FB.XFBML.Host.parseDomElement(node);}});}catch(e){}}

