Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 9th, 2012  |  syntax: None  |  size: 65.52 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. 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)),_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:window.location.protocol + '//www.facebook.com/',https_www:'https://www.facebook.com/'},_locale:null,_localeIsRtl:false,getDomain:function(a) {
  3.     switch (a) {case 'api':return FB._domain.api;case 'api_read':return FB._domain.api_read;case 'cdn':return (window.location.protocol == 'https:' || FB._https) ? FB._domain.https_cdn : FB._domain.cdn;case 'graph':return FB._domain.graph;case 'staticfb':return FB._https ? FB._domain.https_staticfb : FB._domain.staticfb;case 'https_staticfb':return FB._domain.https_staticfb;case 'www':return FB._https ? FB._domain.https_www : FB._domain.www;case 'https_www':return FB._domain.https_www;
  4.     }
  5. },copy:function(d, c, b, e) {
  6.     for (var a in c)if (b || typeof d[a] === 'undefined')d[a] = e ? e(c[a]) : c[a];
  7.     return d;
  8. },create:function(c, h) {
  9.     var e = window.FB,d = c ? c.split('.') : [],a = d.length;
  10.     for (var b = 0; b < a; b++) {
  11.         var g = d[b];
  12.         var f = e[g];
  13.         if (!f) {
  14.             f = (h && b + 1 == a) ? h : {};
  15.             e[g] = f;
  16.         }
  17.         e = f;
  18.     }
  19.     return e;
  20. },provide:function(c, b, a) {
  21.     return FB.copy(typeof c == 'string' ? FB.create(c) : c, b, a);
  22. },guid:function() {
  23.     return 'f' + (Math.random() * (1 << 30)).toString(16).replace('.', '');
  24. },log:function(a) {
  25.     if (FB._logging)if (window.Debug && window.Debug.writeln) {
  26.         window.Debug.writeln(a);
  27.     } else if (window.console)window.console.log(a);
  28.     if (FB.Event)FB.Event.fire('fb.log', a);
  29. },$:function(a) {
  30.     return document.getElementById(a);
  31. }};
  32. FB.provide('Array', {indexOf:function(a, c) {
  33.     if (a.indexOf)return a.indexOf(c);
  34.     var d = a.length;
  35.     if (d)for (var b = 0; b < d; b++)if (a[b] === c)return b;
  36.     return -1;
  37. },merge:function(c, b) {
  38.     for (var a = 0; a < b.length; a++)if (FB.Array.indexOf(c, b[a]) < 0)c.push(b[a]);
  39.     return c;
  40. },filter:function(a, c) {
  41.     var b = [];
  42.     for (var d = 0; d < a.length; d++)if (c(a[d]))b.push(a[d]);
  43.     return b;
  44. },keys:function(c, d) {
  45.     var a = [];
  46.     for (var b in c)if (d || c.hasOwnProperty(b))a.push(b);
  47.     return a;
  48. },map:function(a, d) {
  49.     var c = [];
  50.     for (var b = 0; b < a.length; b++)c.push(d(a[b]));
  51.     return c;
  52. },forEach:function(c, a, f) {
  53.     if (!c)return;
  54.     if (Object.prototype.toString.apply(c) === '[object Array]' || (!(c instanceof Function) && typeof c.length == 'number')) {
  55.         if (c.forEach) {
  56.             c.forEach(a);
  57.         } else for (var b = 0,e = c.length; b < e; b++)a(c[b], b, c);
  58.     } else for (var d in c)if (f || c.hasOwnProperty(d))a(c[d], d, c);
  59. }});
  60. FB.provide('QS', {encode:function(c, d, a) {
  61.     d = d === undefined ? '&' : d;
  62.     a = a === false ? function(e) {
  63.         return e;
  64.     } : encodeURIComponent;
  65.     var b = [];
  66.     FB.Array.forEach(c, function(f, e) {
  67.         if (f !== null && typeof f != 'undefined')b.push(a(e) + '=' + a(f));
  68.     });
  69.     b.sort();
  70.     return b.join(d);
  71. },decode:function(f) {
  72.     var a = decodeURIComponent,d = {},e = f.split('&'),b,c;
  73.     for (b = 0; b < e.length; b++) {
  74.         c = e[b].split('=', 2);
  75.         if (c && c[0])d[a(c[0])] = a(c[1] || '');
  76.     }
  77.     return d;
  78. }});
  79. FB.provide('Content', {_root:null,_hiddenRoot:null,_callbacks:{},append:function(a, c) {
  80.     if (!c)if (!FB.Content._root) {
  81.         FB.Content._root = c = FB.$('fb-root');
  82.         if (!c) {
  83.             FB.log('The "fb-root" div has not been created.');
  84.             return;
  85.         } else c.className += ' fb_reset';
  86.     } else c = FB.Content._root;
  87.     if (typeof a == 'string') {
  88.         var b = document.createElement('div');
  89.         c.appendChild(b).innerHTML = a;
  90.         return b;
  91.     } else return c.appendChild(a);
  92. },appendHidden:function(a) {
  93.     if (!FB.Content._hiddenRoot) {
  94.         var b = document.createElement('div'),c = b.style;
  95.         c.position = 'absolute';
  96.         c.top = '-10000px';
  97.         c.width = c.height = 0;
  98.         FB.Content._hiddenRoot = FB.Content.append(b);
  99.     }
  100.     return FB.Content.append(a, FB.Content._hiddenRoot);
  101. },insertIframe:function(e) {
  102.     e.id = e.id || FB.guid();
  103.     e.name = e.name || FB.guid();
  104.     var a = FB.guid(),f = false,d = false;
  105.     FB.Content._callbacks[a] = function() {
  106.         if (f && !d) {
  107.             d = true;
  108.             e.onload && e.onload(e.root.firstChild);
  109.         }
  110.     };
  111.     if (document.attachEvent) {
  112.         var b = ('<iframe' + ' id="' + e.id + '"' + ' name="' + e.name + '"' + (e.title ? ' title="' + e.title + '"' : '') + (e.className ? ' class="' + e.className + '"' : '') + ' style="border:none;' + (e.width ? 'width:' + e.width + 'px;' : '') + (e.height ? 'height:' + e.height + 'px;' : '') + '"' + ' src="' + e.url + '"' + ' frameborder="0"' + ' scrolling="no"' + ' allowtransparency="true"' + ' onload="FB.Content._callbacks.' + a + '()"' + '></iframe>');
  113.         e.root.innerHTML = '<iframe src="javascript:false"' + ' frameborder="0"' + ' scrolling="no"' + ' style="height:1px"></iframe>';
  114.         f = true;
  115.         window.setTimeout(function() {
  116.             e.root.innerHTML = b;
  117.         }, 0);
  118.     } else {
  119.         var c = document.createElement('iframe');
  120.         c.id = e.id;
  121.         c.name = e.name;
  122.         c.onload = FB.Content._callbacks[a];
  123.         c.scrolling = 'no';
  124.         c.style.border = 'none';
  125.         c.style.overflow = 'hidden';
  126.         if (e.title)c.title = e.title;
  127.         if (e.className)c.className = e.className;
  128.         if (e.height)c.style.height = e.height + 'px';
  129.         if (e.width)c.style.width = e.width + 'px';
  130.         e.root.appendChild(c);
  131.         f = true;
  132.         c.src = e.url;
  133.     }
  134. },postTarget:function(b) {
  135.     var a = document.createElement('form');
  136.     a.action = b.url;
  137.     a.target = b.target;
  138.     a.method = 'POST';
  139.     FB.Content.appendHidden(a);
  140.     FB.Array.forEach(b.params, function(e, d) {
  141.         if (e !== null && e !== undefined) {
  142.             var c = document.createElement('input');
  143.             c.name = d;
  144.             c.value = e;
  145.             a.appendChild(c);
  146.         }
  147.     });
  148.     a.submit();
  149.     a.parentNode.removeChild(a);
  150. }});
  151. FB.provide('Flash', {_minVersions:[
  152.     [9,0,159,0],
  153.     [10,0,22,87]
  154. ],_swfPath:'swf/XdComm.swf',_callbacks:[],init:function() {
  155.     if (FB.Flash._init)return;
  156.     FB.Flash._init = true;
  157.     window.FB_OnFlashXdCommReady = function() {
  158.         FB.Flash._ready = true;
  159.         for (var d = 0,e = FB.Flash._callbacks.length; d < e; d++)FB.Flash._callbacks[d]();
  160.         FB.Flash._callbacks = [];
  161.     };
  162.     var a = !!document.attachEvent,c = FB.getDomain('cdn') + FB.Flash._swfPath,b = ('<object ' + 'type="application/x-shockwave-flash" ' + 'id="XdComm" ' + (a ? 'name="XdComm" ' : '') + (a ? '' : 'data="' + c + '" ') + (a ? 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' : '') + 'allowscriptaccess="always">' + '<param name="movie" value="' + c + '"></param>' + '<param name="allowscriptaccess" value="always"></param>' + '</object>');
  163.     FB.Content.appendHidden(b);
  164. },hasMinVersion:function() {
  165.     if (typeof FB.Flash._hasMinVersion === 'undefined') {
  166.         var i,a,b,h = [];
  167.         try {
  168.             i = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');
  169.         } catch(j) {
  170.             if (navigator.mimeTypes.length > 0) {
  171.                 var mimeType = 'application/x-shockwave-flash';
  172.                 if (navigator.mimeTypes[mimeType].enabledPlugin) {
  173.                     var name = 'Shockwave Flash';
  174.                     i = (navigator.plugins[name + ' 2.0'] || navigator.plugins[name]).description;
  175.                 }
  176.             }
  177.         }
  178.         if (i) {
  179.             var f = i.replace(/\D+/g, ',').match(/^,?(.+),?$/)[1].split(',');
  180.             for (a = 0,b = f.length; a < b; a++)h.push(parseInt(f[a], 10));
  181.         }
  182.         FB.Flash._hasMinVersion = false;
  183.         majorVersion:for (a = 0,b = FB.Flash._minVersions.length; a < b; a++) {
  184.             var g = FB.Flash._minVersions[a];
  185.             if (g[0] != h[0])continue;
  186.             for (var c = 1,d = g.length,e = h.length; (c < d && c < e); c++)if (h[c] < g[c]) {
  187.                 FB.Flash._hasMinVersion = false;
  188.                 continue majorVersion;
  189.             } else {
  190.                 FB.Flash._hasMinVersion = true;
  191.                 if (h[c] > g[c])break majorVersion;
  192.             }
  193.         }
  194.         ;
  195.     }
  196.     return FB.Flash._hasMinVersion;
  197. },onReady:function(a) {
  198.     FB.Flash.init();
  199.     if (FB.Flash._ready) {
  200.         window.setTimeout(a, 0);
  201.     } else FB.Flash._callbacks.push(a);
  202. }});
  203. if (!this.JSON)this.JSON = {};
  204. (function() {
  205.     function f(n) {
  206.         return n < 10 ? '0' + n : n;
  207.     }
  208.  
  209.     if (typeof Date.prototype.toJSON !== 'function') {
  210.         Date.prototype.toJSON = function(key) {
  211.             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;
  212.         };
  213.         String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(key) {
  214.             return this.valueOf();
  215.         };
  216.     }
  217.     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;
  218.  
  219.     function quote(string) {
  220.         escapable.lastIndex = 0;
  221.         return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
  222.             var c = meta[a];
  223.             return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  224.         }) + '"' : '"' + string + '"';
  225.     }
  226.  
  227.     function str(key, holder) {
  228.         var i,k,v,length,mind = gap,partial,value = holder[key];
  229.         if (value && typeof value === 'object' && typeof value.toJSON === 'function')value = value.toJSON(key);
  230.         if (typeof rep === 'function')value = rep.call(holder, key, value);
  231.         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]') {
  232.             length = value.length;
  233.             for (i = 0; i < length; i += 1)partial[i] = str(i, value) || 'null';
  234.             v = partial.length === 0 ? '[]' : gap ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : '[' + partial.join(',') + ']';
  235.             gap = mind;
  236.             return v;
  237.         }if (rep && typeof rep === 'object') {
  238.             length = rep.length;
  239.             for (i = 0; i < length; i += 1) {
  240.                 k = rep[i];
  241.                 if (typeof k === 'string') {
  242.                     v = str(k, value);
  243.                     if (v)partial.push(quote(k) + (gap ? ': ' : ':') + v);
  244.                 }
  245.             }
  246.         } else for (k in value)if (Object.hasOwnProperty.call(value, k)) {
  247.             v = str(k, value);
  248.             if (v)partial.push(quote(k) + (gap ? ': ' : ':') + v);
  249.         }v = partial.length === 0 ? '{}' : gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : '{' + partial.join(',') + '}';gap = mind;return v;
  250.         }
  251.     }
  252.  
  253.     if (typeof JSON.stringify !== 'function')JSON.stringify = function(value, replacer, space) {
  254.         var i;
  255.         gap = '';
  256.         indent = '';
  257.         if (typeof space === 'number') {
  258.             for (i = 0; i < space; i += 1)indent += ' ';
  259.         } else if (typeof space === 'string')indent = space;
  260.         rep = replacer;
  261.         if (replacer && typeof replacer !== 'function' && (typeof replacer !== 'object' || typeof replacer.length !== 'number'))throw new Error('JSON.stringify');
  262.         return str('', {'':value});
  263.     };
  264.     if (typeof JSON.parse !== 'function')JSON.parse = function(text, reviver) {
  265.         var j;
  266.  
  267.         function walk(holder, key) {
  268.             var k,v,value = holder[key];
  269.             if (value && typeof value === 'object')for (k in value)if (Object.hasOwnProperty.call(value, k)) {
  270.                 v = walk(value, k);
  271.                 if (v !== undefined) {
  272.                     value[k] = v;
  273.                 } else delete value[k];
  274.             }
  275.             return reviver.call(holder, key, value);
  276.         }
  277.  
  278.         cx.lastIndex = 0;
  279.         if (cx.test(text))text = text.replace(cx, function(a) {
  280.             return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  281.         });
  282.         if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
  283.             j = eval('(' + text + ')');
  284.             return typeof reviver === 'function' ? walk({'':j}, '') : j;
  285.         }
  286.         throw new SyntaxError('JSON.parse');
  287.     };
  288. }());
  289. FB.provide('JSON', {stringify:function(a) {
  290.     if (window.Prototype && Object.toJSON) {
  291.         return Object.toJSON(a);
  292.     } else return JSON.stringify(a);
  293. },parse:function(a) {
  294.     return JSON.parse(a);
  295. },flatten:function(c) {
  296.     var a = {};
  297.     for (var b in c)if (c.hasOwnProperty(b)) {
  298.         var d = c[b];
  299.         if (null === d || undefined === d) {
  300.             continue;
  301.         } else if (typeof d == 'string') {
  302.             a[b] = d;
  303.         } else a[b] = FB.JSON.stringify(d);
  304.     }
  305.     return a;
  306. }});
  307. FB.provide('', {api:function() {
  308.     if (typeof arguments[0] === 'string') {
  309.         FB.ApiServer.graph.apply(FB.ApiServer, arguments);
  310.     } else FB.ApiServer.rest.apply(FB.ApiServer, arguments);
  311. }});
  312. FB.provide('ApiServer', {METHODS:['get','post','delete','put'],_callbacks:{},_readOnlyCalls:{fql_query:true,fql_multiquery:true,friends_get:true,notifications_get:true,stream_get:true,users_getinfo:true},graph:function() {
  313.     var a = Array.prototype.slice.call(arguments),f = a.shift(),d = a.shift(),c,e,b;
  314.     while (d) {
  315.         var g = typeof d;
  316.         if (g === 'string' && !c) {
  317.             c = d.toLowerCase();
  318.         } else if (g === 'function' && !b) {
  319.             b = d;
  320.         } else if (g === 'object' && !e) {
  321.             e = d;
  322.         } else {
  323.             FB.log('Invalid argument passed to FB.api(): ' + d);
  324.             return;
  325.         }
  326.         d = a.shift();
  327.     }
  328.     c = c || 'get';
  329.     e = e || {};
  330.     if (f[0] === '/')f = f.substr(1);
  331.     if (FB.Array.indexOf(FB.ApiServer.METHODS, c) < 0) {
  332.         FB.log('Invalid method passed to FB.api(): ' + c);
  333.         return;
  334.     }
  335.     FB.ApiServer.oauthRequest('graph', f, c, e, b);
  336. },rest:function(e, a) {
  337.     var c = e.method.toLowerCase().replace('.', '_');
  338.     if (FB.Auth && c === 'auth_revokeauthorization') {
  339.         var d = a;
  340.         a = function(f) {
  341.             if (f === true)FB.Auth.setSession(null, 'notConnected');
  342.             d && d(f);
  343.         };
  344.     }
  345.     e.format = 'json-strings';
  346.     e.api_key = FB._apiKey;
  347.     var b = FB.ApiServer._readOnlyCalls[c] ? 'api_read' : 'api';
  348.     FB.ApiServer.oauthRequest(b, 'restserver.php', 'get', e, a);
  349. },oauthRequest:function(b, f, c, e, a) {
  350.     if (FB._session && FB._session.access_token && !e.access_token)e.access_token = FB._session.access_token;
  351.     e.sdk = 'joey';
  352.     e.pretty = 0;
  353.     var d = a;
  354.     a = function(h) {
  355.         if (FB.Auth && h && FB._session && FB._session.access_token == e.access_token && (h.error_code === '190' || (h.error && (h.error === 'invalid_token' || h.error.type === 'OAuthException'))))FB.getLoginStatus(null, true);
  356.         d && d(h);
  357.     };
  358.     try {
  359.         FB.ApiServer.jsonp(b, f, c, FB.JSON.flatten(e), a);
  360.     } catch(g) {
  361.         if (FB.Flash.hasMinVersion()) {
  362.             FB.ApiServer.flash(b, f, c, FB.JSON.flatten(e), a);
  363.         } else throw new Error('Flash is required for this API call.');
  364.     }
  365. },jsonp:function(b, f, d, e, a) {
  366.     var c = FB.guid(),g = document.createElement('script');
  367.     if (b === 'graph' && d !== 'get')e.method = d;
  368.     e.callback = 'FB.ApiServer._callbacks.' + c;
  369.     var h = (FB.getDomain(b) + f + (f.indexOf('?') > -1 ? '&' : '?') + FB.QS.encode(e));
  370.     if (h.length > 2000)throw new Error('JSONP only support a maximum of 2000 bytes of input.');
  371.     FB.ApiServer._callbacks[c] = function(i) {
  372.         a && a(i);
  373.         delete FB.ApiServer._callbacks[c];
  374.         g.parentNode.removeChild(g);
  375.     };
  376.     g.src = h;
  377.     document.getElementsByTagName('head')[0].appendChild(g);
  378. },flash:function(b, e, c, d, a) {
  379.     if (!window.FB_OnXdHttpResult)window.FB_OnXdHttpResult = function(g, f) {
  380.         FB.ApiServer._callbacks[g](decodeURIComponent(f));
  381.     };
  382.     FB.Flash.onReady(function() {
  383.         var h = FB.getDomain(b) + e,f = FB.QS.encode(d);
  384.         if (c === 'get') {
  385.             if (h.length + f.length > 2000) {
  386.                 if (b === 'graph')d.method = 'get';
  387.                 c = 'post';
  388.                 f = FB.QS.encode(d);
  389.             } else {
  390.                 h += (h.indexOf('?') > -1 ? '&' : '?') + f;
  391.                 f = '';
  392.             }
  393.         } else if (c !== 'post') {
  394.             if (b === 'graph')d.method = c;
  395.             c = 'post';
  396.             f = FB.QS.encode(d);
  397.         }
  398.         var g = document.XdComm.sendXdHttpRequest(c.toUpperCase(), h, f, null);
  399.         FB.ApiServer._callbacks[g] = function(i) {
  400.             a && a(FB.JSON.parse(i));
  401.             delete FB.ApiServer._callbacks[g];
  402.         };
  403.     });
  404. }});
  405. FB.provide('EventProvider', {subscribers:function() {
  406.     if (!this._subscribersMap)this._subscribersMap = {};
  407.     return this._subscribersMap;
  408. },subscribe:function(b, a) {
  409.     var c = this.subscribers();
  410.     if (!c[b]) {
  411.         c[b] = [a];
  412.     } else c[b].push(a);
  413. },unsubscribe:function(b, a) {
  414.     var c = this.subscribers()[b];
  415.     FB.Array.forEach(c, function(e, d) {
  416.         if (e == a)c[d] = null;
  417.     });
  418. },monitor:function(d, a) {
  419.     if (!a()) {
  420.         var b = this,c = function() {
  421.             if (a.apply(a, arguments))b.unsubscribe(d, c);
  422.         };
  423.         this.subscribe(d, c);
  424.     }
  425. },clear:function(a) {
  426.     delete this.subscribers()[a];
  427. },fire:function() {
  428.     var a = Array.prototype.slice.call(arguments),b = a.shift();
  429.     FB.Array.forEach(this.subscribers()[b], function(c) {
  430.         if (c)c.apply(this, a);
  431.     });
  432. }});
  433. FB.provide('Event', FB.EventProvider);
  434. FB.provide('Intl', {_punctCharClass:('[' + '.!?' + '\u3002' + '\uFF01' + '\uFF1F' + '\u0964' + '\u2026' + '\u0EAF' + '\u1801' + '\u0E2F' + '\uFF0E' + ']'),_endsInPunct:function(a) {
  435.     if (typeof a != 'string')return false;
  436.     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' + ']*$'));
  437. },_tx:function(d, a) {
  438.     if (a !== undefined)if (typeof a != 'object') {
  439.         FB.log('The second arg to FB.Intl._tx() must be an Object for ' + 'tx(' + d + ', ...)');
  440.     } else {
  441.         var c;
  442.         for (var b in a)if (a.hasOwnProperty(b)) {
  443.             if (FB.Intl._endsInPunct(a[b])) {
  444.                 c = new RegExp('\{' + b + '\}' + FB.Intl._punctCharClass + '*', 'g');
  445.             } else c = new RegExp('\{' + b + '\}', 'g');
  446.             d = d.replace(c, a[b]);
  447.         }
  448.     }
  449.     return d;
  450. },tx:function(b, a) {
  451.     function c(e, d) {
  452.         void(0);
  453.     }
  454.  
  455.     if (!FB.Intl._stringTable)return null;
  456.     return FBIntern.Intl._tx(FB.Intl._stringTable[b], a);
  457. }});
  458. FB.provide('String', {trim:function(a) {
  459.     return a.replace(/^\s*|\s*$/g, '');
  460. },format:function(a) {
  461.     if (!FB.String.format._formatRE)FB.String.format._formatRE = /(\{[^\}^\{]+\})/g;
  462.     var b = arguments;
  463.     return a.replace(FB.String.format._formatRE, function(e, d) {
  464.         var c = parseInt(d.substr(1), 10),f = b[c + 1];
  465.         if (f === null || f === undefined)return '';
  466.         return f.toString();
  467.     });
  468. },escapeHTML:function(b) {
  469.     var a = document.createElement('div');
  470.     a.appendChild(document.createTextNode(b));
  471.     return a.innerHTML.replace(/"/g, '&quot;').replace(/'/g, '&#39;');
  472. },quote:function(c) {
  473.     var a = /["\\\x00-\x1f\x7f-\x9f]/g,b = {'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};
  474.     return a.test(c) ? '"' + c.replace(a, function(d) {
  475.         var e = b[d];
  476.         if (e)return e;
  477.         e = d.charCodeAt();
  478.         return '\\u00' + Math.floor(e / 16).toString(16) + (e % 16).toString(16);
  479.     }) + '"' : '"' + c + '"';
  480. }});
  481. FB.provide('Dom', {containsCss:function(c, a) {
  482.     var b = ' ' + c.className + ' ';
  483.     return b.indexOf(' ' + a + ' ') >= 0;
  484. },addCss:function(b, a) {
  485.     if (!FB.Dom.containsCss(b, a))b.className = b.className + ' ' + a;
  486. },removeCss:function(b, a) {
  487.     if (FB.Dom.containsCss(b, a)) {
  488.         b.className = b.className.replace(a, '');
  489.         FB.Dom.removeCss(b, a);
  490.     }
  491. },getStyle:function(a, c) {
  492.     var d = false,b = a.style;
  493.     if (a.currentStyle) {
  494.         FB.Array.forEach(c.match(/\-([a-z])/g), function(e) {
  495.             c = c.replace(e, e.substr(1, 1).toUpperCase());
  496.         });
  497.         d = a.currentStyle[c];
  498.     } else {
  499.         FB.Array.forEach(c.match(/[A-Z]/g), function(e) {
  500.             c = c.replace(e, '-' + e.toLowerCase());
  501.         });
  502.         if (window.getComputedStyle) {
  503.             d = document.defaultView.getComputedStyle(a, null).getPropertyValue(c);
  504.             if (c == 'background-position-y' || c == 'background-position-x')if (d == 'top' || d == 'left')d = '0px';
  505.         }
  506.     }
  507.     if (c == 'opacity') {
  508.         if (a.filters && a.filters.alpha)return d;
  509.         return d * 100;
  510.     }
  511.     return d;
  512. },setStyle:function(a, c, d) {
  513.     var b = a.style;
  514.     if (c == 'opacity') {
  515.         if (d >= 100)d = 99.999;
  516.         if (d < 0)d = 0;
  517.         b.opacity = d / 100;
  518.         b.MozOpacity = d / 100;
  519.         b.KhtmlOpacity = d / 100;
  520.         if (a.filters)if (a.filters.alpha == undefined) {
  521.             a.filter = "alpha(opacity=" + d + ")";
  522.         } else a.filters.alpha.opacity = d;
  523.     } else b[c] = d;
  524. },addScript:function(b) {
  525.     var a = document.createElement('script');
  526.     a.type = "text/javascript";
  527.     a.src = b;
  528.     return document.getElementsByTagName('head')[0].appendChild(a);
  529. },addCssRules:function(e, c) {
  530.     if (!FB.Dom._cssRules)FB.Dom._cssRules = {};
  531.     var a = true;
  532.     FB.Array.forEach(c, function(f) {
  533.         if (!(f in FB.Dom._cssRules)) {
  534.             a = false;
  535.             FB.Dom._cssRules[f] = true;
  536.         }
  537.     });
  538.     if (a)return;
  539.     if (FB.Dom.getBrowserType() != 'ie') {
  540.         var d = document.createElement('style');
  541.         d.type = 'text/css';
  542.         d.textContent = e;
  543.         document.getElementsByTagName('head')[0].appendChild(d);
  544.     } else try {
  545.         document.createStyleSheet().cssText = e;
  546.     } catch(b) {
  547.         if (document.styleSheets[0])document.styleSheets[0].cssText += e;
  548.     }
  549. },getBrowserType:function() {
  550.     if (!FB.Dom._browserType) {
  551.         var d = window.navigator.userAgent.toLowerCase(),b = ['msie','firefox','safari','gecko'],c = ['ie','mozilla','safari','mozilla'];
  552.         for (var a = 0; a < b.length; a++)if (d.indexOf(b[a]) >= 0) {
  553.             FB.Dom._browserType = c[a];
  554.             break;
  555.         }
  556.     }
  557.     return FB.Dom._browserType;
  558. },getViewportInfo:function() {
  559.     var a = (document.documentElement && document.compatMode == 'CSS1Compat') ? document.documentElement : document.body;
  560.     return {scrollTop:a.scrollTop,scrollLeft:a.scrollLeft,width:self.innerWidth ? self.innerWidth : a.clientWidth,height:self.innerHeight ? self.innerHeight : a.clientHeight};
  561. },ready:function(a) {
  562.     if (FB.Dom._isReady) {
  563.         a();
  564.     } else FB.Event.subscribe('dom.ready', a);
  565. }});
  566. (function() {
  567.     function domReady() {
  568.         FB.Dom._isReady = true;
  569.         FB.Event.fire('dom.ready');
  570.         FB.Event.clear('dom.ready');
  571.     }
  572.  
  573.     if (FB.Dom._isReady || document.readyState == 'complete')return domReady();
  574.     if (document.addEventListener) {
  575.         document.addEventListener('DOMContentLoaded', domReady, false);
  576.     } else if (document.attachEvent)document.attachEvent('onreadystatechange', domReady);
  577.     if (FB.Dom.getBrowserType() == 'ie' && window === top)(function() {
  578.         try {
  579.             document.documentElement.doScroll('left');
  580.         } catch(error) {
  581.             setTimeout(arguments.callee, 0);
  582.             return;
  583.         }
  584.         domReady();
  585.     })();
  586.     var oldonload = window.onload;
  587.     window.onload = function() {
  588.         domReady();
  589.         if (oldonload)if (typeof oldonload == 'string') {
  590.             eval(oldonload);
  591.         } else oldonload();
  592.     };
  593. })();
  594. FB.provide('Dialog', {_loaderEl:null,_stack:[],_active:null,_findRoot:function(a) {
  595.     while (a) {
  596.         if (FB.Dom.containsCss(a, 'fb_dialog'))return a;
  597.         a = a.parentNode;
  598.     }
  599. },_showLoader:function(a, c) {
  600.     if (!FB.Dialog._loaderEl) {
  601.         c = parseInt(c, 10);
  602.         c = c ? c : 460;
  603.         FB.Dialog._loaderEl = FB.Dialog._findRoot(FB.Dialog.create({content:('<div class="dialog_title">' + '  <a id="fb_dialog_loader_close">' + '    <div class="fb_dialog_close_icon"></div>' + '  </a>' + '  <span>Facebook</span>' + '  <div style="clear:both;"></div>' + '</div>' + '<div class="dialog_content"></div>' + '<div class="dialog_footer"></div>'),width:c}));
  604.     }
  605.     if (!a)a = function() {
  606.     };
  607.     var b = FB.$('fb_dialog_loader_close');
  608.     FB.Dom.removeCss(b, 'fb_hidden');
  609.     b.onclick = function() {
  610.         FB.Dialog._hideLoader();
  611.         a();
  612.     };
  613.     FB.Dialog._makeActive(FB.Dialog._loaderEl);
  614. },_hideLoader:function() {
  615.     if (FB.Dialog._loaderEl && FB.Dialog._loaderEl == FB.Dialog._active)FB.Dialog._loaderEl.style.top = '-10000px';
  616. },_makeActive:function(b) {
  617.     FB.Dialog._lowerActive();
  618.     var a = {width:parseInt(b.offsetWidth, 10),height:parseInt(b.offsetHeight, 10)},e = FB.Dom.getViewportInfo(),c = (e.scrollLeft + (e.width - a.width) / 2),d = (e.scrollTop + (e.height - a.height) / 2.5);
  619.     b.style.left = (c > 0 ? c : 0) + 'px';
  620.     b.style.top = (d > 0 ? d : 0) + 'px';
  621.     FB.Dialog._active = b;
  622. },_lowerActive:function() {
  623.     if (!FB.Dialog._active)return;
  624.     FB.Dialog._active.style.top = '-10000px';
  625.     FB.Dialog._active = null;
  626. },_removeStacked:function(a) {
  627.     FB.Dialog._stack = FB.Array.filter(FB.Dialog._stack, function(b) {
  628.         return b != a;
  629.     });
  630. },create:function(e) {
  631.     e = e || {};
  632.     if (e.loader)FB.Dialog._showLoader(e.onClose, e.loaderWidth);
  633.     var d = document.createElement('div'),c = document.createElement('div'),a = 'fb_dialog';
  634.     if (e.closeIcon && e.onClose) {
  635.         var b = document.createElement('a');
  636.         b.className = 'fb_dialog_close_icon';
  637.         b.onclick = e.onClose;
  638.         d.appendChild(b);
  639.     }
  640.     if (FB.Dom.getBrowserType() == 'ie') {
  641.         a += ' fb_dialog_legacy';
  642.         FB.Array.forEach(['vert_left','vert_right','horiz_top','horiz_bottom','top_left','top_right','bottom_left','bottom_right'], function(g) {
  643.             var h = document.createElement('span');
  644.             h.className = 'fb_dialog_' + g;
  645.             d.appendChild(h);
  646.         });
  647.     } else a += ' fb_dialog_advanced';
  648.     if (e.content)FB.Content.append(e.content, c);
  649.     d.className = a;
  650.     var f = parseInt(e.width, 10);
  651.     if (!isNaN(f))d.style.width = f + 'px';
  652.     c.className = 'fb_dialog_content';
  653.     d.appendChild(c);
  654.     FB.Content.append(d);
  655.     if (e.visible)FB.Dialog.show(d);
  656.     return c;
  657. },show:function(a) {
  658.     a = FB.Dialog._findRoot(a);
  659.     if (a) {
  660.         FB.Dialog._removeStacked(a);
  661.         FB.Dialog._hideLoader();
  662.         FB.Dialog._makeActive(a);
  663.         FB.Dialog._stack.push(a);
  664.     }
  665. },remove:function(a) {
  666.     a = FB.Dialog._findRoot(a);
  667.     if (a) {
  668.         var b = FB.Dialog._active == a;
  669.         FB.Dialog._removeStacked(a);
  670.         FB.Dialog._hideLoader();
  671.         if (b)if (FB.Dialog._stack.length > 0) {
  672.             FB.Dialog.show(FB.Dialog._stack.pop());
  673.         } else FB.Dialog._lowerActive();
  674.         window.setTimeout(function() {
  675.             a.parentNode.removeChild(a);
  676.         }, 3000);
  677.     }
  678. }});
  679. FB.provide('XD', {_origin:null,_transport:null,_callbacks:{},_forever:{},init:function(a) {
  680.     if (FB.XD._origin)return;
  681.     if (window.addEventListener && !window.attachEvent && window.postMessage) {
  682.         FB.XD._origin = (window.location.protocol + '//' + window.location.host + '/' + FB.guid());
  683.         FB.XD.PostMessage.init();
  684.         FB.XD._transport = 'postmessage';
  685.     } else if (!a && FB.Flash.hasMinVersion()) {
  686.         FB.XD._origin = (window.location.protocol + '//' + document.domain + '/' + FB.guid());
  687.         FB.XD.Flash.init();
  688.         FB.XD._transport = 'flash';
  689.     } else {
  690.         FB.XD._transport = 'fragment';
  691.         FB.XD.Fragment._channelUrl = a || window.location.toString();
  692.     }
  693. },resolveRelation:function(b) {
  694.     var g,d,f = b.split('.'),e = window;
  695.     for (var a = 0,c = f.length; a < c; a++) {
  696.         g = f[a];
  697.         if (g === 'opener' || g === 'parent' || g === 'top') {
  698.             e = e[g];
  699.         } else if (d = /^frames\[['"]?([a-zA-Z0-9-_]+)['"]?\]$/.exec(g)) {
  700.             e = e.frames[d[1]];
  701.         } else throw new SyntaxError('Malformed id to resolve: ' + b + ', pt: ' + g);
  702.     }
  703.     return e;
  704. },handler:function(a, e, b) {
  705.     if (window.location.toString().indexOf(FB.XD.Fragment._magic) > 0)return 'javascript:false;//';
  706.     var f = FB.getDomain('cdn') + 'connect/xd_proxy.php#',c = FB.guid();
  707.     if (FB.XD._transport == 'fragment') {
  708.         f = FB.XD.Fragment._channelUrl;
  709.         var d = f.indexOf('#');
  710.         if (d > 0)f = f.substr(0, d);
  711.         f += ((f.indexOf('?') < 0 ? '?' : '&') + FB.XD.Fragment._magic + '#?=&');
  712.     }
  713.     if (b)FB.XD._forever[c] = true;
  714.     FB.XD._callbacks[c] = a;
  715.     return f + FB.QS.encode({cb:c,origin:FB.XD._origin,relation:e || 'opener',transport:FB.XD._transport});
  716. },recv:function(b) {
  717.     if (typeof b == 'string')b = FB.QS.decode(b);
  718.     var a = FB.XD._callbacks[b.cb];
  719.     if (!FB.XD._forever[b.cb])delete FB.XD._callbacks[b.cb];
  720.     a && a(b);
  721. },PostMessage:{init:function() {
  722.     var a = FB.XD.PostMessage.onMessage;
  723.     window.addEventListener ? window.addEventListener('message', a, false) : window.attachEvent('onmessage', a);
  724. },onMessage:function(event) {
  725.     FB.XD.recv(event.data);
  726. }},Flash:{init:function() {
  727.     FB.Flash.onReady(function() {
  728.         document.XdComm.postMessage_init('FB.XD.Flash.onMessage', FB.XD._origin);
  729.     });
  730. },onMessage:function(a) {
  731.     FB.XD.recv(decodeURIComponent(a));
  732. }},Fragment:{_magic:'fb_xd_fragment',checkAndDispatch:function() {
  733.     var b = window.location.toString(),a = b.substr(b.indexOf('#') + 1),c = b.indexOf(FB.XD.Fragment._magic);
  734.     if (c > 0) {
  735.         FB.init = FB.getLoginStatus = FB.api = function() {
  736.         };
  737.         document.documentElement.style.display = 'none';
  738.         FB.XD.resolveRelation(FB.QS.decode(a).relation).FB.XD.recv(a);
  739.     }
  740. }}});
  741. FB.XD.Fragment.checkAndDispatch();
  742. FB.provide('Arbiter', {inform:function(c, e, f, b) {
  743.     if (window.name.indexOf('app_runner_') === 0) {
  744.         var d = FB.JSON.stringify({method:c,params:e});
  745.         if (window.postMessage) {
  746.             FB.XD.resolveRelation(f || 'parent').postMessage(d, '*');
  747.             return;
  748.         } else try {
  749.             window.opener.postMessage(d);
  750.             return;
  751.         } catch(a) {
  752.         }
  753.     }
  754.     var h = (FB.getDomain((b ? 'https_' : '') + 'staticfb') + 'connect/canvas_proxy.php#' + FB.QS.encode({method:c,params:FB.JSON.stringify(e || {}),relation:f}));
  755.     var g = FB.Content.appendHidden('');
  756.     FB.Content.insertIframe({url:h,root:g,width:1,height:1,onload:function() {
  757.         setTimeout(function() {
  758.             g.parentNode.removeChild(g);
  759.         }, 10);
  760.     }});
  761. }});
  762. FB.provide('', {ui:function(e, b) {
  763.     if (!e.method) {
  764.         FB.log('"method" is a required parameter for FB.ui().');
  765.         return;
  766.     }
  767.     var a = FB.UIServer.prepareCall(e, b);
  768.     if (!a)return;
  769.     var d = a.params.display;
  770.     if (d == 'dialog')d = 'iframe';
  771.     var c = FB.UIServer[d];
  772.     if (!c) {
  773.         FB.log('"display" must be one of "popup", "iframe" or "hidden".');
  774.         return;
  775.     }
  776.     c(a);
  777. }});
  778. FB.provide('UIServer', {Methods:{},_active:{},_defaultCb:{},_resultToken:'"xxRESULTTOKENxx"',genericTransform:function(a) {
  779.     if (a.params.display == 'dialog' || a.params.display == 'iframe') {
  780.         a.params.display = 'iframe';
  781.         a.params.channel = FB.UIServer._xdChannelHandler(a.id, 'parent.parent');
  782.     }
  783.     return a;
  784. },prepareCall:function(h, b) {
  785.     var g = h.method.toLowerCase(),f = FB.UIServer.Methods[g] || {size:{width:575,height:240}},e = FB.guid(),d = FB._https || (g !== 'auth.status');
  786.     FB.copy(h, {api_key:FB._apiKey,app_id:FB._apiKey,locale:FB._locale,sdk:'joey',access_token:d && FB._session && FB._session.access_token || undefined});
  787.     h.display = FB.UIServer.getDisplayMode(f, h);
  788.     if (!f.url) {
  789.         f.url = 'dialog/' + g;
  790.         delete h.method;
  791.     }
  792.     var a = {cb:b,id:e,size:f.size || {},url:FB.getDomain(d ? 'https_www' : 'www') + f.url,params:h};
  793.     var j = f.transform ? f.transform : FB.UIServer.genericTransform;
  794.     if (j) {
  795.         a = j(a);
  796.         if (!a)return;
  797.     }
  798.     var i = FB.UIServer.getXdRelation(a.params.display);
  799.     if (!(a.id in FB.UIServer._defaultCb) && !('next' in a.params))a.params.next = FB.UIServer._xdResult(a.cb, a.id, i, true);
  800.     if (i === 'parent')a.params.channel_url = FB.UIServer._xdChannelHandler(e, 'parent.parent');
  801.     a.params = FB.JSON.flatten(a.params);
  802.     var c = FB.QS.encode(a.params);
  803.     if ((a.url + c).length > 2000) {
  804.         a.post = true;
  805.     } else if (c)a.url += '?' + c;
  806.     return a;
  807. },getDisplayMode:function(a, b) {
  808.     if (b.display === 'hidden')return 'hidden';
  809.     if (window.name.indexOf('app_runner_') === 0)return 'async';
  810.     if (!FB._session && b.display == 'dialog' && !a.loggedOutIframe) {
  811.         FB.log('"dialog" mode can only be used when the user is connected.');
  812.         return 'popup';
  813.     }
  814.     return b.display || (FB._session ? 'dialog' : 'popup');
  815. },getXdRelation:function(a) {
  816.     if (a === 'popup')return 'opener';
  817.     if (a === 'dialog' || a === 'iframe')return 'parent';
  818.     if (a === 'async')return 'parent.frames[' + window.name + ']';
  819. },popup:function(b) {
  820.     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 = b.size.width,d = 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 = ('width=' + k + ',height=' + d + ',left=' + e + ',top=' + j + ',scrollbars=1');
  821.     if (b.params.method == 'permissions.request')c += ',location=1,toolbar=0';
  822.     if (b.post) {
  823.         FB.UIServer._active[b.id] = window.open('about:blank', b.id, c);
  824.         FB.Content.postTarget({url:b.url,target:b.id,params:b.params});
  825.     } else FB.UIServer._active[b.id] = window.open(b.url, b.id, c);
  826.     if (b.id in FB.UIServer._defaultCb)FB.UIServer._popupMonitor();
  827. },hidden:function(a) {
  828.     a.className = 'FB_UI_Hidden';
  829.     a.root = FB.Content.appendHidden('');
  830.     FB.UIServer._insertIframe(a);
  831. },iframe:function(a) {
  832.     a.className = 'FB_UI_Dialog';
  833.     a.root = FB.Dialog.create({onClose:function() {
  834.         FB.UIServer._triggerDefault(a.id);
  835.     },loader:true,loaderWidth:a.size.width,closeIcon:true});
  836.     FB.Dom.addCss(a.root, 'fb_dialog_iframe');
  837.     FB.UIServer._insertIframe(a);
  838. },async:function(a) {
  839.     a.frame = window.name;
  840.     delete a.url;
  841.     delete a.size;
  842.     FB.Arbiter.inform('showDialog', a);
  843. },_insertIframe:function(b) {
  844.     FB.UIServer._active[b.id] = false;
  845.     var a = function(c) {
  846.         if (b.id in FB.UIServer._active)FB.UIServer._active[b.id] = c;
  847.     };
  848.     if (b.post) {
  849.         FB.Content.insertIframe({url:'about:blank',root:b.root,className:b.className,width:b.size.width,height:b.size.height,onload:function(c) {
  850.             a(c);
  851.             FB.Content.postTarget({url:b.url,target:c.name,params:b.params});
  852.         }});
  853.     } else FB.Content.insertIframe({url:b.url,root:b.root,className:b.className,width:b.size.width,height:b.size.height,onload:a});
  854. },_triggerDefault:function(a) {
  855.     FB.UIServer._xdRecv({frame:a}, FB.UIServer._defaultCb[a] || function() {
  856.     });
  857. },_popupMonitor:function() {
  858.     var a;
  859.     for (var b in FB.UIServer._active)if (FB.UIServer._active.hasOwnProperty(b) && b in FB.UIServer._defaultCb) {
  860.         var c = FB.UIServer._active[b];
  861.         try {
  862.             if (c.tagName)continue;
  863.         } catch(d) {
  864.         }
  865.         try {
  866.             if (c.closed) {
  867.                 FB.UIServer._triggerDefault(b);
  868.             } else a = true;
  869.         } catch(e) {
  870.         }
  871.     }
  872.     if (a && !FB.UIServer._popupInterval) {
  873.         FB.UIServer._popupInterval = window.setInterval(FB.UIServer._popupMonitor, 100);
  874.     } else if (!a && FB.UIServer._popupInterval) {
  875.         window.clearInterval(FB.UIServer._popupInterval);
  876.         FB.UIServer._popupInterval = null;
  877.     }
  878. },_xdChannelHandler:function(a, b) {
  879.     return FB.XD.handler(function(c) {
  880.         var d = FB.UIServer._active[a];
  881.         if (!d)return;
  882.         if (c.type == 'resize') {
  883.             if (c.height)d.style.height = c.height + 'px';
  884.             if (c.width)d.style.width = c.width + 'px';
  885.             FB.Arbiter.inform('resize.ack', {}, 'parent.frames[' + d.name + ']', true);
  886.             FB.Dialog.show(d);
  887.         }
  888.     }, b, true);
  889. },_xdNextHandler:function(a, b, d, c) {
  890.     if (c)FB.UIServer._defaultCb[b] = a;
  891.     return FB.XD.handler(function(e) {
  892.         FB.UIServer._xdRecv(e, a);
  893.     }, d) + '&frame=' + b;
  894. },_xdRecv:function(b, a) {
  895.     var c = FB.UIServer._active[b.frame];
  896.     try {
  897.         if (FB.Dom.containsCss(c, 'FB_UI_Hidden')) {
  898.             window.setTimeout(function() {
  899.                 c.parentNode.parentNode.removeChild(c.parentNode);
  900.             }, 3000);
  901.         } else if (FB.Dom.containsCss(c, 'FB_UI_Dialog'))FB.Dialog.remove(c);
  902.     } catch(d) {
  903.     }
  904.     try {
  905.         if (c.close) {
  906.             c.close();
  907.             FB.UIServer._popupCount--;
  908.         }
  909.     } catch(e) {
  910.     }
  911.     delete FB.UIServer._active[b.frame];
  912.     delete FB.UIServer._defaultCb[b.frame];
  913.     a(b);
  914. },_xdResult:function(a, b, d, c) {
  915.     return (FB.UIServer._xdNextHandler(function(e) {
  916.         a && a(e.result && e.result != FB.UIServer._resultToken && FB.JSON.parse(e.result));
  917.     }, b, d, c) + '&result=' + encodeURIComponent(FB.UIServer._resultToken));
  918. }});
  919. FB.provide('', {getLoginStatus:function(a, b) {
  920.     if (!FB._apiKey) {
  921.         FB.log('FB.getLoginStatus() called before calling FB.init().');
  922.         return;
  923.     }
  924.     if (a)if (!b && FB.Auth._loadState == 'loaded') {
  925.         a({status:FB._userStatus,session:FB._session});
  926.         return;
  927.     } else FB.Event.subscribe('FB.loginStatus', a);
  928.     if (!b && FB.Auth._loadState == 'loading')return;
  929.     FB.Auth._loadState = 'loading';
  930.     var c = function(d) {
  931.         FB.Auth._loadState = 'loaded';
  932.         FB.Event.fire('FB.loginStatus', d);
  933.         FB.Event.clear('FB.loginStatus');
  934.     };
  935.     FB.ui({method:'auth.status',display:'hidden'}, c);
  936. },getSession:function() {
  937.     return FB._session;
  938. },login:function(a, b) {
  939.     FB.ui(FB.copy({method:'permissions.request',display:'popup'}, b || {}), a);
  940. },logout:function(a) {
  941.     FB.ui({method:'auth.logout',display:'hidden'}, a);
  942. }});
  943. FB.provide('Auth', {_callbacks:[],setSession:function(e, g) {
  944.     var b = !FB._session && e,c = FB._session && !e,a = FB._session && e && FB._session.uid != e.uid,f = b || c || (FB._session && e && FB._session.access_token != e.access_token),h = g != FB._userStatus;
  945.     var d = {session:e,status:g};
  946.     FB._session = e;
  947.     FB._userStatus = g;
  948.     if (f && FB.Cookie && FB.Cookie.getEnabled())FB.Cookie.set(e);
  949.     if (h)FB.Event.fire('auth.statusChange', d);
  950.     if (c || a)FB.Event.fire('auth.logout', d);
  951.     if (b || a)FB.Event.fire('auth.login', d);
  952.     if (f)FB.Event.fire('auth.sessionChange', d);
  953.     if (FB.Auth._refreshTimer) {
  954.         window.clearTimeout(FB.Auth._refreshTimer);
  955.         delete FB.Auth._refreshTimer;
  956.     }
  957.     if (FB.Auth._loadState && e && e.expires)FB.Auth._refreshTimer = window.setTimeout(function() {
  958.         FB.getLoginStatus(null, true);
  959.     }, 1200000);
  960.     return d;
  961. },xdHandler:function(a, b, f, c, e, d) {
  962.     return FB.UIServer._xdNextHandler(FB.Auth.xdResponseWrapper(a, e, d), b, f, c);
  963. },xdResponseWrapper:function(a, c, b) {
  964.     return function(d) {
  965.         try {
  966.             b = FB.JSON.parse(d.session);
  967.         } catch(f) {
  968.         }
  969.         if (b)c = 'connected';
  970.         if (d.fb_https && !FB._https)FB._https = true;
  971.         var e = FB.Auth.setSession(b || null, c);
  972.         e.perms = d && d.perms || null;
  973.         a && a(e);
  974.     };
  975. }});
  976. FB.provide('UIServer.Methods', {'permissions.request':{size:{width:627,height:326},transform:function(a) {
  977.     if (!FB._apiKey) {
  978.         FB.log('FB.login() called before calling FB.init().');
  979.         return;
  980.     }
  981.     if (FB._session && !a.params.perms) {
  982.         FB.log('FB.login() called when user is already connected.');
  983.         a.cb && a.cb({status:FB._userStatus,session:FB._session});
  984.         return;
  985.     }
  986.     a = FB.UIServer.genericTransform(a);
  987.     a.cb = FB.Auth.xdResponseWrapper(a.cb, FB._userStatus, FB._session);
  988.     a.params.method = 'permissions.request';
  989.     FB.copy(a.params, {fbconnect:FB._inCanvas ? 0 : 1,return_session:1,session_version:3});
  990.     return a;
  991. }},'auth.logout':{url:'logout.php',transform:function(a) {
  992.     if (!FB._apiKey) {
  993.         FB.log('FB.logout() called before calling FB.init().');
  994.     } else if (!FB._session) {
  995.         FB.log('FB.logout() called without a session.');
  996.     } else {
  997.         a.params.next = FB.Auth.xdHandler(a.cb, a.id, 'parent', false, 'unknown');
  998.         return a;
  999.     }
  1000. }},'auth.status':{url:'extern/login_status.php',transform:function(a) {
  1001.     var b = a.cb,c = a.id,d = FB.Auth.xdHandler;
  1002.     delete a.cb;
  1003.     FB.copy(a.params, {no_session:d(b, c, 'parent', false, 'notConnected'),no_user:d(b, c, 'parent', false, 'unknown'),ok_session:d(b, c, 'parent', false, 'connected'),session_version:3,extern:FB._inCanvas ? 0 : 2});
  1004.     return a;
  1005. }}});
  1006. FB.provide('Canvas', {_timer:null,_lastSize:{},setSize:function(b) {
  1007.     if (typeof b != "object")b = {};
  1008.     b = FB.copy(b || {}, FB.Canvas._computeContentSize());
  1009.     b = FB.copy(b, {frame:window.name || 'iframe_canvas'});
  1010.     if (FB.Canvas._lastSize[b.frame]) {
  1011.         var a = FB.Canvas._lastSize[b.frame].height;
  1012.         if (FB.Canvas._lastSize[b.frame].width == b.width && (b.height <= a && (a - b.height <= 16)))return false;
  1013.     }
  1014.     FB.Canvas._lastSize[b.frame] = b;
  1015.     FB.Arbiter.inform('setSize', b);
  1016.     return true;
  1017. },setAutoResize:function(b, a) {
  1018.     if (a === undefined && typeof b == "number") {
  1019.         a = b;
  1020.         b = true;
  1021.     }
  1022.     if (b === undefined || b) {
  1023.         if (FB.Canvas._timer === null)FB.Canvas._timer = window.setInterval(FB.Canvas.setSize, a || 100);
  1024.         FB.Canvas.setSize();
  1025.     } else if (FB.Canvas._timer !== null) {
  1026.         window.clearInterval(FB.Canvas._timer);
  1027.         FB.Canvas._timer = null;
  1028.     }
  1029. },_computeContentSize:function() {
  1030.     var a = document.body,c = document.documentElement,d = 0,b = Math.max(Math.max(a.offsetHeight, a.scrollHeight) + a.offsetTop, Math.max(c.offsetHeight, c.scrollHeight) + c.offsetTop);
  1031.     if (a.offsetWidth < a.scrollWidth) {
  1032.         d = a.scrollWidth + a.offsetLeft;
  1033.     } else FB.Array.forEach(a.childNodes, function(e) {
  1034.         var f = e.offsetWidth + e.offsetLeft;
  1035.         if (f > d)d = f;
  1036.     });
  1037.     if (c.clientLeft > 0)d += (c.clientLeft * 2);
  1038.     if (c.clientTop > 0)b += (c.clientTop * 2);
  1039.     return {height:b,width:d};
  1040. }});
  1041. FB.provide('UIServer.Methods', {'stream.share':{size:{width:575,height:380},url:'sharer.php',transform:function(a) {
  1042.     if (!a.params.u)a.params.u = window.location.toString();
  1043.     return a;
  1044. }},'fbml.dialog':{size:{width:575,height:300},url:'render_fbml.php',loggedOutIframe:true,transform:function(a) {
  1045.     return a;
  1046. }},'auth.logintofacebook':{size:{width:530,height:287},url:'login.php',transform:function(a) {
  1047.     a.params.skip_api_login = 1;
  1048.     var c = FB.UIServer.getXdRelation(a.params.display);
  1049.     var b = FB.UIServer._xdResult(a.cb, a.id, c, true);
  1050.     a.params.next = FB.getDomain(FB._https ? 'https_www' : 'www') + "login.php?" + FB.QS.encode({api_key:FB._apiKey,next:b,skip_api_login:1});
  1051.     return a;
  1052. }}});
  1053. FB.provide('', {share:function(a) {
  1054.     FB.log('FB.share() has been deprecated. Please use FB.ui() instead.');
  1055.     FB.ui({display:'popup',method:'stream.share',u:a});
  1056. },publish:function(b, a) {
  1057.     FB.log('FB.publish() has been deprecated. Please use FB.ui() instead.');
  1058.     b = b || {};
  1059.     FB.ui(FB.copy({display:'popup',method:'stream.publish',preview:1}, b || {}), a);
  1060. },addFriend:function(b, a) {
  1061.     FB.log('FB.addFriend() has been deprecated. Please use FB.ui() instead.');
  1062.     FB.ui({display:'popup',id:b,method:'friend.add'}, a);
  1063. }});
  1064. FB.UIServer.Methods['auth.login'] = FB.UIServer.Methods['permissions.request'];
  1065. FB.provide('XFBML', {_renderTimeout:30000,parse:function(c, a) {
  1066.     c = c || document.body;
  1067.     var b = 1,d = function() {
  1068.         b--;
  1069.         if (b === 0) {
  1070.             a && a();
  1071.             FB.Event.fire('xfbml.render');
  1072.         }
  1073.     };
  1074.     FB.Array.forEach(FB.XFBML._tagInfos, function(f) {
  1075.         if (!f.xmlns)f.xmlns = 'fb';
  1076.         var g = FB.XFBML._getDomElements(c, f.xmlns, f.localName);
  1077.         for (var e = 0; e < g.length; e++) {
  1078.             b++;
  1079.             FB.XFBML._processElement(g[e], f, d);
  1080.         }
  1081.     });
  1082.     window.setTimeout(function() {
  1083.         if (b > 0)FB.log(b + ' XFBML tags failed to render in ' + FB.XFBML._renderTimeout + 'ms.');
  1084.     }, FB.XFBML._renderTimeout);
  1085.     d();
  1086. },registerTag:function(a) {
  1087.     FB.XFBML._tagInfos.push(a);
  1088. },_processElement:function(dom, tagInfo, cb) {
  1089.     var element = dom._element;
  1090.     if (element) {
  1091.         element.subscribe('render', cb);
  1092.         element.process();
  1093.     } else {
  1094.         var processor = function() {
  1095.             var fn = eval(tagInfo.className);
  1096.             var getBoolAttr = function(attr) {
  1097.                 var attr = dom.getAttribute(attr);
  1098.                 return (attr && FB.Array.indexOf(['true','1','yes','on'], attr.toLowerCase()) > -1);
  1099.             };
  1100.             var isLogin = false;
  1101.             var showFaces = true;
  1102.             var renderInIframe = false;
  1103.             if (tagInfo.className === 'FB.XFBML.LoginButton') {
  1104.                 renderInIframe = getBoolAttr('render-in-iframe');
  1105.                 showFaces = getBoolAttr('show-faces') || getBoolAttr('show_faces');
  1106.                 isLogin = renderInIframe || showFaces;
  1107.                 if (isLogin)fn = FB.XFBML.Login;
  1108.             }
  1109.             element = dom._element = new fn(dom);
  1110.             if (isLogin) {
  1111.                 var extraParams = {show_faces:showFaces};
  1112.                 var perms = dom.getAttribute('perms');
  1113.                 if (perms)extraParams.perms = perms;
  1114.                 element.setExtraParams(extraParams);
  1115.             }
  1116.             element.subscribe('render', cb);
  1117.             element.process();
  1118.         };
  1119.         if (FB.CLASSES[tagInfo.className.substr(3)]) {
  1120.             processor();
  1121.         } else FB.log('Tag ' + tagInfo.className + ' was not found.');
  1122.     }
  1123. },_getDomElements:function(a, e, d) {
  1124.     var c = e + ':' + d;
  1125.     switch (FB.Dom.getBrowserType()) {case 'mozilla':return a.getElementsByTagNameNS(document.body.namespaceURI, c);case 'ie':try {
  1126.         var docNamespaces = document.namespaces;
  1127.         if (docNamespaces && docNamespaces[e]) {
  1128.             var nodes = a.getElementsByTagName(d);
  1129.             if (!document.addEventListener || nodes.length > 0)return nodes;
  1130.         }
  1131.     } catch(b) {
  1132.     }return a.getElementsByTagName(c);default:return a.getElementsByTagName(c);
  1133.     }
  1134. },_tagInfos:[
  1135.     {localName:'activity',className:'FB.XFBML.Activity'},
  1136.     {localName:'add-profile-tab',className:'FB.XFBML.AddProfileTab'},
  1137.     {localName:'bookmark',className:'FB.XFBML.Bookmark'},
  1138.     {localName:'comments',className:'FB.XFBML.Comments'},
  1139.     {localName:'connect-bar',className:'FB.XFBML.ConnectBar'},
  1140.     {localName:'fan',className:'FB.XFBML.Fan'},
  1141.     {localName:'like',className:'FB.XFBML.Like'},
  1142.     {localName:'like-box',className:'FB.XFBML.LikeBox'},
  1143.     {localName:'live-stream',className:'FB.XFBML.LiveStream'},
  1144.     {localName:'login',className:'FB.XFBML.Login'},
  1145.     {localName:'login-button',className:'FB.XFBML.LoginButton'},
  1146.     {localName:'facepile',className:'FB.XFBML.Facepile'},
  1147.     {localName:'friendpile',className:'FB.XFBML.Friendpile'},
  1148.     {localName:'name',className:'FB.XFBML.Name'},
  1149.     {localName:'profile-pic',className:'FB.XFBML.ProfilePic'},
  1150.     {localName:'recommendations',className:'FB.XFBML.Recommendations'},
  1151.     {localName:'registration',className:'FB.XFBML.Registration'},
  1152.     {localName:'send',className:'FB.XFBML.Send'},
  1153.     {localName:'serverfbml',className:'FB.XFBML.ServerFbml'},
  1154.     {localName:'share-button',className:'FB.XFBML.ShareButton'},
  1155.     {localName:'social-bar',className:'FB.XFBML.SocialBar'}
  1156. ]});
  1157. (function() {
  1158.     try {
  1159.         if (document.namespaces && !document.namespaces.item.fb)document.namespaces.add('fb');
  1160.     } catch(a) {
  1161.     }
  1162. }());
  1163. FB.provide('XFBML', {set:function(b, c, a) {
  1164.     FB.log('FB.XFBML.set() has been deprecated.');
  1165.     b.innerHTML = c;
  1166.     FB.XFBML.parse(b, a);
  1167. }});
  1168. FB.provide('', {bind:function() {
  1169.     var a = Array.prototype.slice.call(arguments),c = a.shift(),b = a.shift();
  1170.     return function() {
  1171.         return c.apply(b, a.concat(Array.prototype.slice.call(arguments)));
  1172.     };
  1173. },Class:function(b, a, d) {
  1174.     if (FB.CLASSES[b])return FB.CLASSES[b];
  1175.     var c = a || function() {
  1176.     };
  1177.     c.prototype = d;
  1178.     c.prototype.bind = function(e) {
  1179.         return FB.bind(e, this);
  1180.     };
  1181.     c.prototype.constructor = c;
  1182.     FB.create(b, c);
  1183.     FB.CLASSES[b] = c;
  1184.     return c;
  1185. },subclass:function(d, b, c, e) {
  1186.     if (FB.CLASSES[d])return FB.CLASSES[d];
  1187.     var a = FB.create(b);
  1188.     FB.copy(e, a.prototype);
  1189.     e._base = a;
  1190.     e._callBase = function(g) {
  1191.         var f = Array.prototype.slice.call(arguments, 1);
  1192.         return a.prototype[g].apply(this, f);
  1193.     };
  1194.     return FB.Class(d, c ? c : function() {
  1195.         if (a.apply)a.apply(this, arguments);
  1196.     }, e);
  1197. },CLASSES:{}});
  1198. FB.provide('Type', {isType:function(a, b) {
  1199.     while (a)if (a.constructor === b || a === b) {
  1200.         return true;
  1201.     } else a = a._base;
  1202.     return false;
  1203. }});
  1204. FB.Class('Obj', null, FB.copy({setProperty:function(a, b) {
  1205.     if (FB.JSON.stringify(b) != FB.JSON.stringify(this[a])) {
  1206.         this[a] = b;
  1207.         this.fire(a, b);
  1208.     }
  1209. }}, FB.EventProvider));
  1210. FB.subclass('Waitable', 'Obj', function() {
  1211. }, {set:function(a) {
  1212.     this.setProperty('value', a);
  1213. },error:function(a) {
  1214.     this.fire("error", a);
  1215. },wait:function(a, b) {
  1216.     if (b)this.subscribe('error', b);
  1217.     this.monitor('value', this.bind(function() {
  1218.         if (this.value !== undefined) {
  1219.             a(this.value);
  1220.             return true;
  1221.         }
  1222.     }));
  1223. }});
  1224. FB.subclass('Data.Query', 'Waitable', function() {
  1225.     if (!FB.Data.Query._c)FB.Data.Query._c = 1;
  1226.     this.name = 'v_' + FB.Data.Query._c++;
  1227. }, {parse:function(a) {
  1228.     var b = FB.String.format.apply(null, a),d = (/^select (.*?) from (\w+)\s+where (.*)$/i).exec(b);
  1229.     this.fields = this._toFields(d[1]);
  1230.     this.table = d[2];
  1231.     this.where = this._parseWhere(d[3]);
  1232.     for (var c = 1; c < a.length; c++)if (FB.Type.isType(a[c], FB.Data.Query))a[c].hasDependency = true;
  1233.     return this;
  1234. },toFql:function() {
  1235.     var a = 'select ' + this.fields.join(',') + ' from ' + this.table + ' where ';
  1236.     switch (this.where.type) {case 'unknown':a += this.where.value;break;case 'index':a += this.where.key + '=' + this._encode(this.where.value);break;case 'in':if (this.where.value.length == 1) {
  1237.         a += this.where.key + '=' + this._encode(this.where.value[0]);
  1238.     } else a += this.where.key + ' in (' + FB.Array.map(this.where.value, this._encode).join(',') + ')';break;
  1239.     }
  1240.     return a;
  1241. },_encode:function(a) {
  1242.     return typeof(a) == 'string' ? FB.String.quote(a) : a;
  1243. },toString:function() {
  1244.     return '#' + this.name;
  1245. },_toFields:function(a) {
  1246.     return FB.Array.map(a.split(','), FB.String.trim);
  1247. },_parseWhere:function(s) {
  1248.     var re = (/^\s*(\w+)\s*=\s*(.*)\s*$/i).exec(s),result,value,type = 'unknown';
  1249.     if (re) {
  1250.         value = re[2];
  1251.         if (/^(["'])(?:\\?.)*?\1$/.test(value)) {
  1252.             value = eval(value);
  1253.             type = 'index';
  1254.         } else if (/^\d+\.?\d*$/.test(value))type = 'index';
  1255.     }
  1256.     if (type == 'index') {
  1257.         result = {type:'index',key:re[1],value:value};
  1258.     } else result = {type:'unknown',value:s};
  1259.     return result;
  1260. }});
  1261. FB.provide('Data', {query:function(c, a) {
  1262.     var b = new FB.Data.Query().parse(arguments);
  1263.     FB.Data.queue.push(b);
  1264.     FB.Data._waitToProcess();
  1265.     return b;
  1266. },waitOn:function(dependencies, callback) {
  1267.     var result = new FB.Waitable(),count = dependencies.length;
  1268.     if (typeof(callback) == 'string') {
  1269.         var s = callback;
  1270.         callback = function(args) {
  1271.             return eval(s);
  1272.         };
  1273.     }
  1274.     FB.Array.forEach(dependencies, function(item) {
  1275.         item.monitor('value', function() {
  1276.             var done = false;
  1277.             if (FB.Data._getValue(item) !== undefined) {
  1278.                 count--;
  1279.                 done = true;
  1280.             }
  1281.             if (count === 0) {
  1282.                 var value = callback(FB.Array.map(dependencies, FB.Data._getValue));
  1283.                 result.set(value !== undefined ? value : true);
  1284.             }
  1285.             return done;
  1286.         });
  1287.     });
  1288.     return result;
  1289. },_getValue:function(a) {
  1290.     return FB.Type.isType(a, FB.Waitable) ? a.value : a;
  1291. },_selectByIndex:function(a, d, b, e) {
  1292.     var c = new FB.Data.Query();
  1293.     c.fields = a;
  1294.     c.table = d;
  1295.     c.where = {type:'index',key:b,value:e};
  1296.     FB.Data.queue.push(c);
  1297.     FB.Data._waitToProcess();
  1298.     return c;
  1299. },_waitToProcess:function() {
  1300.     if (FB.Data.timer < 0)FB.Data.timer = setTimeout(FB.Data._process, 10);
  1301. },_process:function() {
  1302.     FB.Data.timer = -1;
  1303.     var c = {},e = FB.Data.queue;
  1304.     FB.Data.queue = [];
  1305.     for (var a = 0; a < e.length; a++) {
  1306.         var b = e[a];
  1307.         if (b.where.type == 'index' && !b.hasDependency) {
  1308.             FB.Data._mergeIndexQuery(b, c);
  1309.         } else c[b.name] = b;
  1310.     }
  1311.     var d = {method:'fql.multiquery',queries:{}};
  1312.     FB.copy(d.queries, c, true, function(f) {
  1313.         return f.toFql();
  1314.     });
  1315.     d.queries = FB.JSON.stringify(d.queries);
  1316.     FB.api(d, function(f) {
  1317.         if (f.error_msg) {
  1318.             FB.Array.forEach(c, function(g) {
  1319.                 g.error(Error(f.error_msg));
  1320.             });
  1321.         } else FB.Array.forEach(f, function(g) {
  1322.             c[g.name].set(g.fql_result_set);
  1323.         });
  1324.     });
  1325. },_mergeIndexQuery:function(a, d) {
  1326.     var b = a.where.key,f = a.where.value;
  1327.     var e = 'index_' + a.table + '_' + b;
  1328.     var c = d[e];
  1329.     if (!c) {
  1330.         c = d[e] = new FB.Data.Query();
  1331.         c.fields = [b];
  1332.         c.table = a.table;
  1333.         c.where = {type:'in',key:b,value:[]};
  1334.     }
  1335.     FB.Array.merge(c.fields, a.fields);
  1336.     FB.Array.merge(c.where.value, [f]);
  1337.     c.wait(function(g) {
  1338.         a.set(FB.Array.filter(g, function(h) {
  1339.             return h[b] == f;
  1340.         }));
  1341.     });
  1342. },timer:-1,queue:[]});
  1343. FB.provide('Cookie', {_domain:null,_enabled:false,setEnabled:function(a) {
  1344.     FB.Cookie._enabled = a;
  1345. },getEnabled:function() {
  1346.     return FB.Cookie._enabled;
  1347. },load:function() {
  1348.     var a = document.cookie.match('\\bfbs_' + FB._apiKey + '="([^;]*)\\b'),b;
  1349.     if (a) {
  1350.         b = FB.QS.decode(a[1]);
  1351.         b.expires = parseInt(b.expires, 10);
  1352.         FB.Cookie._domain = b.base_domain;
  1353.     }
  1354.     return b;
  1355. },setRaw:function(c, b, a) {
  1356.     document.cookie = 'fbs_' + FB._apiKey + '="' + c + '"' + (c && b == 0 ? '' : '; expires=' + new Date(b * 1000).toGMTString()) + '; path=/' + (a ? '; domain=.' + a : '');
  1357.     FB.Cookie._domain = a;
  1358. },set:function(a) {
  1359.     a ? FB.Cookie.setRaw(FB.QS.encode(a), a.expires, a.base_domain) : FB.Cookie.clear();
  1360. },clear:function() {
  1361.     FB.Cookie.setRaw('', 0, FB.Cookie._domain);
  1362. }});
  1363. FB.provide('', {init:function(a) {
  1364.     a = FB.copy(a || {}, {logging:true,status:true});
  1365.     FB._apiKey = a.appId || a.apiKey;
  1366.     if (!a.logging && window.location.toString().indexOf('fb_debug=1') < 0)FB._logging = false;
  1367.     FB.XD.init(a.channelUrl);
  1368.     if (FB._apiKey) {
  1369.         FB.Cookie.setEnabled(a.cookie);
  1370.         a.session = a.session || FB.Cookie.load();
  1371.         FB.Auth.setSession(a.session, a.session ? 'connected' : 'unknown');
  1372.         if (a.status)FB.getLoginStatus();
  1373.     }
  1374.     if (a.xfbml)window.setTimeout(function() {
  1375.         if (FB.XFBML)FB.Dom.ready(FB.XFBML.parse);
  1376.     }, 0);
  1377. }});
  1378. window.setTimeout(function() {
  1379.     var a = /(connect.facebook.net|facebook.com\/assets.php).*?#(.*)/;
  1380.     FB.Array.forEach(document.getElementsByTagName('script'), function(d) {
  1381.         if (d.src) {
  1382.             var b = a.exec(d.src);
  1383.             if (b) {
  1384.                 var c = FB.QS.decode(b[2]);
  1385.                 FB.Array.forEach(c, function(f, e) {
  1386.                     if (f == '0')c[e] = 0;
  1387.                 });
  1388.                 FB.init(c);
  1389.             }
  1390.         }
  1391.     });
  1392.     if (window.fbAsyncInit)fbAsyncInit();
  1393. }, 0);
  1394. FB.provide('UIServer.Methods', {'pay.prompt':{transform:function(a) {
  1395.     var b = FB.XD.handler(function(c) {
  1396.         a.cb(FB.JSON.parse(c.response));
  1397.     }, 'parent.frames[' + (window.name || 'iframe_canvas') + ']');
  1398.     a.params.channel = b;
  1399.     a.params.appId = FB._apiKey;
  1400.     FB.Arbiter.inform('Pay.Prompt', a.params);
  1401.     return false;
  1402. }}});
  1403. FB.Class('XFBML.Element', function(a) {
  1404.     this.dom = a;
  1405. }, FB.copy({getAttribute:function(b, a, c) {
  1406.     var d = (this.dom.getAttribute(b) || this.dom.getAttribute(b.replace(/-/g, '_')) || this.dom.getAttribute(b.replace(/-/g, '')));
  1407.     return d ? (c ? c(d) : d) : a;
  1408. },_getBoolAttribute:function(b, a) {
  1409.     return this.getAttribute(b, a, function(c) {
  1410.         c = c.toLowerCase();
  1411.         return c == 'true' || c == '1' || c == 'yes' || c == 'on';
  1412.     });
  1413. },_getPxAttribute:function(b, a) {
  1414.     return this.getAttribute(b, a, function(c) {
  1415.         var d = parseInt(c.replace('px', ''), 10);
  1416.         if (isNaN(d)) {
  1417.             return a;
  1418.         } else return d;
  1419.     });
  1420. },_getAttributeFromList:function(c, b, a) {
  1421.     return this.getAttribute(c, b, function(d) {
  1422.         d = d.toLowerCase();
  1423.         if (FB.Array.indexOf(a, d) > -1) {
  1424.             return d;
  1425.         } else return b;
  1426.     });
  1427. },isValid:function() {
  1428.     for (var a = this.dom; a; a = a.parentNode)if (a == document.body)return true;
  1429. },clear:function() {
  1430.     this.dom.innerHTML = '';
  1431. }}, FB.EventProvider));
  1432. FB.subclass('XFBML.IframeWidget', 'XFBML.Element', null, {_showLoader:true,_refreshOnAuthChange:false,_allowReProcess:false,_fetchPreCachedLoader:false,_visibleAfter:'load',getUrlBits:function() {
  1433.     throw new Error('Inheriting class needs to implement getUrlBits().');
  1434. },setupAndValidate:function() {
  1435.     return true;
  1436. },oneTimeSetup:function() {
  1437. },getSize:function() {
  1438. },getIframeName:function() {
  1439. },getIframeTitle:function() {
  1440. },getChannelUrl:function() {
  1441.     if (!this._channelUrl) {
  1442.         var a = this;
  1443.         this._channelUrl = FB.XD.handler(function(b) {
  1444.             a.fire('xd.' + b.type, b);
  1445.         }, 'parent.parent', true);
  1446.     }
  1447.     return this._channelUrl;
  1448. },getIframeNode:function() {
  1449.     return this.dom.getElementsByTagName('iframe')[0];
  1450. },process:function(a) {
  1451.     if (this._done) {
  1452.         if (!this._allowReProcess && !a)return;
  1453.         this.clear();
  1454.     } else this._oneTimeSetup();
  1455.     this._done = true;
  1456.     if (!this.setupAndValidate()) {
  1457.         this.fire('render');
  1458.         return;
  1459.     }
  1460.     if (this._showLoader)this._addLoader();
  1461.     FB.Dom.addCss(this.dom, 'fb_iframe_widget');
  1462.     if (this._visibleAfter != 'immediate') {
  1463.         FB.Dom.addCss(this.dom, 'fb_hide_iframes');
  1464.     } else this.subscribe('iframe.onload', FB.bind(this.fire, this, 'render'));
  1465.     var c = this.getSize() || {};
  1466.     var d = this._getURL();
  1467.     if (!this._fetchPreCachedLoader)d += '?' + FB.QS.encode(this._getQS());
  1468.     if (d.length > 2000) {
  1469.         d = 'about:blank';
  1470.         var b = FB.bind(function() {
  1471.             this._postRequest();
  1472.             this.unsubscribe('iframe.onload', b);
  1473.         }, this);
  1474.         this.subscribe('iframe.onload', b);
  1475.     }
  1476.     FB.Content.insertIframe({url:d,root:this.dom.appendChild(document.createElement('span')),name:this.getIframeName(),title:this.getIframeTitle(),className:FB._localeIsRtl ? 'fb_rtl' : 'fb_ltr',height:c.height,width:c.width,onload:FB.bind(this.fire, this, 'iframe.onload')});
  1477. },_oneTimeSetup:function() {
  1478.     this.subscribe('xd.resize', FB.bind(this._handleResizeMsg, this));
  1479.     if (FB.getLoginStatus) {
  1480.         this.subscribe('xd.refreshLoginStatus', FB.bind(FB.getLoginStatus, FB, function() {
  1481.         }, true));
  1482.         this.subscribe('xd.logout', FB.bind(FB.logout, FB, function() {
  1483.         }));
  1484.     }
  1485.     if (this._refreshOnAuthChange)this._setupAuthRefresh();
  1486.     if (this._visibleAfter == 'load')this.subscribe('iframe.onload', FB.bind(this._makeVisible, this));
  1487.     this.oneTimeSetup();
  1488. },_makeVisible:function() {
  1489.     this._removeLoader();
  1490.     FB.Dom.removeCss(this.dom, 'fb_hide_iframes');
  1491.     this.fire('render');
  1492. },_setupAuthRefresh:function() {
  1493.     FB.getLoginStatus(FB.bind(function(b) {
  1494.         var a = b.status;
  1495.         FB.Event.subscribe('auth.statusChange', FB.bind(function(c) {
  1496.             if (!this.isValid())return;
  1497.             if (a == 'unknown' || c.status == 'unknown')this.process(true);
  1498.             a = c.status;
  1499.         }, this));
  1500.     }, this));
  1501. },_handleResizeMsg:function(b) {
  1502.     if (!this.isValid())return;
  1503.     var a = this.getIframeNode();
  1504.     a.style.height = b.height + 'px';
  1505.     if (b.width)a.style.width = b.width + 'px';
  1506.     a.style.border = 'none';
  1507.     this._makeVisible();
  1508. },_addLoader:function() {
  1509.     if (!this._loaderDiv) {
  1510.         FB.Dom.addCss(this.dom, 'fb_iframe_widget_loader');
  1511.         this._loaderDiv = document.createElement('div');
  1512.         this._loaderDiv.className = 'FB_Loader';
  1513.         this.dom.appendChild(this._loaderDiv);
  1514.     }
  1515. },_removeLoader:function() {
  1516.     if (this._loaderDiv) {
  1517.         FB.Dom.removeCss(this.dom, 'fb_iframe_widget_loader');
  1518.         if (this._loaderDiv.parentNode)this._loaderDiv.parentNode.removeChild(this._loaderDiv);
  1519.         this._loaderDiv = null;
  1520.     }
  1521. },_getQS:function() {
  1522.     return FB.copy({api_key:FB._apiKey,locale:FB._locale,sdk:'joey',session_key:FB._session && FB._session.session_key,ref:this.getAttribute('ref')}, this.getUrlBits().params);
  1523. },_getURL:function() {
  1524.     var a = 'www',b = '';
  1525.     if (this._fetchPreCachedLoader) {
  1526.         a = 'cdn';
  1527.         b = 'static/';
  1528.     }
  1529.     return FB.getDomain(a) + 'plugins/' + b + this.getUrlBits().name + '.php';
  1530. },_postRequest:function() {
  1531.     FB.Content.postTarget({url:this._getURL(),target:this.getIframeNode().name,params:this._getQS()});
  1532. }});
  1533. FB.subclass('XFBML.Activity', 'XFBML.IframeWidget', null, {_visibleAfter:'load',_refreshOnAuthChange:true,setupAndValidate:function() {
  1534.     this._attr = {border_color:this.getAttribute('border-color'),colorscheme:this.getAttribute('color-scheme'),filter:this.getAttribute('filter'),font:this.getAttribute('font'),header:this._getBoolAttribute('header'),height:this._getPxAttribute('height', 300),recommendations:this._getBoolAttribute('recommendations'),site:this.getAttribute('site', location.hostname),width:this._getPxAttribute('width', 300)};
  1535.     return true;
  1536. },getSize:function() {
  1537.     return {width:this._attr.width,height:this._attr.height};
  1538. },getUrlBits:function() {
  1539.     return {name:'activity',params:this._attr};
  1540. }});
  1541. FB.subclass('XFBML.ButtonElement', 'XFBML.Element', null, {_allowedSizes:['icon','small','medium','large','xlarge'],onClick:function() {
  1542.     throw new Error('Inheriting class needs to implement onClick().');
  1543. },setupAndValidate:function() {
  1544.     return true;
  1545. },getButtonMarkup:function() {
  1546.     return this.getOriginalHTML();
  1547. },getOriginalHTML:function() {
  1548.     return this._originalHTML;
  1549. },process:function() {
  1550.     if (!('_originalHTML' in this))this._originalHTML = FB.String.trim(this.dom.innerHTML);
  1551.     if (!this.setupAndValidate()) {
  1552.         this.fire('render');
  1553.         return;
  1554.     }
  1555.     var d = this._getAttributeFromList('size', 'medium', this._allowedSizes),a = '',b = '';
  1556.     if (d == 'icon') {
  1557.         a = 'fb_button_simple';
  1558.     } else {
  1559.         var c = FB._localeIsRtl ? '_rtl' : '';
  1560.         b = this.getButtonMarkup();
  1561.         a = 'fb_button' + c + ' fb_button_' + d + c;
  1562.     }
  1563.     this.dom.innerHTML = ('<a class="' + a + '">' + '<span class="fb_button_text">' + b + '</span>' + '</a>');