Drupal.sonyConnect.facebook = {
  loaded: false,

  init: function() {
    if (!Drupal.sonyConnect.facebook.loaded) {
      Drupal.sonyConnect.facebook.loaded = true;
      // Create the necessary hidden container to avoid the document.write() 
      // that FeatureLoader will do otherwise.
      $('<div id="FB_HiddenContainer"></div>')
        .css({
          width: 0,
          height: 0,
          position: 'absolute',
          top: -10000
        }).prependTo($('body'));
      // Load the FeatureLoader
      $.getScript('http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US');
    }
  },
  
  connect: function() {
//    FB.Bootstrap.requireFeatures(["Connect"], function() {
//      var settings = Drupal.settings.sonyConnect.facebook;
//      FB.Facebook.init(settings.api_key, settings.callback_path);
//      FB.Connect.requireSession(Drupal.sonyConnect.onPopupClose);
//    });
//    return false;
  }
};
