Advertisement
Guest User

Untitled

a guest
Nov 16th, 2010
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. /*
  3.  HTTP Host: b.static.ak.fbcdn.net
  4.  Generated: November 8th 2010 2:46:33 PM PDT
  5.  Machine: 10.30.147.196
  6.  */
  7. if (window.CavalryLogger) {
  8.     CavalryLogger.start_js(["js\/bmq929sp95w04swo.pkg.js"]);
  9. }
  10.  
  11. if (!window.skipDomainLower && navigator && navigator.userAgent && document.domain.toLowerCase().match(/(^|\.)facebook\..*/) && !(parseInt((/Gecko\/([0-9]+)/.exec(navigator.userAgent) || []).pop(), 10) <= 20060508))
  12.     document.domain = window.location.hostname.replace(/^.*(facebook\..*)$/i, '$1');
  13. window.onloadhooks = window.onloadhooks || [];
  14. window.onloadRegister = window.onloadRegister ||
  15. function(a){
  16.     onloadhooks.push(a);
  17. };
  18. window.onafterloadhooks = window.onafterloadhooks || [];
  19. window.onafterloadRegister = window.onafterloadRegister ||
  20. function(a){
  21.     onafterloadhooks.push(a);
  22. };
  23. function run_if_loaded(a, b){
  24.     return window.loaded && b.call(a);
  25. }
  26.  
  27. function run_with(b, a, c){
  28.     Bootloader.loadComponents(a, bind(b, c));
  29.     return false;
  30. }
  31.  
  32. function wait_for_load(c, b, e){
  33.     e = bind(c, e, b);
  34.     if (window.loaded)
  35.         return e();
  36.     switch ((b || event).type) {
  37.         case 'load':
  38.         case 'focus':
  39.             onafterloadRegister(e);
  40.             return;case 'click':
  41.             var d = c.style, a = document.body.style;
  42.             d.cursor = a.cursor = 'progress';
  43.             onafterloadRegister(function(){
  44.                 d.cursor = a.cursor = '';
  45.                 if (c.tagName.toLowerCase() == 'a') {
  46.                     if (false !== e() && c.href)
  47.                         window.location.href = c.href;
  48.                 }
  49.                 else
  50.                     if (c.click)
  51.                         c.click();
  52.             });
  53.             break;
  54.     }
  55.     return false;
  56. }
  57.  
  58. function bind(c, b){
  59.     var a = Array.prototype.slice.call(arguments, 2);
  60.     return function(){
  61.         var e = c || (this == window ? false : this), d = a.concat(Array.prototype.slice.call(arguments));
  62.         if (typeof(b) == "string") {
  63.             if (e[b])
  64.                 return e[b].apply(e, d);
  65.         }
  66.         else
  67.             return b.apply(e, d);
  68.     };
  69. }
  70.  
  71. var curry = bind(null, bind, null);
  72. function env_get(a){
  73.     return window.Env && Env[a];
  74. }
  75.  
  76. window.__DEV__ = window.__DEV__ || 0;
  77. function hasArrayNature(a){
  78.     return (!!a && (typeof a == 'object' || typeof a == 'function') && ('length' in a) && !('setInterval' in a) && (Object.prototype.toString.call(a) === "[object Array]" || ('callee' in a) || ('item' in a)));
  79. }
  80.  
  81. function $A(b){
  82.     if (!hasArrayNature(b))
  83.         return [b];
  84.     if (b.item) {
  85.         var a = b.length, c = new Array(a);
  86.         while (a--)
  87.             c[a] = b[a];
  88.         return c;
  89.     }
  90.     return Array.prototype.slice.call(b);
  91. }
  92.  
  93. function eval_global(c){
  94.     if ('string' != typeof(c)) {
  95.         throw new Error('JS sent to eval_global is not a string.  Only strings ' + 'are permitted.');
  96.     }
  97.     else
  98.         if ('' == c)
  99.             return;
  100.     var d = document.createElement('script');
  101.     d.type = 'text/javascript';
  102.     try {
  103.         d.appendChild(document.createTextNode(c));
  104.     }
  105.     catch (a) {
  106.         d.text = c;
  107.     }
  108.     var b = (document.getElementsByTagName("head")[0] || document.documentElement);
  109.     b.appendChild(d);
  110.     b.removeChild(d);
  111. }
  112.  
  113. function copy_properties(b, c){
  114.     b = b || {};
  115.     c = c || {};
  116.     for (var a in c)
  117.         b[a] = c[a];
  118.     if (c.hasOwnProperty && c.hasOwnProperty('toString') && (typeof c.toString != 'undefined') && (b.toString !== c.toString))
  119.         b.toString = c.toString;
  120.     return b;
  121. }
  122.  
  123. function add_properties(a, b){
  124.     return copy_properties(window[a] || (window[a] = {}), b);
  125. }
  126.  
  127. function is_empty(b){
  128.     if (b instanceof Array) {
  129.         return b.length == 0;
  130.     }
  131.     else
  132.         if (b instanceof Object) {
  133.             for (var a in b)
  134.                 return false;
  135.             return true;
  136.         }
  137.         else
  138.             return !b;
  139. }
  140.  
  141. if (!window.async_callback)
  142.     window.async_callback = function(a){
  143.         return a;
  144.     };
  145. function Arbiter(){
  146.     copy_properties(this, {
  147.         _listeners: [],
  148.         _events: {},
  149.         _callbacks: {},
  150.         _last_id: 1,
  151.         _listen: {},
  152.         _index: {}
  153.     });
  154.     copy_properties(this, Arbiter);
  155. }
  156.  
  157. copy_properties(Arbiter, {
  158.     SUBSCRIBE_NEW: 'new',
  159.     SUBSCRIBE_ALL: 'all',
  160.     BEHAVIOR_EVENT: 'event',
  161.     BEHAVIOR_PERSISTENT: 'persistent',
  162.     BEHAVIOR_STATE: 'state',
  163.     LIVEMESSAGE: 'livemessage',
  164.     BOOTLOAD: 'bootload',
  165.     FUNCTION_EXTENSION: 'function_ext',
  166.     CONTEXT_CHANGE: 'ui/context-change',
  167.     PAGECACHE_INVALIDATE: 'pagecache/invalidate',
  168.     NEW_NOTIFICATIONS: 'chat/new_notifications',
  169.     LIST_EDITOR_LISTS_CHANGED: 'listeditor/friend_lists_changed',
  170.     subscribe: function(k, b, i){
  171.         if (!k || k.length == 0)
  172.             return null;
  173.         k = $A(k);
  174.         var a = Arbiter._getInstance(this);
  175.         a._listeners.push({
  176.             callback: b,
  177.             types: k
  178.         });
  179.         var h = a._listeners.length - 1;
  180.         for (var d = 0; d < k.length; d++)
  181.             if (a._index[k[d]]) {
  182.                 a._index[k[d]].push(h);
  183.             }
  184.             else
  185.                 a._index[k[d]] = [h];
  186.         i = i || Arbiter.SUBSCRIBE_ALL;
  187.         if (i == Arbiter.SUBSCRIBE_ALL) {
  188.             var c, j, g;
  189.             for (var e = 0; e < k.length; e++) {
  190.                 j = k[e];
  191.                 if (typeof j != "string")
  192.                     throw new TypeError("Event types must be strings.");
  193.                 if (j in a._events)
  194.                     for (var f = 0; f < a._events[j].length; f++) {
  195.                         c = a._events[j][f];
  196.                         g = b.apply(null, [j, c]);
  197.                         if (g === false) {
  198.                             a._events[j].splice(f, 1);
  199.                             f--;
  200.                         }
  201.                     }
  202.             }
  203.         }
  204.         else
  205.             if (i != Arbiter.SUBSCRIBE_NEW)
  206.                 throw new TypeError("Bad subscription policy.");
  207.         return {
  208.             subscriberID: h
  209.         };
  210.     },
  211.     unsubscribe: function(e){
  212.         if (!('subscriberID' in e))
  213.             throw new TypeError("Not an arbiter token.");
  214.         var a = Arbiter._getInstance(this);
  215.         var c = a._listeners[e.subscriberID];
  216.         for (var d = 0; d < c.types.length; d++) {
  217.             var f = c.types[d];
  218.             if (a._index[f])
  219.                 for (var b = 0; b < a._index[f].length; b++)
  220.                     if (a._index[f][b] == e.subscriberID) {
  221.                         a._index[f].splice(b, 1);
  222.                         if (a._index[f].length == 0)
  223.                             delete a._index[f];
  224.                         break;
  225.                     }
  226.         }
  227.         delete a._listeners[e.subscriberID];
  228.     },
  229.     inform: function(i, c, b){
  230.         var l = hasArrayNature(i);
  231.         var k = $A(i);
  232.         var a = Arbiter._getInstance(this);
  233.         var h = {};
  234.         b = b || Arbiter.BEHAVIOR_EVENT;
  235.         for (var e = 0; e < k.length; e++) {
  236.             var i = k[e], d = null;
  237.             if (b == Arbiter.BEHAVIOR_PERSISTENT) {
  238.                 d = a._events.length;
  239.                 if (!(i in a._events))
  240.                     a._events[i] = [];
  241.                 a._events[i].push(c);
  242.                 a._events[i]._stateful = false;
  243.             }
  244.             else
  245.                 if (b == Arbiter.BEHAVIOR_STATE) {
  246.                     d = 0;
  247.                     a._events[i] = [c];
  248.                     a._events[i]._stateful = true;
  249.                 }
  250.                 else
  251.                     if (i in a._events)
  252.                         a._events[i]._stateful = false;
  253.             window.ArbiterMonitor && ArbiterMonitor.getInstance(a).log('event', i, c);
  254.             var g;
  255.             if (a._index[i]) {
  256.                 var j = a._index[i];
  257.                 for (var f = 0; f < j.length; f++) {
  258.                     g = a._listeners[j[f]].callback.apply(null, [i, c]);
  259.                     if (g === false) {
  260.                         if (d !== null)
  261.                             a._events[i].splice(d, 1);
  262.                         break;
  263.                     }
  264.                 }
  265.             }
  266.             a._updateCallbacks(i, c);
  267.             window.ArbiterMonitor && ArbiterMonitor.getInstance(a).log('done', i, c);
  268.             h[i] = g;
  269.         }
  270.         return l ? h : h[k[0]];
  271.     },
  272.     query: function(b){
  273.         var a = Arbiter._getInstance(this);
  274.         if (!(b in a._events))
  275.             return null;
  276.         if (!a._events[b]._stateful)
  277.             throw new Error("Querying state of an unstateful event.");
  278.         if (a._events[b].length)
  279.             return a._events[b][0];
  280.         return null;
  281.     },
  282.     _instance: null,
  283.     _getInstance: function(a){
  284.         if (a instanceof Arbiter)
  285.             return a;
  286.         if (!Arbiter._instance)
  287.             Arbiter._instance = new Arbiter();
  288.         return Arbiter._instance;
  289.     },
  290.     registerCallback: function(b, d){
  291.         var h, c = 0, a = Arbiter._getInstance(this), g = false;
  292.         if (typeof b == 'function') {
  293.             h = a._last_id;
  294.             a._last_id++;
  295.             g = true;
  296.         }
  297.         else {
  298.             if (!a._callbacks[b])
  299.                 return null;
  300.             h = b;
  301.         }
  302.         if (hasArrayNature(d)) {
  303.             var i = {};
  304.             for (var f = 0; f < d.length; f++)
  305.                 i[d[f]] = 1;
  306.             d = i;
  307.         }
  308.         for (var j in d) {
  309.             try {
  310.                 if (a.query(j))
  311.                     continue;
  312.             }
  313.             catch (e) {
  314.             }
  315.             c += d[j];
  316.             if (a._listen[j] === undefined)
  317.                 a._listen[j] = {};
  318.             a._listen[j][h] = (a._listen[j][h] || 0) + d[j];
  319.         }
  320.         if (c == 0 && g) {
  321.             b();
  322.             return null;
  323.         }
  324.         if (!g) {
  325.             a._callbacks[h].depnum += c;
  326.         }
  327.         else
  328.             a._callbacks[h] = {
  329.                 callback: async_callback(b, 'arbiter'),
  330.                 depnum: c
  331.             };
  332.         return h;
  333.     },
  334.     _updateCallbacks: function(d, c){
  335.         if (c === null || !this._listen[d])
  336.             return;
  337.         for (var b in this._listen[d]) {
  338.             this._listen[d][b]--;
  339.             if (this._listen[d][b] <= 0)
  340.                 delete this._listen[d][b];
  341.             this._callbacks[b].depnum--;
  342.             if (this._callbacks[b].depnum <= 0) {
  343.                 var a = this._callbacks[b].callback;
  344.                 delete this._callbacks[b];
  345.                 a();
  346.             }
  347.         }
  348.     }
  349. });
  350. Function.prototype.deferUntil = function(a, h, b, i){
  351.     if (typeof this != 'function' || h && typeof h != 'number')
  352.         throw new TypeError();
  353.     var f = a();
  354.     if (f) {
  355.         this(f);
  356.         return;
  357.     }
  358.     var e = this, d = null, g = (new Date()).getTime();
  359.     var c = function(){
  360.         f = a();
  361.         if (!f)
  362.             if (h && (new Date().getTime() - g) >= h) {
  363.                 i && i();
  364.             }
  365.             else
  366.                 return;
  367.         d && clearInterval(d);
  368.         e(f);
  369.     };
  370.     d = setInterval(c, 20, b);
  371.     return d;
  372. };
  373. var Bootloader = window.Bootloader = (window.Bootloader && window.Bootloader.realBootloader) ? window.Bootloader : (function(a){
  374.     return {
  375.         realBootloader: true,
  376.         configurePage: function(b){
  377.             var h = {};
  378.             var g = this.resolveResources(b);
  379.             for (var c = 0; c < g.length; c++) {
  380.                 h[g[c].src] = g[c];
  381.                 this.requested(g[c].name);
  382.                 this._startCSSPoll(g[c].name);
  383.             }
  384.             var e = document.getElementsByTagName('link');
  385.             for (var c = 0; c < e.length; ++c) {
  386.                 if (e[c].rel != 'stylesheet')
  387.                     continue;
  388.                 for (var d in h)
  389.                     if (e[c].href.indexOf(d) !== -1) {
  390.                         var f = h[d].name;
  391.                         this._cssLinkMap[f] = {
  392.                             link: e[c]
  393.                         };
  394.                         if (h[d].permanent)
  395.                             this._permanent[f] = true;
  396.                         delete h[d];
  397.                         break;
  398.                     }
  399.             }
  400.         },
  401.         loadComponents: function(d, b){
  402.             d = $A(d);
  403.             var g = [];
  404.             for (var e = 0; e < d.length; ++e) {
  405.                 if (!d[e])
  406.                     continue;
  407.                 var c = this._componentMap[d[e]];
  408.                 if (!!c)
  409.                     for (var f = 0; f < c.length; ++f)
  410.                         g.push(c[f]);
  411.             }
  412.             return this.loadResources(g, b);
  413.         },
  414.         loadResources: function(j, b, i, m){
  415.             j = Bootloader.resolveResources($A(j));
  416.             if (i) {
  417.                 var g = {};
  418.                 var e = j.length && j[0].hash;
  419.                 if (!window.ResourceBundler || !e) {
  420.                     for (var d = 0; d < j.length; ++d)
  421.                         g[j[d].name] = true;
  422.                 }
  423.                 else
  424.                     ResourceBundler.dropLocalResources(this._earlyResources);
  425.                 for (var f in this._requested)
  426.                     if (!(f in this._permanent) && !(f in g) && !(f in this._earlyResources))
  427.                         this._unloadResource(f);
  428.                 this._earlyResources = {};
  429.             }
  430.             var n = [];
  431.             var c = [];
  432.             var h = [];
  433.             for (var d = 0; d < j.length; ++d) {
  434.                 var k = j[d];
  435.                 if (k.permanent)
  436.                     this._permanent[k.name] = true;
  437.                 var l = Arbiter.BOOTLOAD + '/' + k.name;
  438.                 if (Arbiter.query(l) !== null)
  439.                     continue;
  440.                 if (!k.nonblocking)
  441.                     h.push(l);
  442.                 if (!this._requested[k.name]) {
  443.                     this.requested(k.name);
  444.                     if (k.hash) {
  445.                         c.push(k);
  446.                     }
  447.                     else {
  448.                         n.push(k);
  449.                         window.CavalryLogger && CavalryLogger.getInstance().measureResources(k, m);
  450.                     }
  451.                 }
  452.             }
  453.             if (b)
  454.                 b = Arbiter.registerCallback(b, h);
  455.             if (c.length)
  456.                 if (!window.ResourceBundler) {
  457.                     window.Util && false;
  458.                 }
  459.                 else
  460.                     ResourceBundler.fetchComboRsrcs(c);
  461.             for (var d = 0; d < n.length; ++d)
  462.                 this.requestResource(n[d].type, n[d].src, n[d].name);
  463.             return b;
  464.         },
  465.         _fetchWithIframe: function(d){
  466.             var c = null, b = null;
  467.             var e = Arbiter.BOOTLOAD + ':iframe';
  468.             if (!this._iframe) {
  469.                 c = this._iframe = document.createElement('iframe');
  470.                 copy_properties(c.style, {
  471.                     width: '0',
  472.                     height: '0',
  473.                     frameborder: '0',
  474.                     left: '0',
  475.                     top: '0',
  476.                     position: 'absolute'
  477.                 });
  478.                 c.onload = bind(null, Arbiter.inform, e, true, Arbiter.BEHAVIOR_STATE);
  479.                 c.src = "about:blank";
  480.                 c.id = 'bootloader_iframe';
  481.                 this.getHardpoint().appendChild(c);
  482.             }
  483.             Arbiter.registerCallback(bind(this, this._addResourceToIframe, d), [e]);
  484.         },
  485.         _addResourceToIframe: function(e){
  486.             var c = document.getElementById('bootloader_iframe');
  487.             var b = (c.contentDocument ? c.contentDocument : (c.contentWindow ? c.contentWindow.document : window.frames.bootloader_iframe.document));
  488.             var d = b.createElement("script");
  489.             if (e.charAt(0) == '/')
  490.                 e = location.protocol + '/' + '/' + location.host + e;
  491.             d.src = e;
  492.             d.type = 'text/javascript';
  493.             d.async = true;
  494.             b.getElementsByTagName('head')[0].appendChild(d);
  495.         },
  496.         requestResource: function(j, g, e){
  497.             var b = this.getHardpoint();
  498.             switch (j) {
  499.                 case 'js':
  500.                     if (/\/rsrc.php\/(v[^\/]+\/)?(z[^\/]+\/)?p\//.test(g)) {
  501.                         this._fetchWithIframe(g);
  502.                     }
  503.                     else {
  504.                         var f = document.createElement('script');
  505.                         f.src = g;
  506.                         f.type = 'text/javascript';
  507.                         f.async = true;
  508.                         b.appendChild(f);
  509.                     }
  510.                     break;
  511.                 case 'css':
  512.                     if (window.Env && Env.use_css_import_in_ie && document.createStyleSheet) {
  513.                         var h = this._styleTags, i = -1;
  514.                         for (var c = 0; c < h.length; c++)
  515.                             if (h[c].imports.length < 25) {
  516.                                 i = c;
  517.                                 break;
  518.                             }
  519.                         if (i == -1) {
  520.                             h.push(document.createStyleSheet());
  521.                             i = h.length - 1;
  522.                         }
  523.                         h[i].addImport(g);
  524.                         this._cssLinkMap[e] = {
  525.                             tagIdx: i,
  526.                             href: g
  527.                         };
  528.                     }
  529.                     else {
  530.                         var d = document.createElement('link');
  531.                         d.rel = "stylesheet";
  532.                         d.type = "text/css";
  533.                         d.media = "all";
  534.                         d.href = g;
  535.                         this._cssLinkMap[e] = {
  536.                             link: d
  537.                         };
  538.                         b.appendChild(d);
  539.                     }
  540.                     this._startCSSPoll(e);
  541.                     break;
  542.                 default:
  543.                     throw new TypeError("Bad resource type `" + j + "'.");
  544.             }
  545.         },
  546.         _startCSSPoll: function(d){
  547.             var c = 'bootloader_' + d.replace(/[^a-z0-9]/ig, '_');
  548.             function b(e, h, f, g){
  549.                 g.deferUntil(e, h, false, function(){
  550.                     window.Util;
  551.                 });
  552.             }
  553.             b(function(){
  554.                 return document.body;
  555.             }, 5000, "Still no DOM", function(){
  556.                 var e = document.createElement('div');
  557.                 e.id = c;
  558.                 document.body.appendChild(e);
  559.                 b(function(){
  560.                     var g = '42';
  561.                     var f;
  562.                     return e.offsetHeight == g || e.currentStyle && e.currentStyle.height == g + 'px' || window.getComputedStyle && (f = document.defaultView.getComputedStyle(e, null)) && f.getPropertyValue('height') == g + 'px';
  563.                 }, Bootloader._CSS_POLL_EXPIRATION, "CSS timeout", function(){
  564.                     Bootloader.done([d], true);
  565.                     e.parentNode.removeChild(e);
  566.                 });
  567.             });
  568.         },
  569.         done: function(f, c){
  570.             f = Bootloader.resolveResources(f, 'name');
  571.             var g = (a && a._preloaded) || [];
  572.             (a || {})._preloaded = [];
  573.             f = f.concat(g);
  574.             this.requested(f);
  575.             if (!c) {
  576.                 var e = {
  577.                     sender: this
  578.                 };
  579.                 Arbiter.inform(Arbiter.BOOTLOAD, e, Arbiter.BEHAVIOR_EVENT);
  580.             }
  581.             for (var b = 0; b < f.length; ++b) {
  582.                 var d = f[b];
  583.                 Arbiter.inform(Arbiter.BOOTLOAD + '/' + d, true, Arbiter.BEHAVIOR_STATE);
  584.             }
  585.         },
  586.         requested: function(c){
  587.             c = $A(c);
  588.             for (var b = 0; b < c.length; ++b)
  589.                 this._requested[c[b]] = true;
  590.         },
  591.         enableBootload: function(b){
  592.             for (var c in b)
  593.                 if (!this._componentMap[c])
  594.                     this._componentMap[c] = b[c];
  595.         },
  596.         _unloadResource: function(e){
  597.             if (e in this._cssLinkMap) {
  598.                 var c = this._cssLinkMap[e], d = c.link;
  599.                 if (d) {
  600.                     d.parentNode.removeChild(d);
  601.                 }
  602.                 else {
  603.                     var f = this._styleTags[c.tagIdx];
  604.                     for (var b = 0; b < f.imports.length; b++)
  605.                         if (f.imports[b].href == c.href) {
  606.                             f.removeImport(b);
  607.                             break;
  608.                         }
  609.                 }
  610.                 delete this._cssLinkMap[e];
  611.                 delete this._requested[e];
  612.                 Arbiter.inform(Arbiter.BOOTLOAD + '/' + e, null, Arbiter.BEHAVIOR_STATE);
  613.             }
  614.         },
  615.         getHardpoint: function(){
  616.             if (!this._hardpoint) {
  617.                 var c, b = document.getElementsByTagName('head');
  618.                 if (b.length) {
  619.                     c = b[0];
  620.                 }
  621.                 else
  622.                     c = document.body;
  623.                 this._hardpoint = c;
  624.             }
  625.             return this._hardpoint;
  626.         },
  627.         setResourceMap: function(c){
  628.             if (!c)
  629.                 return;
  630.             for (var b in c)
  631.                 this._resources[b] = c[b];
  632.         },
  633.         resolveResources: function(e, b){
  634.             if (!e)
  635.                 return;
  636.             var d = new Array(e.length);
  637.             for (var c = 0; c < e.length; ++c)
  638.                 if (!e[c].type && e[c] in this._resources) {
  639.                     d[c] = this._resources[e[c]];
  640.                     if (b && (b in d[c]))
  641.                         d[c] = d[c][b];
  642.                 }
  643.                 else
  644.                     d[c] = e[c];
  645.             return d;
  646.         },
  647.         loadEarlyResources: function(c){
  648.             this.loadResources(c);
  649.             for (var b = 0; b < c.length; ++b)
  650.                 if (!c[b].permanent)
  651.                     this._earlyResources[c[b].name] = c[b];
  652.         },
  653.         _requested: {},
  654.         _permanent: {},
  655.         _componentMap: {},
  656.         _cssLinkMap: {},
  657.         _styleTags: [],
  658.         _hardpoint: null,
  659.         _resources: {},
  660.         _earlyResources: {},
  661.         _CSS_POLL_EXPIRATION: 5000
  662.     };
  663. })(window.Bootloader);
  664. function get_intern_ref(c){
  665.     if (!!c) {
  666.         var b = {
  667.             profile_minifeed: 1,
  668.             info_tab: 1,
  669.             gb_content_and_toolbar: 1,
  670.             gb_muffin_area: 1,
  671.             ego: 1,
  672.             bookmarks_menu: 1,
  673.             jewelBoxNotif: 1,
  674.             jewelNotif: 1,
  675.             BeeperBox: 1,
  676.             navSearch: 1
  677.         };
  678.         for (var a = c; a && a != document.body; a = a.parentNode) {
  679.             if (!a.id || typeof a.id !== 'string')
  680.                 continue;
  681.             if (a.id.substr(0, 8) == 'pagelet_')
  682.                 return a.id.substr(8);
  683.             if (a.id.substr(0, 8) == 'box_app_')
  684.                 return a.id;
  685.             if (b[a.id])
  686.                 return a.id;
  687.         }
  688.     }
  689.     return '-';
  690. }
  691.  
  692. function set_ue_cookie(a){
  693.     document.cookie = "act=" + encodeURIComponent(a) + "; path=/; domain=" + window.location.hostname.replace(/^.*(\.facebook\..*)$/i, '$1');
  694. }
  695.  
  696. var user_action = (function(){
  697.     var c = 0, a = 0, b = (!window.ArbiterMonitor) ? 'r' : 'a';
  698.     return function(i, d, e){
  699.         var j = null, f = null, g = null;
  700.         if (a)
  701.             return;
  702.         a = 1;
  703.         setTimeout(function(){
  704.             a = 0;
  705.         }, 0);
  706.         if (!!e) {
  707.             j = e.type;
  708.             var h = 0;
  709.             e.ctrlKey && (h += 1);
  710.             e.shiftKey && (h += 2);
  711.             e.altKey && (h += 4);
  712.             e.metaKey && (h += 8);
  713.             if (h)
  714.                 j += h;
  715.         }
  716.         if (!i && e)
  717.             i = e.getTarget();
  718.         if (!!i)
  719.             f = i.action || i.getAttribute && i.getAttribute('ajaxify') != '1' && i.getAttribute('ajaxify') || i.href || i.name;
  720.         c++;
  721.         var l = (+new Date());
  722.         var k = l + '/' + c;
  723.         set_ue_cookie(k);
  724.         if (b == 'a') {
  725.             ArbiterMonitor.initUE(k);
  726.             g = ArbiterMonitor.get_intern_ref(i);
  727.         }
  728.         Arbiter.inform('user/action', {
  729.             context: d,
  730.             event: e,
  731.             node: i
  732.         });
  733.         window.Log && Log('act', [l, c, f || '-', d, j || '-', g || get_intern_ref(i), b, window.URI ? URI.getRequestURI(true, true).getUnqualifiedURI().toString() : location.pathname + location.search + location.hash]);
  734.     };
  735. })();
  736. ge = $ = function(a){
  737.     return typeof a == 'string' ? document.getElementById(a) : a;
  738. };
  739. CSS = window.CSS ||
  740. {
  741.     hasClass: function(b, a){
  742.         b = $(b);
  743.         return (' ' + b.className + ' ').indexOf(' ' + a + ' ') > -1;
  744.     },
  745.     addClass: function(b, a){
  746.         b = $(b);
  747.         if (a && !CSS.hasClass(b, a))
  748.             b.className = b.className + ' ' + a;
  749.         return b;
  750.     },
  751.     removeClass: function(b, a){
  752.         b = $(b);
  753.         b.className = b.className.replace(new RegExp('(^|\\s)' + a + '(?:\\s|$)', 'g'), '$1');
  754.         return b;
  755.     },
  756.     toggleClass: function(b, a){
  757.         return CSS.conditionClass(b, a, !CSS.hasClass(b, a));
  758.     },
  759.     conditionClass: function(c, b, a){
  760.         return (a ? CSS.addClass : CSS.removeClass)(c, b);
  761.     },
  762.     show: function(a){
  763.         CSS.removeClass(a, 'hidden_elem');
  764.     },
  765.     hide: function(a){
  766.         CSS.addClass(a, 'hidden_elem');
  767.     },
  768.     conditionShow: function(b, a){
  769.         CSS.conditionClass(b, 'hidden_elem', !a);
  770.     }
  771. };
  772. var Parent = {
  773.     byTag: function(a, b){
  774.         b = b.toUpperCase();
  775.         while (a && a.nodeName != b)
  776.             a = a.parentNode;
  777.         return a;
  778.     },
  779.     byClass: function(b, a){
  780.         while (b && !CSS.hasClass(b, a))
  781.             b = b.parentNode;
  782.         return b;
  783.     }
  784. };
  785. !function(){
  786.     var a = document;
  787.     var b = a.documentElement;
  788.     var c = null;
  789.     b.onclick = function(d){
  790.         d = d || window.event;
  791.         c = d.target || d.srcElement;
  792.         var e = Parent.byTag(c, 'A') || b;
  793.         var f = e.getAttribute('ajaxify') || e.href;
  794.         f && user_action(e, 'a', d);
  795.         switch (e.rel) {
  796.             case 'dialog':
  797.             case 'dialog-post':
  798.                 Bootloader.loadComponents('dialog', function(){
  799.                     Dialog.bootstrap(f, null, e.rel == 'dialog');
  800.                 });
  801.                 break;
  802.             case 'async':
  803.             case 'async-post':
  804.                 Bootloader.loadComponents('async', function(){
  805.                     AsyncRequest.bootstrap(f, e);
  806.                 });
  807.                 break;
  808.             case 'theater':
  809.                 if (d.altKey || d.ctrlKey || d.metaKey || d.shiftKey || (d.which && d.which != 1))
  810.                     return;
  811.                 Bootloader.loadComponents('PhotoTheater', function(){
  812.                     PhotoTheater.bootstrap(f, e);
  813.                 });
  814.                 break;
  815.             default:
  816.                 return;        }
  817.         return false;
  818.     };
  819.     b.onsubmit = function(d){
  820.         d = d || window.event;
  821.         var e = d.target || d.srcElement;
  822.         if (!e || e.nodeName != 'FORM' || !e.getAttribute('ajaxify'))
  823.             return;
  824.         user_action(e, 'f', d);
  825.         Bootloader.loadComponents('dom-form', function(){
  826.             Form.bootstrap(e, c);
  827.         });
  828.         return false;
  829.     };
  830.     b.className = b.className.replace('no_js', '');
  831. }();
  832. Function.prototype.extend = function(a){
  833.     if (typeof a != 'string')
  834.         throw new TypeError('You must extend() with the name of a class, not the function object. ' + 'This generally means you need to replace "Dog.extend(Animal);" with ' + '"Dog.extend(\'Animal\');".');
  835.     if (!Metaprototype._arbiterHandle)
  836.         Metaprototype._arbiterHandle = Arbiter.subscribe(Arbiter.BOOTLOAD, Metaprototype._onbootload.bind(Metaprototype));
  837.     Metaprototype._queue(this, a);
  838. };
  839. function Metaprototype(){
  840. }
  841.  
  842. copy_properties(Metaprototype, {
  843.     _pending: {},
  844.     _queue: function(b, c){
  845.         b.__class_extending = true;
  846.         var a = Arbiter.registerCallback(bind(Metaprototype, Metaprototype._apply, b, c), [Arbiter.FUNCTION_EXTENSION + '/' + c, Arbiter.BOOTLOAD]);
  847.         if (a !== null)
  848.             this._pending[c] = true;
  849.     },
  850.     _onbootload: function(b, a){
  851.         this._update();
  852.     },
  853.     _update: function(){
  854.         for (var a in this._pending)
  855.             if (!!window[a]) {
  856.                 delete this._pending[a];
  857.                 if (!window[a].__class_extending) {
  858.                     Arbiter.inform(Arbiter.FUNCTION_EXTENSION + '/' + a, true, Arbiter.BEHAVIOR_STATE);
  859.                 }
  860.                 else
  861.                     window[a].__class_name = a;
  862.             }
  863.     },
  864.     _apply: function(a, c){
  865.         delete a.__class_extending;
  866.         var d = __metaprototype(window[c], 0);
  867.         var b = __metaprototype(a, d.prototype.__level + 1);
  868.         b.parent = d;
  869.         if (!!a.__class_name)
  870.             Arbiter.inform(Arbiter.FUNCTION_EXTENSION + '/' + a.__class_name, true, Arbiter.BEHAVIOR_STATE);
  871.     }
  872. });
  873. function __metaprototype(c, a){
  874.     if (c.__metaprototype)
  875.         return c.__metaprototype;
  876.     var b = new Function();
  877.     b.construct = __metaprototype_construct;
  878.     b.prototype.construct = __metaprototype_wrap(c, a, true);
  879.     b.prototype.__level = a;
  880.     b.base = c;
  881.     c.prototype.parent = b;
  882.     c.__metaprototype = b;
  883.     return b;
  884. }
  885.  
  886. function __metaprototype_construct(a){
  887.     __metaprototype_init(a.parent);
  888.     var c = [];
  889.     var b = a;
  890.     while (b.parent) {
  891.         c.push(new_obj = new b.parent());
  892.         new_obj.__instance = a;
  893.         b = b.parent;
  894.     }
  895.     a.parent = c[1];
  896.     c.reverse();
  897.     c.pop();
  898.     a.__parents = c;
  899.     a.__instance = a;
  900.     return a.parent.construct.apply(a.parent, arguments);
  901. }
  902.  
  903. function __metaprototype_init(d){
  904.     if (d.initialized)
  905.         return;
  906.     var a = d.base.prototype;
  907.     if (d.parent) {
  908.         __metaprototype_init(d.parent);
  909.         var e = d.parent.prototype;
  910.         for (var b in e)
  911.             if (b != '__level' && b != 'construct' && a[b] === undefined)
  912.                 a[b] = d.prototype[b] = e[b];
  913.     }
  914.     d.initialized = true;
  915.     var c = d.prototype.__level;
  916.     for (var b in a)
  917.         if (b != 'parent')
  918.             a[b] = d.prototype[b] = __metaprototype_wrap(a[b], c);
  919. }
  920.  
  921. function __metaprototype_wrap(c, b, d){
  922.     if (typeof c != 'function' || c.__prototyped)
  923.         return c;
  924.     var a = function(){
  925.         var g = this.__instance;
  926.         if (g) {
  927.             var h = g.parent;
  928.             g.parent = b ? g.__parents[b - 1] : null;
  929.             if (d) {
  930.                 var e = [];
  931.                 for (var f = 1; f < arguments.length; f++)
  932.                     e.push(arguments[f]);
  933.                 var i = c.apply(g, e);
  934.             }
  935.             else
  936.                 var i = c.apply(g, arguments);
  937.             g.parent = h;
  938.             return i;
  939.         }
  940.         else
  941.             return c.apply(this, arguments);
  942.     };
  943.     a.__prototyped = true;
  944.     return a;
  945. }
  946.  
  947. Function.prototype.mixin = function(){
  948.     var a = [this.prototype].concat(Array.prototype.slice.call(arguments));
  949.     Function.mixin.apply(null, a);
  950. };
  951. Function.mixin = function(){
  952.     for (var b = 1, a = arguments.length; b < a; ++b)
  953.         copy_properties(arguments[0], Mixins[arguments[b]] || arguments[b]);
  954. };
  955. Function.prototype.bind = function(b){
  956.     var a = [b, this].concat(Array.prototype.slice.call(arguments, 1));
  957.     return bind.apply(null, a);
  958. };
  959. Function.prototype.curry = Function.prototype.bind.bind(null, null);
  960. Function.prototype.shield = function(b){
  961.     if (typeof this != 'function')
  962.         throw new TypeException();
  963.     var a = this.bind.apply(this, $A(arguments));
  964.     return function(){
  965.         return a();
  966.     };
  967. };
  968. Function.prototype.defer = function(b, a){
  969.     if (typeof this != 'function')
  970.         throw new TypeError();
  971.     b = b || 0;
  972.     return setTimeout(this, b, a);
  973. };
  974. Function.prototype.recur = function(b, a){
  975.     if (typeof this != 'function')
  976.         throw new TypeError();
  977.     return setInterval(this, b, a);
  978. };
  979. function bagofholding(){
  980. }
  981.  
  982. function bagof(a){
  983.     return function(){
  984.         return a;
  985.     };
  986. }
  987.  
  988. function abstractMethod(){
  989.     throw new Error('You must implement this function in your base class.');
  990. }
  991.  
  992. function identity(a){
  993.     return a;
  994. }
  995.  
  996. var Mixins = {
  997.     Arbiter: {
  998.         _getArbiterInstance: function(){
  999.             return this._arbiter || (this._arbiter = new Arbiter());
  1000.         },
  1001.         inform: function(c, b, a){
  1002.             return this._getArbiterInstance().inform(c, b, a);
  1003.         },
  1004.         subscribe: function(c, a, b){
  1005.             return this._getArbiterInstance().subscribe(c, a, b);
  1006.         },
  1007.         unsubscribe: function(a){
  1008.             this._getArbiterInstance().unsubscribe(a);
  1009.         }
  1010.     }
  1011. };
  1012. var ua = {
  1013.     ie: function(){
  1014.         return ua._populate() || this._ie;
  1015.     },
  1016.     firefox: function(){
  1017.         return ua._populate() || this._firefox;
  1018.     },
  1019.     opera: function(){
  1020.         return ua._populate() || this._opera;
  1021.     },
  1022.     safari: function(){
  1023.         return ua._populate() || this._safari;
  1024.     },
  1025.     safariPreWebkit: function(){
  1026.         return ua._populate() || this._safari < 500;
  1027.     },
  1028.     chrome: function(){
  1029.         return ua._populate() || this._chrome;
  1030.     },
  1031.     windows: function(){
  1032.         return ua._populate() || this._windows;
  1033.     },
  1034.     osx: function(){
  1035.         return ua._populate() || this._osx;
  1036.     },
  1037.     linux: function(){
  1038.         return ua._populate() || this._linux;
  1039.     },
  1040.     iphone: function(){
  1041.         return ua._populate() || this._iphone;
  1042.     },
  1043.     _populated: false,
  1044.     _populate: function(){
  1045.         if (ua._populated)
  1046.             return;
  1047.         ua._populated = true;
  1048.         var a = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);
  1049.         var c = /(Mac OS X)|(Windows)|(Linux)/.exec(navigator.userAgent);
  1050.         var b = /\b(iPhone|iP[ao]d)/.exec(navigator.userAgent);
  1051.         if (a) {
  1052.             ua._ie = a[1] ? parseFloat(a[1]) : NaN;
  1053.             if (ua._ie >= 8 && !window.HTMLCollection)
  1054.                 ua._ie = 7;
  1055.             ua._firefox = a[2] ? parseFloat(a[2]) : NaN;
  1056.             ua._opera = a[3] ? parseFloat(a[3]) : NaN;
  1057.             ua._safari = a[4] ? parseFloat(a[4]) : NaN;
  1058.             if (ua._safari) {
  1059.                 a = /(?:Chrome\/(\d+\.\d+))/.exec(navigator.userAgent);
  1060.                 ua._chrome = a && a[1] ? parseFloat(a[1]) : NaN;
  1061.             }
  1062.             else
  1063.                 ua._chrome = NaN;
  1064.         }
  1065.         else
  1066.             ua._ie = ua._firefox = ua._opera = ua._chrome = ua._safari = NaN;
  1067.         if (c) {
  1068.             ua._osx = !!c[1];
  1069.             ua._windows = !!c[2];
  1070.             ua._linux = !!c[3];
  1071.         }
  1072.         else
  1073.             ua._osx = ua._windows = ua._linux = false;
  1074.         ua._iphone = b;
  1075.     }
  1076. };
  1077. OnloadEvent = {
  1078.     ONLOAD: 'onload/onload',
  1079.     ONLOAD_CALLBACK: 'onload/onload_callback',
  1080.     ONLOAD_DOMCONTENT: 'onload/dom_content_ready',
  1081.     ONLOAD_DOMCONTENT_CALLBACK: 'onload/domcontent_callback',
  1082.     ONBEFOREUNLOAD: 'onload/beforeunload',
  1083.     ONUNLOAD: 'onload/unload'
  1084. };
  1085. function _include_quickling_events_default(){
  1086.     return !window.loading_page_chrome;
  1087. }
  1088.  
  1089. function onbeforeunloadRegister(a, b){
  1090.     if (b === undefined)
  1091.         b = _include_quickling_events_default();
  1092.     b ? _addHook('onbeforeleavehooks', a) : _addHook('onbeforeunloadhooks', a);
  1093. }
  1094.  
  1095. function onunloadRegister(a){
  1096.     if (!window.onunload)
  1097.         window.onunload = function(){
  1098.             Arbiter.inform(OnloadEvent.ONUNLOAD, true, Arbiter.BEHAVIOR_STATE);
  1099.         };
  1100.     _addHook('onunloadhooks', a);
  1101. }
  1102.  
  1103. function onleaveRegister(a){
  1104.     _addHook('onleavehooks', a);
  1105. }
  1106.  
  1107. function _addHook(b, a){
  1108.     window[b] = (window[b] || []).concat(a);
  1109. }
  1110.  
  1111. function removeHook(a){
  1112.     window[a] = [];
  1113. }
  1114.  
  1115. function _domcontentready(){
  1116.     Arbiter.inform(OnloadEvent.ONLOAD_DOMCONTENT, true, Arbiter.BEHAVIOR_STATE);
  1117. }
  1118.  
  1119. function _bootstrapEventHandlers(){
  1120.     var a = document, d = window;
  1121.     if (a.addEventListener) {
  1122.         if (ua.safari() < 525) {
  1123.             var c = setInterval(function(){
  1124.                 if (/loaded|complete/.test(a.readyState)) {
  1125.                     _domcontentready();
  1126.                     clearInterval(c);
  1127.                 }
  1128.             }, 10);
  1129.         }
  1130.         else
  1131.             a.addEventListener("DOMContentLoaded", _domcontentready, true);
  1132.     }
  1133.     else {
  1134.         var b = 'javascript:void(0)';
  1135.         if (d.location.protocol == 'https:')
  1136.             b = '//:';
  1137.         a.write('<script onreadystatechange="if (this.readyState==\'complete\') {' + 'this.parentNode.removeChild(this);_domcontentready();}" ' + 'defer="defer" src="' + b + '"><\/script\>');
  1138.     }
  1139.     d.onload = function(){
  1140.         d.CavalryLogger && CavalryLogger.getInstance().setTimeStamp('t_layout');
  1141.         var e = a && a.body && a.body.offsetWidth;
  1142.         Arbiter.inform(OnloadEvent.ONLOAD, true, Arbiter.BEHAVIOR_STATE);
  1143.     };
  1144.     d.onbeforeunload = function(){
  1145.         var e = {};
  1146.         Arbiter.inform(OnloadEvent.ONBEFOREUNLOAD, e, Arbiter.BEHAVIOR_STATE);
  1147.         if (!e.warn)
  1148.             Arbiter.inform('onload/exit', true);
  1149.         return e.warn;
  1150.     };
  1151. }
  1152.  
  1153. onload_callback = Arbiter.registerCallback(function(){
  1154.     window.CavalryLogger && CavalryLogger.getInstance().setTimeStamp('t_onload');
  1155.     Arbiter.inform(OnloadEvent.ONLOAD_CALLBACK, true, Arbiter.BEHAVIOR_STATE);
  1156. }, [OnloadEvent.ONLOAD]);
  1157. domcontent_callback = Arbiter.registerCallback(function(){
  1158.     window.CavalryLogger && CavalryLogger.getInstance().setTimeStamp('t_domcontent');
  1159.     Arbiter.inform(OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK, true, Arbiter.BEHAVIOR_STATE);
  1160. }, [OnloadEvent.ONLOAD_DOMCONTENT]);
  1161. if (!window._eventHandlersBootstrapped) {
  1162.     _eventHandlersBootstrapped = true;
  1163.     _bootstrapEventHandlers();
  1164. }
  1165. function tx(b, a){
  1166.     if (typeof _string_table == 'undefined')
  1167.         return;
  1168.     b = _string_table[b];
  1169.     return _tx(b, a);
  1170. }
  1171.  
  1172. function intl_ends_in_punct(a){
  1173.     if (typeof a != 'string')
  1174.         return false;
  1175.     return a.match(new RegExp(intl_ends_in_punct.punct_char_class + '[' + ')"' + "'" + '\u00BB' + '\u0F3B' + '\u0F3D' + '\u2019' + '\u201D' + '\u203A' + '\u3009' + '\u300B' + '\u300D' + '\u300F' + '\u3011' + '\u3015' + '\u3017' + '\u3019' + '\u301B' + '\u301E' + '\u301F' + '\uFD3F' + '\uFF07' + '\uFF09' + '\uFF3D' + '\s' + ']*$'));
  1176. }
  1177.  
  1178. intl_ends_in_punct.punct_char_class = '[' + '.!?' + '\u3002' + '\uFF01' + '\uFF1F' + '\u0964' + '\u2026' + '\u0EAF' + '\u1801' + '\u0E2F' + '\uFF0E' + ']';
  1179. function intl_render_list_separator(){
  1180.     return _tx("{previous-items}, {next-items}", {
  1181.         'previous-items': '',
  1182.         'next-items': ''
  1183.     });
  1184. }
  1185.  
  1186. function intl_phonological_rules(e){
  1187.     var c, b = e, d = window.intl_locale_rewrites;
  1188.     try {
  1189.         if (d) {
  1190.             var pats = [], reps = [];
  1191.             for (var p in d.patterns) {
  1192.                 var pat = p, rep = d.patterns[p];
  1193.                 for (var m in d.meta) {
  1194.                     c = new RegExp(m.slice(1, -1), 'g');
  1195.                     pat = pat.replace(c, d.meta[m]);
  1196.                     rep = rep.replace(c, d.meta[m]);
  1197.                 }
  1198.                 pats[pats.length] = pat;
  1199.                 reps[reps.length] = rep;
  1200.             }
  1201.             for (var ii = 0; ii < pats.length; ii++) {
  1202.                 c = new RegExp(pats[ii].slice(1, -1), 'g');
  1203.                 if (reps[ii] == 'javascript') {
  1204.                     if (m = new String(e.match(c)))
  1205.                         e = e.replace(c, m.slice(1).toLowerCase());
  1206.                 }
  1207.                 else
  1208.                     e = e.replace(c, reps[ii]);
  1209.             }
  1210.         }
  1211.     }
  1212.     catch (a) {
  1213.         e = b;
  1214.     }
  1215.     c = new RegExp('\x01', 'g');
  1216.     e = e.replace(c, '');
  1217.     return e;
  1218. }
  1219.  
  1220. function _tx(e, a){
  1221.     if (a)
  1222.         if (!(typeof a != 'object')) {
  1223.             var d;
  1224.             for (var c in a) {
  1225.                 if (intl_ends_in_punct(a[c])) {
  1226.                     d = new RegExp('\{' + c + '\}' + intl_ends_in_punct.punct_char_class + '*', 'g');
  1227.                 }
  1228.                 else
  1229.                     d = new RegExp('\{' + c + '\}', 'g');
  1230.                 var b = '';
  1231.                 if (a[c][0] != '~')
  1232.                     b = '\x01';
  1233.                 e = e.replace(d, b + a[c] + b);
  1234.             }
  1235.             e = intl_phonological_rules(e);
  1236.         }
  1237.     return e;
  1238. }
  1239.  
  1240. InitialJSLoader = {
  1241.     INITIAL_JS_READY: 'BOOTLOAD/JSREADY',
  1242.     load: function(a){
  1243.         InitialJSLoader.callback = Bootloader.loadResources(a, InitialJSLoader.callback);
  1244.     },
  1245.     callback: Arbiter.registerCallback(function(){
  1246.         Arbiter.inform(InitialJSLoader.INITIAL_JS_READY, true, Arbiter.BEHAVIOR_STATE);
  1247.     }, [OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK])
  1248. };
  1249. function goURI(b, a){
  1250.     b = b.toString();
  1251.     if (!a && window.PageTransitions && PageTransitions.isInitialized()) {
  1252.         PageTransitions.go(b);
  1253.     }
  1254.     else
  1255.         if (window.location.href == b) {
  1256.             window.location.reload();
  1257.         }
  1258.         else
  1259.             window.location.href = b;
  1260. }
  1261.  
  1262. function loadExternalJavascript(f, b, a){
  1263.     if (f instanceof Array) {
  1264.         var e = f.shift(0);
  1265.         if (e) {
  1266.             loadExternalJavascript(e, function(){
  1267.                 if (f.length) {
  1268.                     loadExternalJavascript(f, b, a);
  1269.                 }
  1270.                 else
  1271.                     b && b();
  1272.             }, a);
  1273.         }
  1274.         else
  1275.             if (b)
  1276.                 b();
  1277.     }
  1278.     else {
  1279.         var c = a ? document.body : document.getElementsByTagName('head')[0];
  1280.         var d = document.createElement('script');
  1281.         d.type = 'text/javascript';
  1282.         d.src = f;
  1283.         if (b) {
  1284.             d.onerror = d.onload = b;
  1285.             d.onreadystatechange = function(){
  1286.                 if (this.readyState == "complete" || this.readyState == "loaded")
  1287.                     b();
  1288.             };
  1289.         }
  1290.         c.appendChild(d);
  1291.         return d;
  1292.     }
  1293. }
  1294.  
  1295. function invoke_callbacks(b, d){
  1296.     if (b)
  1297.         for (var c = 0; c < b.length; c++)
  1298.             try {
  1299.                 (new Function(b[c])).apply(d);
  1300.             }
  1301.             catch (a) {
  1302.             }
  1303. }
  1304.  
  1305. var KEYS = {
  1306.     BACKSPACE: 8,
  1307.     TAB: 9,
  1308.     RETURN: 13,
  1309.     ESC: 27,
  1310.     SPACE: 32,
  1311.     PAGE_UP: 33,
  1312.     PAGE_DOWN: 34,
  1313.     LEFT: 37,
  1314.     UP: 38,
  1315.     RIGHT: 39,
  1316.     DOWN: 40,
  1317.     DELETE: 46,
  1318.     COMMA: 188
  1319. };
  1320. function BigPipe(a){
  1321.     copy_properties(this, {
  1322.         arbiter: Arbiter,
  1323.         rootNodeID: 'content',
  1324.         lid: 0,
  1325.         isAjax: false,
  1326.         isReplay: false,
  1327.         rrEnabled: true,
  1328.         domContentCallback: domcontent_callback,
  1329.         onloadCallback: onload_callback,
  1330.         domContentEvt: OnloadEvent.ONLOAD_DOMCONTENT_CALLBACK,
  1331.         onloadEvt: OnloadEvent.ONLOAD_CALLBACK,
  1332.         _phaseDoneCallbacks: [],
  1333.         _currentPhase: 0,
  1334.         _lastPhase: -1,
  1335.         _timeout: 20
  1336.     });
  1337.     copy_properties(this, a);
  1338.     this._cavalry = (this.lid && window.CavalryLogger) ? CavalryLogger.getInstance(this.lid) : null;
  1339.     this._inst = this._cavalry && (window._pagelet_profile || this._cavalry.isPageletProfiler());
  1340.     BigPipe._current_instance = this;
  1341.     if (window.env_get && env_get('tti_vision') === 1)
  1342.         (new TTIVisualizer(this)).init();
  1343.     this.arbiter.registerCallback(this.domContentCallback, ['pagelet_displayed_all']);
  1344.     this.arbiter.inform('phase_begin_0', true, Arbiter.BEHAVIOR_STATE);
  1345.     this._inst && this._cavalry.setTimeStamp('t_phase_begin_0');
  1346. }
  1347.  
  1348. copy_properties(BigPipe.prototype, {
  1349.     _ct: function(a){
  1350.         return (!a || 'length' in a && a.length === 0) ? {} : a;
  1351.     },
  1352.     _displayPagelet: function(d){
  1353.         for (var c in this._ct(d.content)) {
  1354.             if (d.append) {
  1355.                 if (d.append === 'bigpipe_root') {
  1356.                     target_id = this.rootNodeID;
  1357.                 }
  1358.                 else
  1359.                     target_id = d.append;
  1360.             }
  1361.             else
  1362.                 target_id = c;
  1363.             var b = document.getElementById(target_id);
  1364.             var a = d.content[c];
  1365.             if (b) {
  1366.                 if (a)
  1367.                     if (d.append || ua.ie() < 8) {
  1368.                         if (!d.append)
  1369.                             while (b.firstChild)
  1370.                                 b.removeChild(b.firstChild);
  1371.                         this._appendNodes(b, a);
  1372.                     }
  1373.                     else
  1374.                         b.innerHTML = a;
  1375.                 if (this._inst)
  1376.                     this._cavalry.onPageletEvent('display', d.id);
  1377.             }
  1378.             else
  1379.                 window.Util && false;
  1380.         }
  1381.         this.arbiter.inform(d.id + '_displayed', true, Arbiter.BEHAVIOR_STATE);
  1382.     },
  1383.     _appendNodes: function(a, d){
  1384.         var e = document.createElement('div');
  1385.         var c = ua.ie() < 7;
  1386.         if (c)
  1387.             a.appendChild(e);
  1388.         e.innerHTML = d;
  1389.         var b = document.createDocumentFragment();
  1390.         while (e.firstChild)
  1391.             b.appendChild(e.firstChild);
  1392.         a.appendChild(b);
  1393.         if (c)
  1394.             a.removeChild(e);
  1395.     },
  1396.     _downloadJsForPagelet: function(a){
  1397.         Bootloader.loadResources(a.js, bind(this, function(){
  1398.             if (this._inst)
  1399.                 this._cavalry.onPageletEvent('jsdone', a.id);
  1400.             if (!this.isAjax || a.phase >= 1)
  1401.                 a.requires.push('uipage_onload');
  1402.             var c = bind(this, function(){
  1403.                 if (!this._isRelevant())
  1404.                     return;
  1405.                 invoke_callbacks(a.onload);
  1406.                 if (this._inst)
  1407.                     this._cavalry.onPageletEvent('onload', a.id);
  1408.                 this.arbiter.inform('pagelet_onload', true, Arbiter.BEHAVIOR_EVENT);
  1409.                 if (a.page_cache) {
  1410.                     if (!a.id && this.isAjax)
  1411.                         a.html = $("content").innerHTML;
  1412.                     Quickling.cacheAndExecResponse(a, true);
  1413.                 }
  1414.                 a.provides && this.arbiter.inform(a.provides, true, Arbiter.BEHAVIOR_STATE);
  1415.             });
  1416.             var b = bind(this, function(){
  1417.                 this._isRelevant() && invoke_callbacks(a.onafterload);
  1418.             });
  1419.             this.arbiter.registerCallback(c, a.requires);
  1420.             this.arbiter.registerCallback(b, [this.onloadEvt]);
  1421.         }), false, a.id);
  1422.     },
  1423.     _downloadCssAndDisplayPagelet: function(b){
  1424.         if (this._inst)
  1425.             this._cavalry.onPageletEvent('css', b.id);
  1426.         var a = bind(this, function(){
  1427.             var c = b.display_dependency || [];
  1428.             var e = [];
  1429.             for (var d = 0; d < c.length; d++)
  1430.                 e.push(c[d] + '_displayed');
  1431.             this.arbiter.registerCallback(this._displayPagelet.bind(this, b), e);
  1432.         });
  1433.         if (this.isReplay) {
  1434.             Bootloader.loadResources(b.css, null, false, b.id);
  1435.             a();
  1436.         }
  1437.         else
  1438.             Bootloader.loadResources(b.css, a, false, b.id);
  1439.     },
  1440.     onPageletArrive: function(b){
  1441.         if (this._inst)
  1442.             this._cavalry.onPageletEvent('arrive', b.id);
  1443.         var c = b.phase;
  1444.         if (!this._phaseDoneCallbacks[c])
  1445.             this._phaseDoneCallbacks[c] = this.arbiter.registerCallback(this._onPhaseDone.bind(this), ['phase_complete_' + c]);
  1446.         if (b.the_end)
  1447.             this._lastPhase = b.phase;
  1448.         if (b.tti_phase !== undefined)
  1449.             this._ttiPhase = b.tti_phase;
  1450.         Bootloader.setResourceMap(b.resource_map);
  1451.         Bootloader.enableBootload(this._ct(b.bootloadable));
  1452.         this.arbiter.registerCallback(this._downloadCssAndDisplayPagelet.bind(this, b), ['phase_begin_' + c]);
  1453.         var a;
  1454.         if (!this.jsNonBlock) {
  1455.             a = this.domContentEvt;
  1456.         }
  1457.         else
  1458.             a = b.id + '_displayed';
  1459.         this.arbiter.registerCallback(this._downloadJsForPagelet.bind(this, b), [a]);
  1460.         this.onloadCallback = this.arbiter.registerCallback(this.onloadCallback, ['pagelet_onload']);
  1461.         this.arbiter.registerCallback(this._phaseDoneCallbacks[c], [b.id + '_displayed']);
  1462.         b.is_last && this.arbiter.inform('phase_complete_' + c, true, Arbiter.BEHAVIOR_STATE);
  1463.         b.invalidate_cache && b.invalidate_cache.length && Arbiter.inform(Arbiter.PAGECACHE_INVALIDATE, b.invalidate_cache);
  1464.     },
  1465.     _onPhaseDone: function(){
  1466.         if (this._currentPhase === this._ttiPhase && this.rrEnabled) {
  1467.             this.arbiter.inform('tti_bigpipe', {
  1468.                 s: this.lid
  1469.             }, Arbiter.BEHAVIOR_EVENT);
  1470.             this._cavalry && this._cavalry.measurePageLoad(true);
  1471.         }
  1472.         var b = this._currentPhase + 1;
  1473.         var a = bind(this, function(){
  1474.             this._inst && this._cavalry.setTimeStamp('t_phase_begin_' + b);
  1475.             this.arbiter.inform('phase_begin_' + b, true, Arbiter.BEHAVIOR_STATE);
  1476.         });
  1477.         if (this.isReplay) {
  1478.             a();
  1479.         }
  1480.         else
  1481.             setTimeout(a, this._timeout);
  1482.         if (this._currentPhase === this._lastPhase)
  1483.             this.arbiter.inform('pagelet_displayed_all', true, Arbiter.BEHAVIOR_STATE);
  1484.         this._currentPhase++;
  1485.     },
  1486.     _isRelevant: function(){
  1487.         return this == BigPipe._current_instance || this.isReplay || this.jsNonBlock;
  1488.     }
  1489. });
  1490. function incorporate_fragment(a, b){
  1491.     if (b && a.pathname == '/')
  1492.         return;
  1493.     var d = /^(?:(?:[^:\/?#]+):)?(?:\/\/(?:[^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/;
  1494.     var c = '';
  1495.     a.href.replace(d, function(e, h, i, g){
  1496.         var f, j;
  1497.         f = j = h + (i ? '?' + i : '');
  1498.         if (g) {
  1499.             g = g.replace(/^(!|%21)/, '');
  1500.             if (g.charAt(0) == '/')
  1501.                 f = g.replace(/^\/+/, '/');
  1502.         }
  1503.         f = b + f;
  1504.         if (f != j)
  1505.             window.location.replace(c + f);
  1506.     });
  1507. }
  1508.  
  1509. if (window._is_quickling_index !== undefined)
  1510.     incorporate_fragment(window.location, window._is_quickling_index);
  1511. !function(){
  1512.     var c = document.documentElement;
  1513.     var b = 'child_focused';
  1514.     var d = 'DOMControl_placeholder';
  1515.     var a = function(e){
  1516.         e = e || window.event;
  1517.         var f = e.target || e.srcElement, h = f.getAttribute('placeholder');
  1518.         if (h) {
  1519.             var g = Parent.byClass(f, 'focus_target');
  1520.             if ('focus' == e.type || 'focusin' == e.type) {
  1521.                 if (f.value == h) {
  1522.                     f.value = '';
  1523.                     CSS.removeClass(f, d);
  1524.                     g && CSS.addClass(g, b);
  1525.                 }
  1526.             }
  1527.             else
  1528.                 if (f.value == '') {
  1529.                     CSS.addClass(f, d);
  1530.                     f.value = h;
  1531.                     g && CSS.removeClass(g, b);
  1532.                 }
  1533.         }
  1534.     };
  1535.     c.onfocusin = c.onfocusout = a;
  1536.     if (c.addEventListener) {
  1537.         c.addEventListener('focus', a, true);
  1538.         c.addEventListener('blur', a, true);
  1539.     }
  1540. }();
  1541. !function(){
  1542.     document.documentElement.onkeydown = function(a){
  1543.         a = a || window.event;
  1544.         var b = a.target || a.srcElement;
  1545.         var c = a.keyCode == KEYS.RETURN && !a.shiftKey && CSS.hasClass(b, 'enter_submit');
  1546.         if (c) {
  1547.             Bootloader.loadComponents(['dom', 'input-methods'], function(){
  1548.                 if (!Input.isEmpty(b)) {
  1549.                     var d = DOM.scry(b.form, '.enter_submit_target')[0] || DOM.scry(b.form, '[type="submit"]')[0];
  1550.                     d && d.click();
  1551.                 }
  1552.             });
  1553.             return false;
  1554.         }
  1555.     };
  1556. }();
  1557. function fc_click(a, b){
  1558.     user_action(a, 'ufi');
  1559.     fc_expand(a, b);
  1560. }
  1561.  
  1562. function fc_expand(a, b){
  1563.     var c = a.form;
  1564.     CSS.removeClass(c, 'collapsed_comments');
  1565.     CSS.removeClass(c, 'hidden_add_comment');
  1566.     if (b !== false)
  1567.         c.add_comment_text.focus();
  1568.     return false;
  1569. }
  1570.  
  1571. if (window.Bootloader) {
  1572.     Bootloader.done(["js\/bmq929sp95w04swo.pkg.js"]);
  1573. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement