Victorramirez602/domicilio — comment on commit 97104706e3ccaadcb518bd566c45e9fcca24b559
File:  line 0
By Victorramirez602:

Son unos tramposos, quiero que lo solucionen al acto en este momento
Mobile Apps
Getting Started › Mobile Apps
Over 200 million users access Facebook from a mobile device every month. Facebook Platform lets you bring these users and their friends to your mobile apps, creating a more engaging and personalized experience.

Facebook Platform provides SDKs for iOS (iPhone & iPad) and Android. If your mobile app runs on a platform without a Facebook SDK or runs in a mobile browser, you can use our web-based Facebook Login, Platform Dialogs and Graph API directly.

This guide walks you through the basics of creating mobile apps that leverage Facebook Platform. The examples in this guide use Objective-C for iOS, Java for Android and HTML/JavaScript for Mobile Web applications. These examples are very straightforward and easily translatable to other languages.

In this document:

iOS
Android
Mobile Web

iOS for iPhone/iPad

Before you begin development with the Facebook iOS SDK, you will need to install the iOS dev tools, Git (the source control client we use for this SDK) and then clone the lastest version of the SDK from GitHub:

Install XCode

Install Git

Clone the GitHub repository: git clone git://github.com/facebook/facebook-ios-sdk.git

Once you have everything installed, open XCode and create a new iOS project. In order to use the iOS Facebook SDK, the source files from that SDK project must be brought into the app project. This can be done a number of different ways, but the easiest way is to just drag the src folder from the local Git repository for the SDK (e.g. ~/facebook-ios-sdk/src) into the app XCode project.

After including the SDK source files into the app project, an #import declaration must be added to a header file to ensure that that the app can reference the SDK types in the app source files:

#import "FBConnect.h"
With this step complete, the Facebook SDK can be built and used within the app XCode project.

Implementing Single-Sign-On (SSO)
One of the most compelling features of the iOS SDK is Single-Sign-On (SSO). SSO lets users sign into your app using their Facebook identity. If they are already signed into the Facebook iOS app on their device they do not have to even type a username and password. Further, because they are signing to your app with their Facebook identity, you can get permission from the user to access to their profile information and social graph.

SSO primarily works by redirecting the user to the facebook app on her device. Since the user is already logged into facebook, they will not need to enter their username and password to identify themselves. They will see the auth dialog with the permissions that your app has asked for and if they allow then they will be redirected to your app with the appropriate access_token.

Adding SSO to your app is very simple with the Facebook SDK. The below example outlines how to configure the XCode project and what code must be written to enable this feature. For the sake of simplicity, SSO functionality will be added to the AppDelegate that was created by XCode when the app project was created.

First modify the AppDelegate Class.

Step 1. Set the AppDelegate class to handle the Facebook session delegate callback by adding FBSessionDelegate to the list of delegates. For example for the MyGreatIOSApp:

@interface MyGreatIOSAppAppDelegate : NSObject

Step 2. Set up the AppDelegate header file by creating instance variable:

Facebook *facebook;
Step 3. Add a property for an instance of the Facebook class:

@property (nonatomic, retain) Facebook *facebook;

Then modify the AppDelegate implementation file.

Step 1. Synthesize the facebook property (this creates getter and setter methods):

@synthesize facebook;
Step 2. Within the body of the application:didFinishLaunchingWithOptions: method create instance of the Facebook class using your app id (available from the Developer App):

facebook = [[Facebook alloc] initWithAppId:@"YOUR_APP_ID"];
This instance is used to invoke SSO, as well as the Graph API and Platform Dialogs from within the app.

Step 3. Once the instance is created, check for previously saved access token information. (We will show you how to save this information in Step 6.) Use the saved information to set up for a session valid check by assigning the saved information to the facebook access token and expiration date properties. This ensures that your app does not redirect to the facebook app and invoke the auth dialog if the app already has a valid access_token. If you have asked for offline_access extended permission then your access_token will not expire, but can still get invalidated if the user changes their password or uninstalls your app. More information here.

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
Step 4. Check for a valid session and if it is not valid call the authorize method which will both signin the user and prompt the user to authorize the app:

if (![facebook isSessionValid]) {
[facebook authorize:nil delegate:self];
}
Step 5. Add the application:handleOpenURL: method to the AppDelegate with a call to the facebook instance:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {

return [facebook handleOpenURL:url];
}
This method is called by iOS when the Facebook App redirects to the app during the SSO process. The call to Facebook::handleOpenURL: provides the app with the user's credentials.

Step 6. Implement the fbDidLogin method from the FBSessionDelegate implementation. In this method you will save the user's credentials specifically the access token and corresponding expiration date. For simplicity you will save this in the user's preferences - NSUserDefaults:

- (void)fbDidLogin {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];

}

The last thing that needs to be accomplished to enable SSO support is a change to the .plist file that handles configuration for the app. XCode creates this file automatically when the project is created. A specific URL needs to be registered in this file that uniquely identifies the app with iOS. Create a new row named URL types with a single item, URL Schemes, containing a single value, fbYOUR_APP_ID (the literal characters fb followed by your app id). The following shows exactly how the row should appear in the .plist file:

That is it. SSO is ready to go. All that remains is to build and debug the app to ensure anything is setup up correctly. When the app starts in the emulator, you should see the following dialog:

This screen is know as the user authorization dialog. It allows the user to grant your app permission to access their information. If the user presses Allow, your app is authorized and you will have access to the user's profile and social graph through the facebook instance. If the user presses Don't Allow, your app is not authorized and you will not have access to the user's data.

By default, the user is asked to authorize the app to access basic information that is available publicly or by default on Facebook. If your app needs more than this basic information to function, you must request specific permissions from the user. This is accomplished by passing a NSArray of permissions to the authorize method. The following example shows how to ask for access to user's email address and their news feed:

NSArray* permissions = [[NSArray arrayWithObjects:
@"email", @"read_stream", nil] retain];

[facebook authorize:permissions delegate:self];

A full list of permissions is available in our permissions reference. There is a strong inverse correlation between the number of permissions your app requests and the number of users that will allow those permissions. The greater the number of permissions you ask for, the lower the number of users that will grant them; so we recommend that you only request the permissions you absolutely need for your app.

Calling the Graph API
The iOS SDK provides a straightforward set of methods to access the Graph API and the Legacy REST API:

//get information about the currently logged in user
[facebook requestWithGraphPath:@"me" andDelegate:self];

//get the logged-in user's friends
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];

//call a legacy REST API
NSMutableDictionary* params = [NSMutableDictionary
dictionaryWithObjectsAndKeys: @"4", @"uids", @"name", @"fields", nil];

[facebook requestWithMethodName: @"users.getInfo"
andParams: params andHttpMethod: @"GET" andDelegate: self];
These methods are called asynchronously and require that the delegate passed to the above methods implement the FBRequestDelegate protocol, specifically the request:didLoad: method for successful requests and request:didFailWithError method for errors.

Displaying Platform Dialogs
The iOS SDK provides the dialog method to display Platform Dialogs within the context of your app. Simply pass in the name of the dialog to display along with a delegate to handle the result. The delegate must implement the FBDialogDelegate protocol. The following example displays the Feed Dialog:

[facebook dialog:@"feed" andDelegate:self];

Android

Before you begin development with the Facebook Android SDK, you will need to install the Android SDK and dev tools, Git (the source control client we use for this SDK) and then clone the lastest version of the SDK from GitHub:

Install Android SDK & the Eclipse Plugin
Install Git
Clone the GitHub repository: git clone git://github.com/facebook/facebook-android-sdk.git
Once you have everything installed, open Eclipse and create a new Android Project (File | New | Project ...). We will use this project for the Facebook Android SDK source and then reference it from our app. As such, we need to get the content by selecting Create project from existing source and specifying the facebook directory from your git repository (~/facebook-android-sdk/facebook).

With the SDK project created, we can create the app. Create a new Android Project (the Facebook SDK project will stay open in the Eclipse Workspace) from File | New | Project..., using the defaults and populating the require fields.

Once your app project is created, you will need to add a reference to the Facebook SDK project. You do this by opening the properties window for our app (File | Properties), selecting the Android item from the list, pressing the Add... button in the Library area and selecting the Facebook SDK project created above.

Once the Facebook SDK is referenced, the app manifest needs to be modified to allow the app to make network calls to Facebook. This is accomplished by adding the following to the AndroidManifest.xml file in the app project:

We now need to export the signature for your app so that Facebook can use to ensure users are only communicating with your app on the Android. This is done by running the keytool. The following shows how to export the key for your app using the debug defaults specified by the Android SDK and Eclipse:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore
| openssl sha1 -binary
| openssl base64
This tool generates a string that must be registered in the Mobile & Devices section of the Developer App for your app:

Installing the Facebook Android App
To help with debugging your app in the Android emulator, we provide a binary image of the Facebook Android that you can install with the adb tool in the Android SDK.

adb install ~/facebook-android-sdk/Facebook.apk
Your app will still work without installing this image, but we will default to using Platform Dialogs for sign-in rather than using the Facebook App requiring you to sign-in every time you run your app in the emulator.

Single-Sign-On (SSO)
As with the iOS SDK, one of the most compelling features of the Android SDK is Single-Sign-On (SSO). SSO lets users sign into your app using their Facebook identity. If they are already signed into the Facebook Android app on their device they do not have to even type a username and password. Further, because they are signing to your app with their Facebook identity, you will have access to their profile information and social graph.

Adding SSO to your app is very simple with the Facebook SDK. The below example outlines what code must be written to enable this feature. For the sake of simplicity, SSO functionality will be added to the Activity that was created by Eclipse when the app project was created:

package com.greatap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.android.*;
import com.facebook.android.Facebook.*;

public class MyGreatActivity extends Activity {

Facebook facebook = new Facebook("YOUR_APP_ID");

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

facebook.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {}

@Override
public void onFacebookError(FacebookError error) {}

@Override
public void onError(DialogError e) {}

@Override
public void onCancel() {}
});
}

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

facebook.authorizeCallback(requestCode, resultCode, data);
}
}

When the above Activity is built and run as part of your app, you will prompted with the user authorization dialog:

This dialog allows the user to grant your app permission to access their information. If the user presses Allow, your app is authorized and you will have access to the user's profile and social graph through the facebook instance. If the user presses Don't Allow, your app is not authorized and you will not have access to the user's data.

By default, the user is asked to authorize the app to access basic information that is available publicly or by default on Facebook. If your app needs more than this basic information to function, you must request specific permissions from the user. This is accomplished by passing String[] of permissions to the authorize method. The following example shows how to ask for access to user's email address and their news feed:

facebook.authorize(this, new String[] { "email", "read_stream" },

new DialogListener() {
@Override
public void onComplete(Bundle values) {}

@Override
public void onFacebookError(FacebookError error) {}

@Override
public void onError(DialogError e) {}

@Override
public void onCancel() {}
}
);

A full list of permissions is available in our permissions reference. There is a strong inverse correlation between the number of permissions your app requests and the number of users that will allow those permissions. The greater the number of permissions you ask for, the lower the number of users that will grant them; so we recommend that you only request the permissions you absolutely need for your app.

Calling the Graph API
The Android SDK provides a straightforward set of methods to access the Graph API and the Legacy REST API:

// get information about the currently logged in user
facebook.request("me");
//get the logged-in user's friends
facebook.request("me/friends");

//call a Legacy REST API method
Bundle parameters = new Bundle();
parameters.putString("method", "auth.expireSession");
String response = request(parameters);
These methods are called synchronously and will block the UI, so we recommend that calling this in a separate thread and then marshal the results back to the UI thread. The Facebook SDK provides a class, AsyncFacebookRunner, that you can utilize for this purpose.

Displaying Platform Dialogs
The Android SDK provides the dialog method to display Platform Dialogs within the context of your app. Simply pass in the name of the dialog to display along with a delegate to handle the result. The following example displays the Feed Dialog:

facebook.dialog(this,"feed",

new DialogListener() {
@Override
public void onComplete(Bundle values) {}

@Override
public void onFacebookError(FacebookError error) {}

@Override
public void onError(DialogError e) {}

@Override
public void onCancel() {}
}
);

Mobile Web

The mobile web is an important and growing focus area for Facebook Platform. Most of our desktop web technologies apply to the mobile web, making Facebook for Websites is the best place to get started. The following sections highlight how to use the JavaScript SDK and our Platform Dialogs directly to handle user login and news feed publishing.

User Login
Because of the display limitations of mobile devices, Facebook Platform provides special support within our Platform Dialogs for user login on mobile devices. If you are using the our JavaScript SDK, the correct dialog for the user's device will be rendered automatically.

The JavaScript SDK requires that you register your website with Facebook to get an App ID (or appId). The appId is a unique identifier for your site that ensures that we have the right level of security in place between the user and your website. The following example shows how to load the JavaScript SDK using your appId and add the Login Button to your page using the XFBML element:

My Facebook Login Page

Login with Facebook

When this page is loaded into your mobile browser it will render the login button. When the user selects the login button, they will be prompted to authenticate and authorize your site:

If you would rather use the OAuth Dialog directly, you can use the parameter display to specify that you would like to render a mobile version of the dialog. There are two options for display relevant to mobile web apps:

wap for feature phones and older mobile Web browsers
touch for smartphone and tablets with full featured Web browsers
To authenticate a user and have them authorize your site using the WAP-friendly OAuth Dialog, redirect the user to the following URL:

http://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=wap

For a touch view of the same dialog suitable for display in iOS and Android devices, specify the touch value in the display parameter:

http://www.facebook.com/dialog/oauth?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch

News Feed Publishing
As with user login, Facebook Platform provides special support within our Feed Dialog to enable mobile web apps to publish into the News Feed. The current version of the JavaScript SDK does not yet supporting automatically selecting the correct dialog for the user's device. We expect to add this capability shortly.

To display a mobile-friendly Feed Dialog, redirect the user to the following URL:

http://www.facebook.com/dialog/feed?
client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&display=touch

Next Steps

This was a quick survey of building mobile apps/site using Facebook Platform. If you are looking to add deeper personalization to your mobile app/site, exploring the Graph API is the right next step. If you are looking to leverage the different channels that your user can interact with their friends from your app/site, see our Social Channel.

Actualizado hace una semana aproximadamente

/*1325905589,169586796,JIT Construction: v492474,en_US*/

if(!window.FB)window.FB={_apiKey:null,_session:null,_userStatus:'unknown',_logging:true,_inCanvas:((window.location.search.indexOf('fb_sig_in_iframe=1')>-1)||(window.location.search.indexOf('session=')>-1)||(window.location.search.indexOf('signed_request=')>-1)||(window.name.indexOf('iframe_canvas')>-1)||(window.name.indexOf('app_runner')>-1)),_https:(window.name.indexOf('_fb_https')>-1),_domain:{api:'https://api.facebook.com/',api_read:'https://api-read.facebook.com/',cdn:'http://static.ak.fbcdn.net/',https_cdn:'https://s-static.ak.fbcdn.net/',graph:'https://graph.facebook.com/',staticfb:'http://static.ak.facebook.com/',https_staticfb:'https://s-static.ak.facebook.com/',www:'http://www.facebook.com/',https_www:'https://www.facebook.com/',m:'http://m.facebook.com/',https_m:'https://m.facebook.com/'},_locale:null,_localeIsRtl:false,getDomain:function(a,c){var b=!c&&(window.location.protocol=='https:'||FB._https);switch(a){case 'api':return FB._domain.api;case 'api_read':return FB._domain.api_read;case 'cdn':return b?FB._domain.https_cdn:FB._domain.cdn;case 'cdn_foreign':return FB._domain.cdn_foreign;case 'https_cdn':return FB._domain.https_cdn;case 'graph':return FB._domain.graph;case 'staticfb':return b?FB._domain.https_staticfb:FB._domain.staticfb;case 'https_staticfb':return FB._domain.https_staticfb;case 'www':return b?FB._domain.https_www:FB._domain.www;case 'https_www':return FB._domain.https_www;case 'm':return b?FB._domain.https_m:FB._domain.m;case 'https_m':return FB._domain.https_m;}},copy:function(d,c,b,e){for(var a in c)if(b||typeof d[a]==='undefined')d[a]=e?e(c[a]):c[a];return d;},create:function(c,h){var e=window.FB,d=c?c.split('.'):[],a=d.length;for(var b=0;b');e.root.innerHTML='';f=true;window.setTimeout(function(){e.root.innerHTML=b;e.onInsert&&e.onInsert(e.root.firstChild);},0);}else{var c=document.createElement('iframe');c.id=e.id;c.name=e.name;c.onload=FB.Content._callbacks[a];c.scrolling='no';c.style.border='none';c.style.overflow='hidden';if(e.title)c.title=e.title;if(e.className)c.className=e.className;if(e.height)c.style.height=e.height+'px';if(e.width)if(e.width=='100%'){c.style.width=e.width;}else c.style.width=e.width+'px';e.root.appendChild(c);f=true;c.src=e.url;e.onInsert&&e.onInsert(c);}},submitToTarget:function(c,b){var a=document.createElement('form');a.action=c.url;a.target=c.target;a.method=(b)?'GET':'POST';FB.Content.appendHidden(a);FB.Array.forEach(c.params,function(f,e){if(f!==null&&f!==undefined){var d=document.createElement('input');d.name=e;d.value=f;a.appendChild(d);}});a.submit();a.parentNode.removeChild(a);}});
FB.provide('Flash',{_minVersions:[[9,0,159,0],[10,0,22,87]],_swfPath:'swf/XdComm.swf',_callbacks:[],_names:{},_unloadRegistered:false,init:function(){if(FB.Flash._init)return;FB.Flash._init=true;window.FB_OnFlashXdCommReady=function(){FB.Flash._ready=true;for(var a=0,b=FB.Flash._callbacks.length;a'+''+''+'');FB.Content.appendHidden(c);if(FB.UA.ie()>=9){if(!FB.Flash._unloadRegistered){var f=function(){FB.Array.forEach(FB.Flash._names,function(i,h){var g=document.getElementById(h);if(g)g.removeNode(true);});};window.attachEvent('onunload',f);FB.Flash._unloadRegistered=true;}FB.Flash._names[d]=true;}},hasMinVersion:function(){if(typeof FB.Flash._hasMinVersion==='undefined'){var i,a,b,h=[];try{i=new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');}catch(j){if(navigator.mimeTypes.length>0){var mimeType='application/x-shockwave-flash';if(navigator.mimeTypes[mimeType].enabledPlugin){var name='Shockwave Flash';i=(navigator.plugins[name+' 2.0']||navigator.plugins[name]).description;}}}if(i){var f=i.replace(/\D+/g,',').match(/^,?(.+),?$/)[1].split(',');for(a=0,b=f.length;ag[c])break majorVersion;}};}return FB.Flash._hasMinVersion;},onReady:function(a){FB.Flash.init();if(FB.Flash._ready){window.setTimeout(a,0);}else FB.Flash._callbacks.push(a);}});
if(!this.JSON)this.JSON={};(function(){function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function')value=value.toJSON(key);if(typeof rep==='function')value=rep.call(holder,key,value);switch(typeof value){case 'string':return quote(value);case 'number':return isFinite(value)?String(value):'null';case 'boolean':case 'null':return String(value);case 'object':if(!value)return 'null';gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i-1?'&':'?')+FB.QS.encode(e));if(h.length>2000)throw new Error('JSONP only support a maximum of 2000 bytes of input.');FB.ApiServer._callbacks[c]=function(i){a&&a(i);delete FB.ApiServer._callbacks[c];g.parentNode.removeChild(g);};g.src=h;document.getElementsByTagName('head')[0].appendChild(g);},flash:function(b,e,c,d,a){if(!window.FB_OnXdHttpResult)window.FB_OnXdHttpResult=function(g,f){FB.ApiServer._callbacks[g](decodeURIComponent(f));};FB.Flash.onReady(function(){if(b==='graph')d.suppress_http_code=1;var h=FB.getDomain(b)+e,f=FB.QS.encode(d);if(c==='get'){if(h.length+f.length>2000){if(b==='graph')d.method='get';c='post';f=FB.QS.encode(d);}else{h+=(h.indexOf('?')>-1?'&':'?')+f;f='';}}else if(c!=='post'){if(b==='graph')d.method=c;c='post';f=FB.QS.encode(d);}var g=document.XdComm.sendXdHttpRequest(c.toUpperCase(),h,f,null);FB.ApiServer._callbacks[g]=function(i){a&&a(FB.JSON.parse(i));delete FB.ApiServer._callbacks[g];};});}});
FB.provide('EventProvider',{subscribers:function(){if(!this._subscribersMap)this._subscribersMap={};return this._subscribersMap;},subscribe:function(b,a){var c=this.subscribers();if(!c[b]){c[b]=[a];}else c[b].push(a);},unsubscribe:function(b,a){var c=this.subscribers()[b];FB.Array.forEach(c,function(e,d){if(e==a)c[d]=null;});},monitor:function(d,a){if(!a()){var b=this,c=function(){if(a.apply(a,arguments))b.unsubscribe(d,c);};this.subscribe(d,c);}},clear:function(a){delete this.subscribers()[a];},fire:function(){var a=Array.prototype.slice.call(arguments),b=a.shift();FB.Array.forEach(this.subscribers()[b],function(c){if(c)c.apply(this,a);});},listen:function(a,event,b){if(a.addEventListener){a.addEventListener(event,b,false);}else if(a.attachEvent)a.attachEvent('on'+event,b);},unlisten:function(a,event,b){if(a.removeEventListener){a.removeEventListener(event,b,false);}else if(a.detachEvent)a.detachEvent('on'+event,b);}});FB.provide('Event',FB.EventProvider);
FB.provide('XD',{_origin:null,_transport:null,_callbacks:{},_forever:{},_xdProxyUrl:'connect/xd_proxy.php',_openerTransport:null,_openerOrigin:null,_nonOpenerOrigin:null,init:function(b){if(FB.XD._origin)return;var d=(window.location.protocol+'//'+window.location.host+'/'+FB.guid());if(window.addEventListener&&!window.attachEvent&&window.postMessage){FB.XD._origin=d;FB.XD.PostMessage.init();FB.XD._transport='postmessage';}else if(!b&&FB.Flash.hasMinVersion()){if(document.getElementById('fb-root')){var c=document.domain;if(c=='facebook.com')c=window.location.host;FB.XD._origin=(window.location.protocol+'//'+c+'/'+FB.guid());FB.XD.Flash.init();FB.XD._transport='flash';}else{if(FB.log)FB.log('missing fb-root, defaulting to fragment-based xdcomm');FB.XD._transport='fragment';FB.XD.Fragment._channelUrl=b||window.location.toString();}}else{FB.XD._transport='fragment';FB.XD.Fragment._channelUrl=b||window.location.toString();}var a=!!window.attachEvent;if(FB.XD._transport!='postmessage'&&a&&window.postMessage){FB.XD._openerTransport=FB.XD._transport;FB.XD._openerOrigin=FB.XD._origin;FB.XD._nonOpenerOrigin=d;}},resolveRelation:function(b){var g,d,f=b.split('.'),e=window;for(var a=0,c=f.length;a0)return 'javascript:false;//';if(FB.initSitevars.forceSecureXdProxy)b=true;var g=FB.getDomain((b?'https_':'')+'cdn')+FB.XD._xdProxyUrl+'#';d=d||FB.guid();f=f||'opener';if(FB.XD._openerTransport)if(f=='opener'){FB.XD._transport=FB.XD._openerTransport;FB.XD._origin=FB.XD._openerOrigin;}else{FB.XD.PostMessage.init();FB.XD._transport='postmessage';FB.XD._origin=FB.XD._nonOpenerOrigin;}if(FB.XD._transport=='fragment'){g=FB.XD.Fragment._channelUrl;var e=g.indexOf('#');if(e>0)g=g.substr(0,e);g+=((g.indexOf('?')<0?'?':'&')+FB.XD.Fragment._magic+'#?=&');}if(c)FB.XD._forever[d]=true;FB.XD._callbacks[d]=a;return g+FB.QS.encode({cb:d,origin:FB.XD._origin,relation:f,transport:FB.XD._transport});},recv:function(b){if(typeof b=='string')try{b=FB.JSON.parse(b);}catch(c){b=FB.QS.decode(b);}var a=FB.XD._callbacks[b.cb];if(!FB.XD._forever[b.cb])delete FB.XD._callbacks[b.cb];a&&a(b);},PostMessage:{_isInitialized:false,init:function(){if(!FB.XD.PostMessage._isInitialized){var a=FB.XD.PostMessage.onMessage;window.addEventListener?window.addEventListener('message',a,false):window.attachEvent('onmessage',a);FB.XD.PostMessage._isInitialized=true;}},onMessage:function(event){FB.XD.recv(event.data);}},WebView:{onMessage:function(a,c,b){FB.XD.recv(b);}},Flash:{init:function(){FB.Flash.onReady(function(){document.XdComm.postMessage_init('FB.XD.Flash.onMessage',FB.XD._openerOrigin?FB.XD._openerOrigin:FB.XD._origin);});},onMessage:function(a){FB.XD.recv(decodeURIComponent(a));}},Fragment:{_magic:'fb_xd_fragment',checkAndDispatch:function(){var b=window.location.toString(),a=b.substr(b.indexOf('#')+1),c=b.indexOf(FB.XD.Fragment._magic);if(c>0){FB.init=FB.getLoginStatus=FB.api=function(){};document.documentElement.style.display='none';FB.XD.resolveRelation(FB.QS.decode(a).relation).FB.XD.recv(a);}}}});FB.XD.Fragment.checkAndDispatch();
FB.provide('UA',{ie:function(){return FB.UA._populate()||this._ie;},firefox:function(){return FB.UA._populate()||this._firefox;},opera:function(){return FB.UA._populate()||this._opera;},safari:function(){return FB.UA._populate()||this._safari;},chrome:function(){return FB.UA._populate()||this._chrome;},windows:function(){return FB.UA._populate()||this._windows;},osx:function(){return FB.UA._populate()||this._osx;},linux:function(){return FB.UA._populate()||this._linux;},ios:function(){FB.UA._populate();return FB.UA.mobile()&&this._ios;},mobile:function(){FB.UA._populate();return !FB._inCanvas&&this._mobile;},nativeApp:function(){return FB.UA.mobile()&&navigator.userAgent.match(/FBAN\/\w+;/i);},android:function(){FB.UA._populate();return FB.UA.mobile()&&this._android;},iPad:function(){FB.UA._populate();return FB.UA.mobile()&&this._iPad;},_populated:false,_populate:function(){if(FB.UA._populated)return;FB.UA._populated=true;var a=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);var c=/(Mac OS X)|(Windows)|(Linux)/.exec(navigator.userAgent);var b=/\b(iPhone|iP[ao]d)/.exec(navigator.userAgent);FB.UA._iPad=/\b(iPad)/.exec(navigator.userAgent);FB.UA._android=navigator.userAgent.match(/Android/i);FB.UA._mobile=b||FB.UA._android||navigator.userAgent.match(/Mobile/i);if(a){FB.UA._ie=a[1]?parseFloat(a[1]):NaN;if(FB.UA._ie>=8&&!window.HTMLCollection)FB.UA._ie=7;FB.UA._firefox=a[2]?parseFloat(a[2]):NaN;FB.UA._opera=a[3]?parseFloat(a[3]):NaN;FB.UA._safari=a[4]?parseFloat(a[4]):NaN;if(FB.UA._safari){a=/(?:Chrome\/(\d+\.\d+))/.exec(navigator.userAgent);FB.UA._chrome=a&&a[1]?parseFloat(a[1]):NaN;}else FB.UA._chrome=NaN;}else FB.UA._ie=FB.UA._firefox=FB.UA._opera=FB.UA._chrome=FB.UA._safari=NaN;if(c){FB.UA._osx=!!c[1];FB.UA._windows=!!c[2];FB.UA._linux=!!c[3];}else FB.UA._osx=FB.UA._windows=FB.UA._linux=false;FB.UA._ios=b;}});
FB.provide('Arbiter',{_canvasProxyUrl:'connect/canvas_proxy.php',BEHAVIOR_EVENT:'e',BEHAVIOR_PERSISTENT:'p',BEHAVIOR_STATE:'s',inform:function(d,f,g,c,a){if(FB.Canvas.isTabIframe()||(FB._inPlugin&&window.postMessage)||(!FB._inCanvas&&FB.UA.mobile()&&window.postMessage)){var e=FB.JSON.stringify({method:d,params:f,behavior:a||FB.Arbiter.BEHAVIOR_PERSISTENT});if(window.postMessage){FB.XD.resolveRelation(g||'parent').postMessage(e,'*');return;}else try{window.opener.postMessage(e);return;}catch(b){}}c|=(window!=window.parent&&document.referrer.indexOf('https:')===0);var i=(FB.getDomain((c?'https_':'')+'staticfb',true)+FB.Arbiter._canvasProxyUrl+'#'+FB.QS.encode({method:d,params:FB.JSON.stringify(f||{}),behavior:a||FB.Arbiter.BEHAVIOR_PERSISTENT,relation:g}));var h=FB.Content.appendHidden('');FB.Content.insertIframe({url:i,root:h,width:1,height:1,onload:function(){setTimeout(function(){h.parentNode.removeChild(h);},10);}});}});
FB.provide('Canvas',{_timer:null,_lastSize:{},_pageInfo:{clientWidth:0,clientHeight:0,scrollLeft:0,scrollTop:0,offsetLeft:0,offsetTop:0},getPageInfo:function(a){var d='top.frames['+window.name+']';var b=FB.XD.handler(function(e){for(var f in FB.Canvas._pageInfo)if(e[f])FB.Canvas._pageInfo[f]=e[f]|0;a&&a(FB.Canvas._pageInfo);},d,true);var c={channelUrl:b,frame:window.name};FB.Arbiter.inform('getPageInfo',c,'top');return FB.Canvas._pageInfo;},hideFlashElement:function(a){a.style.visibility='hidden';},showFlashElement:function(a){a.style.visibility='';},_flashClassID:"CLSID:D27CDB6E-AE6D-11CF-96B8-444553540000",_hideFlashCallback:function(h){var a=window.document.getElementsByTagName('object');for(var f=0;f=-c))return false;}FB.Canvas._lastSize[e.frame]=e;FB.Arbiter.inform('setSize',e);return true;},scrollTo:function(a,b){FB.Arbiter.inform('scrollTo',{frame:window.name||'iframe_canvas',x:a,y:b});},setAutoGrow:function(b,a){if(a===undefined&&typeof b=="number"){a=b;b=true;}if(b===undefined||b){if(FB.Canvas._timer===null)FB.Canvas._timer=window.setInterval(FB.Canvas.setSize,a||100);FB.Canvas.setSize();}else if(FB.Canvas._timer!==null){window.clearInterval(FB.Canvas._timer);FB.Canvas._timer=null;}},setAutoResize:function(b,a){return FB.Canvas.setAutoGrow(b,a);},isTabIframe:function(){return (window.name.indexOf('app_runner_')===0);},setDoneLoading:function(a){FB.Canvas._passAppTtiMessage(a,'RecordIframeAppTti');},stopTimer:function(a){FB.Canvas._passAppTtiMessage(a,'StopIframeAppTtiTimer');},setUrlHandler:function(a){var b=FB.XD.handler(a,'top.frames['+window.name+']',true);FB.Arbiter.inform('setUrlHandler',b);FB.Event.listen(window,'load',function(){FB.Arbiter.inform('setUrlHandler',b);});},startTimer:function(){FB.Canvas._passAppTtiMessage(null,'StartIframeAppTtiTimer');},_passAppTtiMessage:function(a,c){var b=null;if(a)b=FB.XD.handler(a,'top.frames['+window.name+']',false);FB.Arbiter.inform(c,{frame:window.name||'iframe_canvas',time:(new Date()).getTime(),appId:parseInt(FB._apiKey,10),channelUrl:b});},_computeContentSize:function(){var a=document.body,e=document.documentElement,i=0,d=Math.max(a.offsetTop,0),h=Math.max(e.offsetTop,0),c=a.scrollHeight+d,b=a.offsetHeight+d,g=e.scrollHeight+h,f=e.offsetHeight+h;bottom=Math.max(c,b,g,f);if(a.offsetWidthi)i=k;});if(e.clientLeft>0)i+=(e.clientLeft*2);if(e.clientTop>0)bottom+=(e.clientTop*2);return {height:bottom,width:i};}});
FB.provide('String',{trim:function(a){return a.replace(/^\s*|\s*$/g,'');},format:function(a){if(!FB.String.format._formatRE)FB.String.format._formatRE=/(\{[^\}^\{]+\})/g;var b=arguments;return a.replace(FB.String.format._formatRE,function(e,d){var c=parseInt(d.substr(1),10),f=b[c+1];if(f===null||f===undefined)return '';return f.toString();});},escapeHTML:function(b){var a=document.createElement('div');a.appendChild(document.createTextNode(b));return a.innerHTML.replace(/"/g,'"').replace(/'/g,''');},quote:function(c){var a=/["\\\x00-\x1f\x7f-\x9f]/g,b={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};return a.test(c)?'"'+c.replace(a,function(d){var e=b[d];if(e)return e;e=d.charCodeAt();return '\\u00'+Math.floor(e/16).toString(16)+(e%16).toString(16);})+'"':'"'+c+'"';}});
FB.provide('Dom',{containsCss:function(c,a){var b=' '+c.className+' ';return b.indexOf(' '+a+' ')>=0;},addCss:function(b,a){if(!FB.Dom.containsCss(b,a))b.className=b.className+' '+a;},removeCss:function(b,a){if(FB.Dom.containsCss(b,a)){b.className=b.className.replace(a,'');FB.Dom.removeCss(b,a);}},getByClass:function(b,c,g){c=c||document.body;g=g||'*';if(c.querySelectorAll)return FB.Array.toArray(c.querySelectorAll(g+'.'+b));var a=c.getElementsByTagName(g),d=[];for(var e=0,f=a.length;e=100)d=99.999;if(d<0)d=0;b.opacity=d/100;b.MozOpacity=d/100;b.KhtmlOpacity=d/100;if(a.filters)if(a.filters.alpha==undefined){a.filter="alpha(opacity="+d+")";}else a.filters.alpha.opacity=d;}else b[c]=d;},addScript:function(b){var a=document.createElement('script');a.type="text/javascript";a.src=b;return document.getElementsByTagName('head')[0].appendChild(a);},addCssRules:function(e,c){if(!FB.Dom._cssRules)FB.Dom._cssRules={};var a=true;FB.Array.forEach(c,function(f){if(!(f in FB.Dom._cssRules)){a=false;FB.Dom._cssRules[f]=true;}});if(a)return;if(!FB.UA.ie()){var d=document.createElement('style');d.type='text/css';d.textContent=e;document.getElementsByTagName('head')[0].appendChild(d);}else try{document.createStyleSheet().cssText=e;}catch(b){if(document.styleSheets[0])document.styleSheets[0].cssText+=e;}},getViewportInfo:function(){var a=(document.documentElement&&document.compatMode=='CSS1Compat')?document.documentElement:document.body;return {scrollTop:a.scrollTop,scrollLeft:a.scrollLeft,width:self.innerWidth?self.innerWidth:a.clientWidth,height:self.innerHeight?self.innerHeight:a.clientHeight};},ready:function(a){if(FB.Dom._isReady){a&&a();}else FB.Event.subscribe('dom.ready',a);}});(function(){function domReady(){FB.Dom._isReady=true;FB.Event.fire('dom.ready');FB.Event.clear('dom.ready');}if(FB.Dom._isReady||document.readyState=='complete')return domReady();if(document.addEventListener){document.addEventListener('DOMContentLoaded',domReady,false);}else if(document.attachEvent)document.attachEvent('onreadystatechange',domReady);if(FB.UA.ie()&&window===top)(function(){try{document.documentElement.doScroll('left');}catch(error){setTimeout(arguments.callee,0);return;}domReady();})();var oldonload=window.onload;window.onload=function(){domReady();if(oldonload)if(typeof oldonload=='string'){eval(oldonload);}else oldonload();};})();
FB.provide('Intl',{_punctCharClass:('['+'.!?'+'\u3002'+'\uFF01'+'\uFF1F'+'\u0964'+'\u2026'+'\u0EAF'+'\u1801'+'\u0E2F'+'\uFF0E'+']'),_endsInPunct:function(a){if(typeof a!='string')return false;return a.match(new RegExp(FB.Intl._punctCharClass+'['+')"'+"'"+'\u00BB'+'\u0F3B'+'\u0F3D'+'\u2019'+'\u201D'+'\u203A'+'\u3009'+'\u300B'+'\u300D'+'\u300F'+'\u3011'+'\u3015'+'\u3017'+'\u3019'+'\u301B'+'\u301E'+'\u301F'+'\uFD3F'+'\uFF07'+'\uFF09'+'\uFF3D'+'\s'+']*$'));},_tx:function(d,a){if(a!==undefined)if(typeof a!='object'){FB.log('The second arg to FB.Intl._tx() must be an Object for '+'tx('+d+', ...)');}else{var c;for(var b in a)if(a.hasOwnProperty(b)){if(FB.Intl._endsInPunct(a[b])){c=new RegExp('\{'+b+'\}'+FB.Intl._punctCharClass+'*','g');}else c=new RegExp('\{'+b+'\}','g');d=d.replace(c,a[b]);}}return d;},tx:function(b,a){function c(e,d){void(0);}if(!FB.Intl._stringTable)return null;return FBIntern.Intl._tx(FB.Intl._stringTable[b],a);}});
FB.provide('',{bind:function(){var a=Array.prototype.slice.call(arguments),c=a.shift(),b=a.shift();return function(){return c.apply(b,a.concat(Array.prototype.slice.call(arguments)));};},Class:function(b,a,d){if(FB.CLASSES[b])return FB.CLASSES[b];var c=a||function(){};c.prototype=d;c.prototype.bind=function(e){return FB.bind(e,this);};c.prototype.constructor=c;FB.create(b,c);FB.CLASSES[b]=c;return c;},subclass:function(d,b,c,e){if(FB.CLASSES[d])return FB.CLASSES[d];var a=FB.create(b);FB.copy(e,a.prototype);e._base=a;e._callBase=function(g){var f=Array.prototype.slice.call(arguments,1);return a.prototype[g].apply(this,f);};return FB.Class(d,c?c:function(){if(a.apply)a.apply(this,arguments);},e);},CLASSES:{}});FB.provide('Type',{isType:function(a,b){while(a)if(a.constructor===b||a===b){return true;}else a=a._base;return false;}});
FB.Class('Obj',null,FB.copy({setProperty:function(a,b){if(FB.JSON.stringify(b)!=FB.JSON.stringify(this[a])){this[a]=b;this.fire(a,b);}}},FB.EventProvider));
FB.subclass('Dialog','Obj',function(a){this.id=a;if(!FB.Dialog._dialogs){FB.Dialog._dialogs={};FB.Dialog._addOrientationHandler();}FB.Dialog._dialogs[a]=this;},{});FB.provide('Dialog',{_dialogs:null,_lastYOffset:0,_loaderEl:null,_overlayEl:null,_stack:[],_active:null,_popStateListenerOn:false,_hideOnPopState:function(a){FB.Dialog.hide(FB.Dialog._stack.pop());},get:function(a){return FB.Dialog._dialogs[a];},_findRoot:function(a){while(a){if(FB.Dom.containsCss(a,'fb_dialog'))return a;a=a.parentNode;}},_createWWWLoader:function(a){a=parseInt(a,10);a=a?a:460;return FB.Dialog.create({content:('

'+' '+'

'+' '+' Facebook'+'

'+'

'+'

'+'

'),width:a});},_createMobileLoader:function(){var a=FB.UA.nativeApp()?'':('

'+'
'+'
'+'	'+' '+' '+' '+' '+'	'+'

'+FB.Intl._tx("Loading...")+'

'+' '+'	'+' '+'
'+'
'+'

');return FB.Dialog.create({classes:'loading'+(FB.UA.iPad()?' centered':''),content:('

'+a+'

')});},_restoreBodyPosition:function(){if(!FB.UA.iPad()){var a=document.getElementsByTagName('body')[0];FB.Dom.removeCss(a,'fb_hidden');}},_showIPadOverlay:function(){if(!FB.UA.iPad())return;if(!FB.Dialog._overlayEl){FB.Dialog._overlayEl=document.createElement('div');FB.Dialog._overlayEl.setAttribute('id','fb_dialog_ipad_overlay');FB.Content.append(FB.Dialog._overlayEl,null);}FB.Dialog._overlayEl.className='';},_hideIPadOverlay:function(){if(FB.UA.iPad())FB.Dialog._overlayEl.className='hidden';},showLoader:function(a,d){FB.Dialog._showIPadOverlay();if(!FB.Dialog._loaderEl)FB.Dialog._loaderEl=FB.Dialog._findRoot(FB.UA.mobile()?FB.Dialog._createMobileLoader():FB.Dialog._createWWWLoader(d));if(!a)a=function(){};var c=FB.$('fb_dialog_loader_close');FB.Dom.removeCss(c,'fb_hidden');c.onclick=function(){FB.Dialog._hideLoader();FB.Dialog._restoreBodyPosition();FB.Dialog._hideIPadOverlay();a();};var b=FB.$('fb_dialog_ipad_overlay');if(b)b.ontouchstart=c.onclick;FB.Dialog._makeActive(FB.Dialog._loaderEl);},_hideLoader:function(){if(FB.Dialog._loaderEl&&FB.Dialog._loaderEl==FB.Dialog._active)FB.Dialog._loaderEl.style.top='-10000px';},_makeActive:function(a){FB.Dialog._setDialogSizes();FB.Dialog._lowerActive();FB.Dialog._active=a;var b=FB.Canvas.getPageInfo(function(c){FB.Dialog._centerActive(c);});FB.Dialog._centerActive(b);},_lowerActive:function(){if(!FB.Dialog._active)return;FB.Dialog._active.style.top='-10000px';FB.Dialog._active=null;},_removeStacked:function(a){FB.Dialog._stack=FB.Array.filter(FB.Dialog._stack,function(b){return b!=a;});},_centerActive:function(i){var b=FB.Dialog._active;if(!b)return;var k=FB.Dom.getViewportInfo();var l=parseInt(b.offsetWidth,10);var c=parseInt(b.offsetHeight,10);var d=k.scrollLeft+(k.width-l)/2;var f=(k.height-c)/2.5;if(de)j=e;j+=k.scrollTop;if(FB.UA.mobile()){var h=100;if(FB.UA.iPad()){h+=(k.height-c)/2;}else{var a=document.getElementsByTagName('body')[0];FB.Dom.addCss(a,'fb_hidden');d=10000;j=10000;}var g=FB.Dom.getByClass('fb_dialog_padding',b);if(g.length)g[0].style.height=h+'px';}b.style.left=(d>0?d:0)+'px';b.style.top=(j>0?j:0)+'px';},_setDialogSizes:function(){if(!FB.UA.mobile()||FB.UA.iPad())return;for(var a in FB.Dialog._dialogs)if(document.getElementById(a)){var b=document.getElementById(a);b.style.width=FB.UIServer.getDefaultSize().width+'px';b.style.height=FB.UIServer.getDefaultSize().height+'px';}},_handleOrientationChange:function(a){if(FB.UA.android()&&screen.availWidth==FB.Dialog._availScreenWidth){window.setTimeout(FB.Dialog._handleOrientationChange,50);return;}FB.Dialog._availScreenWidth=screen.availWidth;if(FB.UA.iPad()){FB.Dialog._centerActive(FB.Canvas.getPageInfo());}else for(var b in FB.Dialog._dialogs)if(document.getElementById(b))document.getElementById(b).style.width=FB.UIServer.getDefaultSize().width+'px';},_addOrientationHandler:function(){if(!FB.UA.mobile())return;var a="onorientationchange" in window?'orientationchange':'resize';FB.Dialog._availScreenWidth=screen.availWidth;FB.Event.listen(window,a,FB.Dialog._handleOrientationChange);},create:function(e){e=e||{};var d=document.createElement('div'),c=document.createElement('div'),a='fb_dialog';if(e.closeIcon&&e.onClose){var b=document.createElement('a');b.className='fb_dialog_close_icon';b.onclick=e.onClose;d.appendChild(b);}a+=' '+(e.classes||'');if(FB.UA.ie()){a+=' fb_dialog_legacy';FB.Array.forEach(['vert_left','vert_right','horiz_top','horiz_bottom','top_left','top_right','bottom_left','bottom_right'],function(h){var i=document.createElement('span');i.className='fb_dialog_'+h;d.appendChild(i);});}else a+=(FB.UA.mobile())?' fb_dialog_mobile':' fb_dialog_advanced';if(e.content)FB.Content.append(e.content,c);d.className=a;var g=parseInt(e.width,10);if(!isNaN(g))d.style.width=g+'px';c.className='fb_dialog_content';d.appendChild(c);if(FB.UA.mobile()){var f=document.createElement('div');f.className='fb_dialog_padding';d.appendChild(f);}FB.Content.append(d);if(e.visible)FB.Dialog.show(d);return c;},show:function(a){var b=FB.Dialog._findRoot(a);if(b){FB.Dialog._removeStacked(b);FB.Dialog._hideLoader();FB.Dialog._makeActive(b);FB.Dialog._stack.push(b);if('fbCallID' in a)FB.Dialog.get(a.fbCallID).fire('iframe_show');if(!FB.Event._popStateListenerOn){FB.Event.listen(window,'popstate',FB.Dialog._hideOnPopState);FB.Event._popStateListenerOn=true;}}},hide:function(a){var b=FB.Dialog._findRoot(a);if(b==FB.Dialog._active){FB.Dialog._lowerActive();FB.Dialog._restoreBodyPosition();FB.Dialog._hideIPadOverlay();if('fbCallID' in a)FB.Dialog.get(a.fbCallID).fire('iframe_hide');if(FB.Event._popStateListenerOn){FB.Event.unlisten(window,'popstate',FB.Dialog._hideOnPopState);FB.Event._popStateListenerOn=false;}}},remove:function(a){a=FB.Dialog._findRoot(a);if(a){var b=FB.Dialog._active==a;FB.Dialog._removeStacked(a);if(b){FB.Dialog._hideLoader();if(FB.Dialog._stack.length>0){FB.Dialog.show(FB.Dialog._stack.pop());}else{FB.Dialog._lowerActive();FB.Dialog._restoreBodyPosition();FB.Dialog._hideIPadOverlay();}}else if(FB.Dialog._active===null&&FB.Dialog._stack.length>0)FB.Dialog.show(FB.Dialog._stack.pop());window.setTimeout(function(){a.parentNode.removeChild(a);},3000);}},isActive:function(a){var b=FB.Dialog._findRoot(a);return b&&b===FB.Dialog._active;}});
FB.provide('',{ui:function(f,b){f=FB.copy({},f);if(!f.method){FB.log('"method" is a required parameter for FB.ui().');return null;}if((f.method=='permissions.request'||f.method=='permissions.oauth')&&(f.display=='iframe'||f.display=='dialog')){var h;var i;if(FB._oauth){h=f.scope;i=h.split(/\s|,/g);}else{h=f.perms;i=h.split(',');}for(var e=0;e2000;},getDisplayMode:function(a,b){if(b.display==='hidden'||b.display==='none')return b.display;if(FB.Canvas.isTabIframe()&&b.display!=='popup')return 'async';if(FB.UA.mobile()||b.display==='touch')return 'touch';if(!FB.getAccessToken()&&b.display=='dialog'&&!a.loggedOutIframe){FB.log('"dialog" mode can only be used when the user is connected.');return 'popup';}if(a.connectDisplay&&!FB._inCanvas)return a.connectDisplay;return b.display||(FB.getAccessToken()?'dialog':'popup');},getXdRelation:function(b){var a=b.display;if(a==='popup'||a==='touch')return 'opener';if(a==='dialog'||a==='iframe'||a==='hidden'||a==='none')return 'parent';if(a==='async')return 'parent.frames['+window.name+']';},popup:function(b){var a=typeof window.screenX!='undefined'?window.screenX:window.screenLeft,i=typeof window.screenY!='undefined'?window.screenY:window.screenTop,g=typeof window.outerWidth!='undefined'?window.outerWidth:document.documentElement.clientWidth,f=typeof window.outerHeight!='undefined'?window.outerHeight:(document.documentElement.clientHeight-22),k=FB.UA.mobile()?null:b.size.width,d=FB.UA.mobile()?null:b.size.height,h=(a<0)?window.screen.width+a:a,e=parseInt(h+((g-k)/2),10),j=parseInt(i+((f-d)/2.5),10),c=[];if(k!==null)c.push('width='+k);if(d!==null)c.push('height='+d);c.push('left='+e);c.push('top='+j);c.push('scrollbars=1');if(b.name=='permissions.request'||b.name=='permissions.oauth')c.push('location=1,toolbar=0');c=c.join(',');if(b.post){FB.UIServer.setLoadedNode(b,window.open('about:blank',b.id,c));FB.Content.submitToTarget({url:b.url,target:b.id,params:b.params});}else FB.UIServer.setLoadedNode(b,window.open(b.url,b.id,c));if(b.id in FB.UIServer._defaultCb)FB.UIServer._popupMonitor();},setLoadedNode:function(a,b){FB.UIServer._loadedNodes[a.id]=b;if(a.params&&a.params.display!='popup')b.fbCallID=a.id;},getLoadedNode:function(a){return FB.UIServer._loadedNodes[a.id];},hidden:function(a){a.className='FB_UI_Hidden';a.root=FB.Content.appendHidden('');FB.UIServer._insertIframe(a);},iframe:function(a){a.className='FB_UI_Dialog';var b=function(){FB.UIServer._triggerDefault(a.id);};a.root=FB.Dialog.create({onClose:b,closeIcon:true,classes:(FB.UA.iPad()?'centered':'')});if(!a.hideLoader)FB.Dialog.showLoader(b