/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  January 26th 2010 7:47:49 PM PST                             */
/*      Machine:  10.16.139.103                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/live_timer.js h:a23izaoo                                  */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/live_timer.js                                             */

if (window.CavalryLogger) { CavalryLogger.start_js(["js\/live_timer.js"]); }

var LiveTimer={restart:function(a){this.stop();this.serverTime=a;this.offset=0;this.delay=20000;this.timeout=setTimeout(function(){LiveTimer.updateTimeStamps();LiveTimer.loop();},this.delay);},updateTimeStamps:function(){LiveTimer.timestamps=DOM.scry(document.body,'abbr.timestamp');},stop:function(){clearTimeout(this.timeout);},loop:function(){LiveTimer.offset+=LiveTimer.delay/1000;var a=-1;LiveTimer.timestamps.each(function(d){var c=+new Date(d.getAttribute('title'))/1000;var b=LiveTimer.renderRelativeTime(LiveTimer.serverTime+LiveTimer.offset,c);if(b.text)DOM.setText(d,b.text);if(b.next!=-1&&(b.next<a||a==-1))a=b.next;});if(a!=-1){LiveTimer.delay=Math.max(20000,a*1000);LiveTimer.timeout=setTimeout(function(){LiveTimer.loop();},LiveTimer.delay);}},renderRelativeTime:function(c,d){var e={text:"",next:-1};if(c-d>(12*3600)||(new Date(c*1000).getDay()!=new Date(d*1000).getDay()))return e;var f=c-d,b=Math.floor(f/60),a=Math.floor(b/60);if(b<1){e.next=60-f%60;return e;}if(a<1){if(b==1){e.text=_tx("about a minute ago");}else e.text=_tx("{number} minutes ago",{number:b});e.next=60-f%60;return e;}if(a!=11)e.next=3600-f%3600;if(a==1){e.text=_tx("about an hour ago");return e;}e.text=_tx("{number} hours ago",{number:a});return e;}};

if (window.Bootloader) { Bootloader.done(["js\/live_timer.js"]); }