text: /*    HTTP Host:  static.ak.fbcdn.net                                          */
  /*    Generated:  April 21st 2009 10:05:15 AM PDT                              */
  /*      Machine:  10.16.140.109                                                */
  /*       Source:  Local Cache                                                  */
  /*     Location:  rsrc:95ioo55e:en_US:/html/js/bvpncaz74l4wggk8.pkg.js:141     */
  /*       Locale:  en_US                                                        */
  /*         Path:  js/bvpncaz74l4wggk8.pkg.js                                   */
  
  
  function UINav(controller,item_data,data){this.controller=controller;this.data=data;copy_properties(this,{controller:controller,data:data,items:[],selectedItem:null,selectedClass:this.selectedClass||''});this.initializeItems(item_data);}
  UINav.instances={};UINav.prototype.getItemContainers=abstractMethod;UINav.prototype.getItemLinks=abstractMethod;UINav.prototype.getItems=function(){return this.items;}
  UINav.prototype.initializeItems=function(item_data){var containers=this.getItemContainers();var links=this.getItemLinks();for(var i=0;i<containers.length;i++){var item={'container':containers[i],'link':links[i],'data':(item_data[i]||{})};this.items.push(item);if(CSS.hasClass(item.container,this.selectedClass)){this.selectedItem=item;}
  item.addClickHandler=this.addClickHandler.bind(this,item);item.addClickHandler(this.selectItem.bind(this,item));}}
  UINav.prototype.selectItem=function(item){if(item==this.selectedItem){return;}
  if(this.selectedItem){CSS.removeClass(this.selectedItem.container,this.selectedClass);}
  if(item){CSS.addClass(item.container,this.selectedClass);}
  this.selectedItem=item;}
  UINav.prototype.deselectAll=function(){if(this.selectedItem){CSS.removeClass(this.selectedItem.container,this.selectedClass);}
  this.selectedItem=null;}
  UINav.prototype.getSelectedItem=function(){return this.selectedItem;}
  UINav.prototype.addClickHandler=function(item,handler){if(typeof item=='function'){handler=item;this.getItems().each(function(handler,item){this.addClickHandler(item,handler);}.bind(this,handler));return true;}else{return Event.listen(item.link,'click',handler);}}
  function UINavGeneric(controller,item_data,data){this.parent.construct(this,controller,item_data,data);}
  UINavGeneric.extend('UINav');UINavGeneric.prototype.getItemContainers=function(){if(!this.containers){this.containers=DOM.scry(this.controller,'li');}
  return this.containers;}
  UINavGeneric.prototype.getItemLinks=function(){if(!this.containerLinks){this.containerLinks=DOM.scry(this.controller,'li a');}
  return this.containerLinks;}
  function UITabStructure(controller,item_data,data){this.selectedClass='UITabStructure_TabSelected';this.parent.construct(this,controller,item_data,data);}
  UITabStructure.extend('UINavGeneric');UITabStructure.prototype.getItemContainers=function(){if(!this.tab_containers){this.tab_containers=[];var li_elements=DOM.scry(this.controller,'li');for(var i=0;i<li_elements.length;i++){this.tab_containers.push(li_elements[i].childNodes[0]);}}
  return this.tab_containers;}
  function UISourceList(controller,item_data,data){this.selectedClass='UISourceList_ItemSelected';this.parent.construct(this,controller,item_data,data);}
  UISourceList.extend('UINavGeneric');function UIFilterList(controller,item_data,data){this.selectedClass='UIObject_SelectedItem';this.parent.construct(this,controller,item_data,data);this._editIconHandler=bagofholding;var items=this.getItems();for(var i=0;i<items.length;i++){var link=items[i].link;if(CSS.hasClass(link,'UIFilterList_HasEditIcon')){var edit_icon=DOM.find(link,'span.UIFilterList_EditIcon');if(edit_icon){edit_icon.listen('mouseover',function(icon){CSS.addClass(icon,'UIFilterList_EditIconHover');}.bind(null,edit_icon));edit_icon.listen('mouseout',function(icon){CSS.removeClass(icon,'UIFilterList_EditIconHover');}.bind(null,edit_icon));edit_icon.listen('click',function(data){this._editIconHandler(data);return false;}.bind(this,items[i]['data']));}}}}
  UIFilterList.extend('UINav');UIFilterList.prototype.getItemContainers=function(){if(!this.containers){this.containers=DOM.scry(this.controller,'div.UIFilterList_Item');}
  return this.containers;}
  UIFilterList.prototype.getItemLinks=function(){if(!this.containerLinks){this.containerLinks=DOM.scry(this.controller,'div.UIFilterList_Item a');}
  return this.containerLinks;}
  UIFilterList.prototype.setEditIconHandler=function(handler){this._editIconHandler=handler;return this;}
  UIFilterList.prototype.setLoading=function(loading){CSS.conditionClass(this.controller,'UIFilterList_Loading',loading);}
  UIFilterList.prototype.addItem=function(title,href,pos,icon,data){if(!pos){pos=0;}
  data=data?data:{};var main_div=$N('div',{className:'UIFilterList_Item'});var link=$N('a',{className:'UIFilterList_ItemLink',href:href});if(icon){main_div.addClass('UIFilterList_HasIcon');var icon_span=$N('span',{className:'UIFilterList_Icon'});icon_span.setStyle('backgroundImage','url('+icon+')');link.appendContent(icon_span);}
  link.appendContent($N('span',{className:'UIFilterList_Title'},title));var loading=$N('span',{className:'UIFilterList_LoadingIndicator'});var right=$N('span',{className:'UIFilterList_ItemRight'});main_div.setContent([link,loading,right]);if(pos==0){main_div.addClass('UIFilterList_FirstItem');this.getItems()[0].container.removeClass('UIFilterList_FirstItem');}else if(pos==(this.getItems().length)){main_div.addClass('UIFilterList_LastItem');this.getItems()[this.getItems().length-1].container.removeClass('UIFilterList_LasttItem');}
  var item={container:main_div,link:link,data:data};DOM.insertBefore(main_div,this.getItems()[pos].container);this.getItems().splice(pos,0,item);this.getItemContainers().splice(pos,0,item.container);this.getItemLinks().splice(pos,0,item.link);return item;}
  UIFilterList.prototype.setItemTitle=function(item,title){var title_span=DOM.find(item.link,'span.UIFilterList_Title');title_span.setContent(title);}
  UIFilterList.prototype.removeItem=function(item){var items=this.getItems();if(items.length==1){Util.log('Can\'t remove item because it is the only one left.');return;}
  var item_index=null;for(var i=0;i<items.length;i++){if(items[i]==item){item_index=i;break;}}
  if(item_index!=null){if(this.selectedItem==item){this.selectItem(null);}
  this.getItemContainers().splice(item_index,1);this.getItemLinks().splice(item_index,1);this.getItems().splice(item_index,1);DOM.remove(item.container);}}
  
  function UIMutableFilterList(controller,item_data,num_visible,data){this.showLink=controller.find('a.UIMutableFilterList_Show');this.hideLink=controller.find('a.UIMutableFilterList_Hide');this.hiddenContainer=controller.find('div.UIMutableFilterList_HiddenSection');this.showLink.listen('click',this.showBottom.bind(this));this.hideLink.listen('click',this.hideBottom.bind(this));this.emptyMsg=controller.find('div.UIMutableFilterList_EmptyMsg');this.orderMsg=controller.find('div.UIMutableFilterList_OrderMsg');this.bottomShown=this.showLink.hasClass('hidden_elem');this.numVisible=num_visible;return this.parent.construct(this,controller,item_data,data);}
  UIMutableFilterList.extend('UIFilterList');UIMutableFilterList.prototype.setOrderChangedHandler=function(handler){this.orderChangedHandler=handler;return this;}
  UIMutableFilterList.prototype.getOrderedItems=function(){var ordered={};ordered.shown=[];ordered.hidden=[];var top_order=this.topGroup.getOrder();for(var i=0;i<top_order.length;i++){if(this.getItems()[top_order[i]]){ordered.shown.push(this.getItems()[top_order[i]].data);}}
  var bottom_order=this.bottomGroup.getOrder();for(var i=0;i<bottom_order.length;i++){if(this.getItems()[bottom_order[i]]){ordered.hidden.push(this.getItems()[bottom_order[i]].data);}}
  return ordered;}
  UIMutableFilterList.prototype.initializeItems=function(item_data){var LIMIT_TO_SHOW_MORE_SECTION=3;var ongrabcallback=function(i){if(CSS.hasClass(this.showLink,'hidden_elem')&&CSS.hasClass(this.hideLink,'hidden_elem')&&this.getItemContainers().length>LIMIT_TO_SHOW_MORE_SECTION){this.showBottom();CSS.addClass(this.orderMsg,'hidden_elem');}
  CSS.setOpacity(this.getItemContainers()[i],0.5);Vector2.getElementDimensions(this.getItemContainers()[i]).sub(4,0).setElementWidth(this.getItemContainers()[i]);}.bind(this);var ondropcallback=function(i){if(!CSS.hasClass(this.emptyMsg,'hidden_elem')){this.hideBottom();CSS.addClass(this.showLink,'hidden_elem');}
  CSS.setOpacity(this.getItemContainers()[i],1);this.fixItemClasses();this.setBoundingBox(this.getCurrentBoundingBox());}.bind(this);this.topGroup=new SortableGroup();this.topGroup.setGrabCallback(ongrabcallback);this.topGroup.setDropCallback(ondropcallback);this.topGroup.setOrderChangeHandler(this.orderChanged.bind(this));this.bottomGroup=new SortableGroup();this.bottomGroup.setGrabCallback(ongrabcallback);this.bottomGroup.setDropCallback(ondropcallback);this.bottomGroup.setOrderChangeHandler(this.orderChanged.bind(this));this.topGroup.link(this.bottomGroup);var items=this.getItemContainers();var link_items=this.getItemLinks();for(var i=0;i<items.length;i++){if(i<this.numVisible){this.topGroup.addSortable(i,items[i]);this.topGroup.draggables[i].addHandle(link_items[i]);this.topGroup.draggables[i].addHandle(items[i]);}else{this.bottomGroup.addSortable(i,items[i]);this.bottomGroup.draggables[i].addHandle(link_items[i]);this.bottomGroup.draggables[i].addHandle(items[i]);}}
  var root=this.hiddenContainer.find('div.UIFilterList_List');this.bottomGroup.addEmptyMessage(this.emptyMsg,root);this.bottomGroup.setLinkJumpHandler(function(){if(root.childNodes.length>1){CSS.addClass(this.emptyMsg,'hidden_elem');}else{CSS.removeClass(this.emptyMsg,'hidden_elem');CSS.addClass(this.orderMsg,'hidden_elem');}}.bind(this));this.topGroup.setNeverEmpty(true);this.orderChangedHandler=bagofholding;this.setBoundingBox(this.getCurrentBoundingBox());return this.parent.initializeItems(item_data);}
  UIMutableFilterList.prototype.orderChanged=function(){this.orderChangedHandler(this.getOrderedItems());}
  UIMutableFilterList.prototype.fixItemClasses=function(){var top_length=this.topGroup.getOrder().length;var items=this.controller.scry('div.UIFilterList_Item');for(var i=0;i<items.length;i++){if(i<top_length){var first=(i==0);var last=(i==top_length-1);}else{var first=(i==top_length);var last=(i==items.length-1);}
  CSS.removeClass(items[i],'UIFilterList_FirstItem');CSS.removeClass(items[i],'UIFilterList_LastItem');if(first){CSS.addClass(items[i],'UIFilterList_FirstItem');}
  if(last){CSS.addClass(items[i],'UIFilterList_LastItem');}}}
  UIMutableFilterList.prototype.setBoundingBox=function(bounding_box){this.bottomGroup.setBoundingBox(bounding_box);this.topGroup.setBoundingBox(bounding_box);}
  UIMutableFilterList.prototype.getCurrentBoundingBox=function(){var items=this.controller.scry('div.UIFilterList_Item');var top_item_pos=Vector2.getElementCompassPoint(items[0],Vector2.compass.north);var bounding_top=top_item_pos.y;var bounding_left=0;if(this.bottomShown){var last_item=items.length-1;}else{var last_item=this.topGroup.getOrder().length-1;}
  var bottom_item_pos=Vector2.getElementCompassPoint(items[last_item],Vector2.compass.south);var bounding_right=0;var bounding_bottom=bottom_item_pos.y;return new Rect(bounding_top,bounding_right,bounding_bottom,bounding_left,'document');}
  UIMutableFilterList.prototype.showBottom=function(){this.hiddenContainer.setStyle('height','0px');this.hiddenContainer.removeClass('hidden_elem');animation(this.hiddenContainer).to('height','auto').from('opacity',0).to('opacity',1).ease(animation.ease.both).duration(200).ondone(function(){this.bottomShown=true;this.setBoundingBox(this.getCurrentBoundingBox());}.bind(this)).go();this.showLink.addClass('hidden_elem');this.hideLink.removeClass('hidden_elem');return false;}
  UIMutableFilterList.prototype.hideBottom=function(){animation(this.hiddenContainer).to('height','0px').from('opacity',1).to('opacity',0).ease(animation.ease.both).duration(200).ondone(function(){this.bottomShown=false;this.setBoundingBox(this.getCurrentBoundingBox());this.hiddenContainer.addClass('hidden_elem');}.bind(this)).go();this.showLink.removeClass('hidden_elem');this.hideLink.addClass('hidden_elem');return false;}
  
  var FriendListManagerBootstrap={FRIEND_LISTS_CHANGED:'flm_friend_lists_changed',bootstrap:function(selectedList,showCreate){var data={};if(selectedList){data['selected_list']=selectedList;}else if(showCreate){data['show_create']=1;}
  var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/friend_lists/manager.php').setData(data);new Dialog().setAsync(async).setButtons(Dialog.OK).setModal().show();return false;}}
  
  function UIHomeFilter(root,assoc_id,item_data,num_visible,data,stream,composer){this.parent.construct(this,root,item_data,num_visible,data);copy_properties(this,{root:root,stream:stream,composer:composer,assoc_id:assoc_id});UIHomeFilter.activate(this,this.stream.getID());var clickHandler=function(){UIHomeFilter.active[this.stream.getID()].each(function(filter){if(this!==filter){filter.deselectAll();}}.bind(this));}.bind(this);this.addClickHandler(clickHandler);this.setOrderChangedHandler(UIHomeFilter.filterOrderChanged.bind(this));var transitionHandler=UIHomeFilter.handlePageTransition.bind(this);PageTransitions.registerHandler(transitionHandler);Arbiter.subscribe(FriendListManagerBootstrap.FRIEND_LISTS_CHANGED,this._listsChanged.bind(this),Arbiter.SUBSCRIBE_NEW);}
  UIHomeFilter.extend('UIMutableFilterList');UIHomeFilter.prototype={_listsChanged:function(message,data){if(message==FriendListManagerBootstrap.FRIEND_LISTS_CHANGED){if(data.latest_list){var data={new_key:'fl'+'_'+data.latest_list,id:this.assoc_id};new AsyncRequest().setURI('/ajax/filterlist.php').setData(data).setHandler(function(new_key){goURI(URI('/home.php').addQueryData({filter:new_key}),true);}.bind(null,data.new_key)).send();}else{goURI(URI('/home.php'),true);}}}};UIHomeFilter.handlePageTransition=function(uri){var extraData=uri.getQueryData();if(extraData.disable_nile||extraData.ref||!(uri.getPath()=='/nile.php'||uri.getPath()=='/home.php')){return false;}
  var filter=extraData.filter;if(this.composer){var app_id=0;if(filter&&filter.startsWith('app_')){app_id=parseInt(filter.substr(4),10);}
  this.composer.loadAttachment(app_id);}
  this.stream.refresh(UIIntentionalStream.REFRESH_TRANSITION,extraData);return true;};UIHomeFilter.activate=function(filter,streamID){if(!UIHomeFilter.active[streamID]){UIHomeFilter.active[streamID]=[];}
  UIHomeFilter.active[streamID].push(filter);};UIHomeFilter.active={};UIHomeFilter.filterOrderChanged=function(ordered){var shown=[];var hidden=[];for(var i=0;i<ordered.shown.length;i++){shown.push(ordered.shown[i]['filter']);}
  for(var i=0;i<ordered.hidden.length;i++){hidden.push(ordered.hidden[i]['filter']);}
  var postData={};postData.order=[];postData.visible=shown.length;postData.id=this.assoc_id;postData.order=shown.concat(hidden);new AsyncRequest().setURI('/ajax/filterlist.php').setData(postData).setHandler(bagofholding).send();};
  
  function AdsFeedback(container){this.ad_container=container;this.feedback_div=DOM.find(this.ad_container,'div.ads_feedback');this.thumbs_up=DOM.find(this.ad_container,'a.thumbs_up');this.thumbs_dn=DOM.find(this.ad_container,'a.thumbs_dn');this.disable_if_dn=true;var next_ad_buttons=DOM.scry(this.ad_container,'a.next_ad');if(next_ad_buttons){this.next_ad_button=next_ad_buttons[0];}
  this.usage_data=[];this.click_usage_data=[];this.enc_log_data='';this.cancel_btn={name:'cancel',label:_tx("Cancel"),className:'inputaux'};this.buttons=[Dialog.OK,this.cancel_btn];this.thumbs_up.listen('click',this._thumbs_up.bind(this));this.thumbs_dn.listen('click',this._thumbs_dn.bind(this));if(this.next_ad_button){this.next_ad_button.listen('click',this._cycle_muffin.bind(this));}}
  copy_properties(AdsFeedback,{K_THUMBS_UP:1,K_THUMBS_DN:0,K_THUMBS_UP_FEEDBACK:1});copy_properties(AdsFeedback.prototype,{_thumbs_dn:function(){this.isPositive=false;this.click_usage_data=this.usage_data.clone();this.click_usage_data.push(AdsFeedback.K_THUMBS_DN);var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI(muffinize('/muffins/ajax/feedback.php'));new Dialog().setAsync(async).setButtons(this.buttons).setHandler(this._form_handler.bind(this)).show();return false;},_thumbs_up:function(){this.isPositive=true;this.click_usage_data=this.usage_data.clone();this.click_usage_data.push(AdsFeedback.K_THUMBS_UP,AdsFeedback.K_THUMBS_UP_FEEDBACK,'');hide(this.thumbs_up);hide(this.thumbs_dn);this._log();return false;},_log:function(){var serialized_usage_data=this.click_usage_data.join('|');if(serialized_usage_data){var params='type=usage'+'&params[]='+escapeURI('ads_feedback')+'&params[]='+escapeURI(serialized_usage_data)+'&';new AsyncSignal(muffinize('/muffins/ajax/tracking_log.php?'+params)).send();}
  if(this.enc_log_data){var adscribe_params='type=event'+'&params[]='+escapeURI('ads_feedback')+'&params[]='+escapeURI(this.enc_log_data)+'&params[]='+escapeURI(this.isPositive)+'&';new AsyncSignal(muffinize('/muffins/ajax/tracking_log.php?'+adscribe_params)).send();}},_form_handler:function(r){if(r==this.cancel_btn){var reason_value=0;var other_text='';}else if(r==Dialog.OK){var reason_select=$('ads_feedback_select');var reason_value=get_form_select_value(reason_select);var other_text=$('ads_feedback_form_other_text').value;if(!this.isPositive){this._cycle_muffin();if(this.disable_if_dn){this._disable_ad();}}
  hide(this.thumbs_up);hide(this.thumbs_dn);}
  this.click_usage_data.push(reason_value,other_text);this._log();},_disable_ad:function(){if(this.enc_log_data){var params='ld='+escapeURI(this.enc_log_data)+'&';new AsyncSignal(muffinize('/muffins/ajax/disable_muffin.php?'+params)).send();}},set_usage_data:function(usage_data){this.usage_data=usage_data;return this;},set_log_data:function(enc_log_data){this.enc_log_data=enc_log_data;return this;},_cycle_muffin:abstractMethod});function AdspaceAdsFeedback(container_id){var container=$(container_id);this.parent.construct(this,container);return this;}
  AdspaceAdsFeedback.extend('AdsFeedback');copy_properties(AdspaceAdsFeedback.prototype,{_cycle_muffin:function(){var onResponse=function(asyncResponse){var payload=asyncResponse.getPayload();if(payload.html){DOM.replace(this.ad_container,HTML(payload['html']));}else{hide(this.feedback_div);}}.bind(this);var onError=function(asyncResponse){hide(this.feedback_div);}.bind(this);var page=URI.getRequestURI().getPath();ads_fetch_admarket_ad(page,null,null,onResponse,onError);return false;}});function EmuAdsFeedback(container_id){var container=$(container_id);this.parent.construct(this,container);this.disable_if_dn=true;return this;}
  EmuAdsFeedback.extend('AdsFeedback');copy_properties(EmuAdsFeedback.prototype,{_cycle_muffin:function(){var onResponse=null;var onError=function(asyncResponse){hide(DOM.find(this.ad_container,'div.ads_feedback'));}.bind(this);var page=URI.getRequestURI().getPath();ads_refresh(null,page,onResponse,onError);return false;}});function AdnetAdspaceAdsFeedback(container_id,ad_location,adnetwork_id){var container=$(container_id);this.parent.construct(this,container);this.ad_location=ad_location;this.adnetwork_id=adnetwork_id;if(window.top.document.domain==window.document.domain){this.dialog_parent=window.top;}else{this.dialog_parent=window;}
  this.buttons=this.dialog_parent.Dialog.OK_AND_CANCEL;return this;}
  AdnetAdspaceAdsFeedback.extend('AdsFeedback');copy_properties(AdnetAdspaceAdsFeedback.prototype,{_thumbs_dn:function(){this.isPositive=false;this.click_usage_data=this.usage_data.clone();this.click_usage_data.push(AdsFeedback.K_THUMBS_DN);var async=new AsyncRequest().setMethod('GET').setReadOnly(true).setURI(muffinize('/muffins/ajax/feedback.php'));new this.dialog_parent.Dialog().setAsync(async).setButtons(this.buttons).setHandler(this._form_handler.bind(this)).show();return false;},_form_handler:function(r){if(r==this.dialog_parent.Dialog.OK){var reason_select=this.dialog_parent.DOM.getElement('ads_feedback_select');var reason_value=get_form_select_value(reason_select);var other_text=this.dialog_parent.DOM.getElement('ads_feedback_form_other_text').value;if(!this.isPositive){this._disable_ad();this._cycle_muffin();}
  hide(this.thumbs_up);hide(this.thumbs_dn);this.click_usage_data.push(reason_value,other_text);this._log();}},_cycle_muffin:function(){var onResponse=function(asyncResponse){var payload=asyncResponse.getPayload();if(payload.html){DOM.replace(this.ad_container,HTML(payload['html']));}else{hide(this.feedback_div);}}.bind(this);var onError=function(asyncResponse){hide(this.feedback_div);}.bind(this);var page=URI.getRequestURI().getPath();ads_fetch_admarket_ad(page,this.ad_location,this.adnetwork_id,onResponse,onError);return false;}});function ads_feedback_select_onchange(){var select_elem=$('ads_feedback_select');var selected_index=select_elem.selectedIndex;if(selected_index==select_elem.options.length-1){show($('ads_feedback_form_other_text'));}else{hide($('ads_feedback_form_other_text'));}}
  
  function emu_Client(_unitId,_unitType,_contextType,_root,_iData,_frameStates,_flags,_hash){this.unitId=_unitId;this.unitType=_unitType;this.contextType=_contextType;this.root=_root;this.iData=_iData;this.flags=_flags;this.hash=_hash;this.frameStates={};this.eventFrameId=null;this.setStates(_frameStates);DOMStorage.setData(this.root,'emuClient',this);}
  copy_properties(emu_Client,{constants:{EMU_FRAME_EVENT_INIT:1,EMU_FRAME_EVENT_CLICK:2,EMU_FRAME_EVENT_SUBMIT:3,EMU_SERVER_COMMAND_RENDER_FRAME:1000,EMU_SERVER_COMMAND_SET_FRAME_STATE:1001,EMU_SERVER_COMMAND_PLAY_VIDEO:1003,EMU_CLIENT_COMMAND_FRAME_EVENT:2000,EMU_LINK_TARGET_DEFAULT:1,EMU_LINK_TARGET_NEW_WINDOW:2,EMU_FRAME_CONTEXT_TARGET_INLINE:1,EMU_FRAME_CONTEXT_TARGET_DIALOG:2,EMU_FRAME_EVENT_HANDLER:'/ajax/emu/h.php'},getParentDivId:function(unitId){return'emu_'+unitId;},getClient:function(unitId){var emuParent=ge(emu_Client.getParentDivId(unitId));if(!emuParent){return null;}
  return DOMStorage.getData(emuParent,'emuClient');}});copy_properties(emu_Client.prototype,{getFrameDivId:function(frameId){return emu_Client.getParentDivId(this.unitId)+'_'+frameId;},_emuCmdHandler:function(asyncResponse){var payload=asyncResponse.getPayload();for(var i=0;i<payload.length;i++){var cmd=payload[i];switch(cmd.cmd){case emu_Client.constants.EMU_SERVER_COMMAND_RENDER_FRAME:if(emu_Client.constants.EMU_FRAME_CONTEXT_TARGET_INLINE==cmd.params.surface.targetType){var frameDivId=this.getFrameDivId(cmd.params.surface.targetId);var frame=ge(frameDivId);if(!frame){var frame=$N('div',{'id':frameDivId});this.root.appendChild(frame);}
  set_inner_html(frame,cmd.params.surface.buffer);}else if(emu_Client.constants.EMU_FRAME_CONTEXT_TARGET_DIALOG==cmd.params.surface.targetType){if(!this.root.dialog||!this.root.dialog._showing){this.root.dialog=new Dialog();}
  var d=this.root.dialog;if(cmd.params.surface.buffer){d.setBody(cmd.params.surface.buffer);}
  if(cmd.params.surface.title){d.setTitle(cmd.params.surface.title);}
  if(cmd.params.surface.width){d.setContentWidth(cmd.params.surface.width);}
  d.setButtons(Dialog.OK).show();}
  break;case emu_Client.constants.EMU_SERVER_COMMAND_SET_FRAME_STATE:this.frameStates[cmd.params.frameId]=cmd.params.state;break;}}
  this.eventFrameId=null;},_emuErrorHandler:function(response){var progressElement=ge('submit_progress_'+this.eventFrameId);if(progressElement){CSS.addClass(progressElement,'hidden');}
  frameDiv=ge(this.getFrameDivId(this.eventFrameId));if(frameDiv){var inputs=get_all_form_inputs(frameDiv);for(var i=0;i<inputs.length;i++){inputs[i].disabled=false;}}
  this.eventFrameId=null;},setStates:function(states){for(var fn in states){this.frameStates[fn]=states[fn];}},onEvent:function(frameId,eventType,eventData){if(this.eventFrameId){return;}
  this.eventFrameId=frameId;switch(eventType){case emu_Client.constants.EMU_FRAME_EVENT_CLICK:var ed=eventData;break;case emu_Client.constants.EMU_FRAME_EVENT_SUBMIT:var ed=serialize_form(eventData);var formInputs=get_all_form_inputs(eventData);for(var i=0;i<formInputs.length;i++){formInputs[i].disabled=true;}
  var progressElement=ge('submit_progress_'+this.eventFrameId);if(progressElement){CSS.removeClass(progressElement,'hidden');}
  break;}
  var params={'fss':this.frameStates,'ut':this.unitType,'ct':this.contextType,'f':this.flags,'x':this.hash,'ida':this.iData,'fid':frameId,'et':eventType,'ed':ed,'rt':'a'};var r=new AsyncRequest();r.setURI(emu_Client.constants.EMU_FRAME_EVENT_HANDLER).setData(params).setHandler(bind(this,'_emuCmdHandler')).setErrorHandler(bind(this,'_emuErrorHandler')).setTransportErrorHandler(bind(this,'_emuErrorHandler')).send();},onRedirect:function(frameId,eventData,target){var f=this.root.appendChild($N('form',{'action':emu_Client.constants.EMU_FRAME_EVENT_HANDLER,'method':'POST','target':(emu_Client.constants.EMU_LINK_TARGET_NEW_WINDOW==target)?'_blank':'','style':{'display':'none'}}));var p={'ut':this.unitType,'ct':this.contextType,'f':this.flags,'x':this.hash,'ida':this.iData,'fid':frameId,'et':emu_Client.constants.EMU_FRAME_EVENT_CLICK,'rt':'h'};for(var edt in eventData){p['ed['+edt+']']=eventData[edt];}
  for(var fn in this.frameStates){p['fss['+fn+']']=this.frameStates[fn];}
  if(ge('post_form_id')){p['post_form_id']=$('post_form_id').value;}
  for(var pn in p){f.appendChild($N('input',{'type':'hidden','name':pn,'value':p[pn]}));}
  f.submit();this.root.removeChild(f);}});function emu_redirect_wrapper(obj){emu_Client.getClient(obj.adId).onRedirect(obj.frameId,obj.eventData,obj.target);return false;}
  function emu_action_wrapper(obj){emu_Client.getClient(obj.adId).onEvent(obj.frameId,obj.eventType,obj.eventData);return false;}
  
  function EmuUIController(adId,frameId,state){this.adId=adId;this.frameId=frameId;this.state=state;this.emuFrame=$('emu_'+this.adId+'_'+this.frameId);DOMStorage.setData(this.emuFrame,'emuUIController',this);this._init();}
  copy_properties(EmuUIController.prototype,{_init:abstractMethod,_getMoreUserContentText:abstractMethod,_initHiddenToggler:function(){var toggleLinks=DOM.scry(this.emuFrame,'a.UIMutableFilterList_Toggle');for(var i=0;i<toggleLinks.length;i++){toggleLinks[i].listen('click',this._toggleHidden.bind(this));}},_toggleHidden:function(){var hiddenDiv=DOM.find(this.emuFrame,'div.hidden_user_content');var showLink=DOM.find(this.emuFrame,'a.UIMutableFilterList_Show');var hideLink=DOM.find(this.emuFrame,'a.UIMutableFilterList_Hide');if(!shown(hiddenDiv)){animation(hiddenDiv).show().from('height',0).to('height','auto').from('opacity',0).to('opacity',1).duration(200).ease(animation.ease.both).go();showLink.addClass('hidden');hideLink.removeClass('hidden');}else{animation(hiddenDiv).to('height',0).from('opacity',1).to('opacity',0).hide().duration(200).ease(animation.ease.both).blind().go();showLink.removeClass('hidden');hideLink.addClass('hidden');}
  return false;}});copy_properties(EmuUIController,{getController:function(adId,frameId){var emuFrame=$('emu_'+adId+'_'+frameId);var ret=DOMStorage.getData(emuFrame,'emuUIController');return ret;}});function CommentableEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);}
  CommentableEmuUIController.extend('EmuUIController');copy_properties(CommentableEmuUIController.prototype,{_getCommentInput:abstractMethod,_init:function(){this._initCommentHandlers();this._initHiddenToggler();},_initCommentHandlers:function(){var commentInput=this._getCommentInput();if(commentInput){commentInput.listen('focus',this._commentOnFocus.bind(this));}
  var submitBtn=DOM.scry(this.emuFrame,'input.submit_post')[0];if(submitBtn){submitBtn.listen('click',this._commentOnSubmit.bind(this));}},_commentOnFocus:function(){var submitBtn=DOM.find(this.emuFrame,'input.submit_post');submitBtn.disabled=false;submitBtn.removeClass('hidden');},_commentOnSubmit:function(evt){var commentInput=this._getCommentInput();var comment=commentInput.value;var placeholder=commentInput.getControl().getPlaceholderText();if(!comment||(comment==placeholder)){$E(evt).kill();}else{var progress=DOM.find(this.emuFrame,'img.submit_progress');progress.removeClass('hidden');}}});function emu_delete_video_comment(video_id,comment_id){new Dialog().setTitle(_tx("Delete Comment")).setBody(_tx("Are you sure you want to delete this comment?")).setButtons([{name:'delete',label:_tx("Delete"),handler:bind(this,function(){new AsyncRequest().setURI('/ajax/motion_comment.php').setData({v:video_id,d:comment_id}).setHandler(function(response){hide($('comment_'+comment_id));}).send();})},Dialog.CANCEL]).show();}
  function CommentEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);return this;}
  CommentEmuUIController.extend('CommentableEmuUIController');copy_properties(CommentEmuUIController.prototype,{_getMoreUserContentText:function(numHidden){if(numHidden==1){return _tx("1 more comment");}else{return _tx("{count} more comments",{'count':numHidden});}},_getCommentInput:function(){return DOM.scry(this.emuFrame,'input[name="comment"]')[0];}});function GiftEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);return this;}
  GiftEmuUIController.extend('CommentableEmuUIController');copy_properties(GiftEmuUIController.prototype,{_init:function(){this.parent._init();this._adjustGiftsInIE6();},_adjustGiftsInIE6:function(){if(!(ua.ie()<7)){return;}
  var giftImgs=DOM.scry(this.emuFrame,'img.wall_mini_gift_image');var hiddenDiv=DOM.scry(this.emuFrame,'div.hidden_user_content')[0];if(hiddenDiv){hiddenDiv.removeClass('hidden');}
  for(var i=0;i<giftImgs.length;i++){var giftImg=giftImgs[i];giftImg.setStyle('width',giftImg.offsetWidth+1+'px');giftImg.setStyle('height',giftImg.offsetHeight+1+'px');adjustImage(giftImg);}
  if(hiddenDiv){hiddenDiv.addClass('hidden');}},_getMoreUserContentText:function(numHidden){if(numHidden==1){return _tx("1 more gift");}else{return _tx("{count} more gifts",{'count':numHidden});}},_getCommentInput:function(){return DOM.scry(this.emuFrame,'textarea[name="gift_message"]')[0];}});copy_properties(GiftEmuUIController,{onFriendTokenAdded:function(formId,token){var formDiv=$(formId);var giftTo=DOM.find(formDiv,'input[name="gift_to"]');giftTo.value=token.i;CSS.removeClass(DOM.find(formDiv,'div.gift_form_wrapper'),'hidden');CSS.removeClass(DOM.find(formDiv,'div.gift_form_submit'),'hidden');},onFriendTokenRemoved:function(formId,token){var formDiv=$(formId);var giftTo=DOM.find(formDiv,'input[name="gift_to"]');giftTo.value=null;}});function InviteEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);return this;}
  InviteEmuUIController.extend('CommentableEmuUIController');copy_properties(InviteEmuUIController.prototype,{_init:function(){this.parent._init();},_getCommentInput:function(){return DOM.scry(this.emuFrame,'input[name="email_list"]')[0];}});function EventEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);return this;}
  EventEmuUIController.extend('CommentableEmuUIController');copy_properties(EventEmuUIController,{EVENT_STATE_INITIAL:1,EVENT_STATE_JUST_RSVP:2});copy_properties(EventEmuUIController.prototype,{_init:function(){var changeRSVPLink=DOM.scry(this.emuFrame,'a.rsvp_change')[0];if(changeRSVPLink){changeRSVPLink.listen('click',this._change_rsvp.bind(this));}
  var rsvpRadios=DOM.scry(this.emuFrame,'input[name="rsvp_status_dummy"]');if(rsvpRadios){for(var i=0;i<rsvpRadios.length;i++){var radio=rsvpRadios[i];radio.listen('click',this._rsvp.bind(this,radio));}}
  if(this.state==EventEmuUIController.EVENT_STATE_JUST_RSVP){this._updateRsvpStatusBg();this._initCommentHandlers();}
  this._initHiddenToggler();},_change_rsvp:function(){var rsvpStatus=DOM.find(this.emuFrame,'div.rsvp_status');var rsvpInputs=DOM.find(this.emuFrame,'div.rsvp_inputs');var rsvpChange=DOM.find(this.emuFrame,'a.rsvp_change');CSS.addClass(rsvpStatus,'hidden');CSS.addClass(rsvpChange,'hidden');CSS.removeClass(rsvpInputs,'hidden');return false;},_rsvp:function(radioInput){var rsvpInputs=DOM.find(this.emuFrame,'div.rsvp_inputs');var progress=DOM.find(this.emuFrame,'img.rsvp_progress');var data={'linkId':3,'linkParam':radioInput.value}
  emu_Client.getClient(this.adId).onEvent(this.frameId,emu_Client.constants.EMU_FRAME_EVENT_CLICK,data);CSS.addClass(rsvpInputs,'hidden');CSS.removeClass(progress,'hidden');},_updateRsvpStatusBg:function(){var statusPhrase=DOM.find(this.emuFrame,'span.rsvp_status_phrase');animation(statusPhrase).to('backgroundColor','#FFFFFF').from('#FFE8CC').duration(3000).go();},_getCommentInput:function(){return DOM.scry(this.emuFrame,'textarea[name="rsvp_comment"]')[0];},_getMoreUserContentText:function(numHidden){if(numHidden==1){return _tx("1 more RSVP from a friend");}else{return _tx("{count} more RSVPs from friends",{'count':numHidden});}}});copy_properties(EventEmuUIController,{onFriendTokenAdded:function(formId,token){var formDiv=$(formId);CSS.removeClass(DOM.find(formDiv,'div.invite_form_message'),'hidden');CSS.removeClass(DOM.find(formDiv,'div.invite_form_submit'),'hidden');}});function FanEmuUIController(adId,frameId,state){this.parent.construct(this,adId,frameId,state);return this;}
  FanEmuUIController.extend('EmuUIController');copy_properties(FanEmuUIController.prototype,{_init:function(){this._initHiddenToggler();},_getMoreUserContentText:function(numHidden){numHidden-=3;if(numHidden==1){return _tx("1 more fan");}else{return _tx("{count} more fans",{'count':numHidden});}},justFanned:function(){var fanText=DOM.find(this.emuFrame,'div.fan_link');fanText.setStyle('backgroundColor','#fffccc');animation(fanText).duration(3000).checkpoint().to('backgroundColor','#FFFFFF').duration(1000).go();}});function PollEmuUIController(adId,frameId,state,isNile){this.isNile=isNile;this.parent.construct(this,adId,frameId,state);return this;}
  PollEmuUIController.extend('EmuUIController');copy_properties(PollEmuUIController,{STATE_INITIAL:1,STATE_JUST_ANSWERED:2,STATE_ANSWERED:3,MAX_RESULT_WIDTH:230});copy_properties(PollEmuUIController.prototype,{showResults:function(results){var leadingResult=null;var leadingPercent=-1;var resultStyles={};for(var resultId in results){if(results[resultId]>leadingPercent){leadingResult=resultId;leadingPercent=results[resultId];}}
  for(var resultId in results){var percent=results[resultId];var width=Math.round(percent/leadingPercent*PollEmuUIController.MAX_RESULT_WIDTH);var className='not_lead_result';if(resultId==leadingResult){className='lead_result';}
  resultStyles[resultId]={'width':width,'className':className}}
  for(var resultId in resultStyles){var barDiv=this._findHelper(DOM.find,'#poll_result_'+resultId+' .result_bar');var styles=resultStyles[resultId];var width=styles.width+'px';barDiv.setStyle('width',0);barDiv.addClass(styles.className);if(this.state==PollEmuUIController.STATE_JUST_ANSWERED){animation(barDiv).from('width',0).to('width',width).duration(500).ease(animation.ease.both).go();}else if(this.state==PollEmuUIController.STATE_ANSWERED){barDiv.setStyle('width',width);}}},_init:function(){if(this.state==PollEmuUIController.STATE_INITIAL){this._initAnswerRadios();}else{var friendCountLink=DOM.scry(this.emuFrame,'a.friend_count_link')[0];if(friendCountLink){friendCountLink.listen('click',this._onShowFriendsClick.bind(this));}}},_initAnswerRadios:function(){var answerRadios=this._findHelper(DOM.scry,'input[name="answer"]');if(answerRadios){for(var i=0;i<answerRadios.length;i++){var radio=answerRadios[i];radio.listen('click',this._onAnswer.bind(this,radio));}}},_onShowFriendsClick:function(){var friendVotePics=this._findHelper(DOM.scry,'div.friend_vote_pics');for(var i=0;i<friendVotePics.length;i++){var friendVotePic=friendVotePics[i];if(!shown(friendVotePic)){animation(friendVotePic).from('height',0).to('height','auto').duration(200).show().go();}else{animation(friendVotePic).to('height',0).duration(200).hide().go();}}
  return false;},_onAnswer:function(radioInput){var answerId=radioInput.value;var container=this._findHelper(DOM.find,'div.answer_form');var progress=this._findHelper(DOM.find,'img.submit_progress');var radioArr=DOM.scry(container,'input.inputradio');var OFFSET_X=8;var radioVector=Vector2.getElementPosition(radioInput);var containerVector=Vector2.getElementPosition(container);var progressVector=new Vector2(OFFSET_X,radioVector.y-containerVector.y,'document');for(var i=0;i<radioArr.length;i++){radioArr[i].disabled=true;}
  progressVector.setElementPosition(progress);radioInput.setStyle('visibility','hidden');progress.removeClass('hidden');var data={'linkId':2,'linkParam':answerId};emu_Client.getClient(this.adId).onEvent(this.frameId,emu_Client.constants.EMU_FRAME_EVENT_CLICK,data);},_findHelper:function(func,ele){if(!this.isNile){return func.call(null,this.emuFrame,ele);}
  var poll_results=DOM.scry($('emu_'+this.adId),'div.poll_results');if(poll_results.length>0){return func.call(null,this.emuFrame,ele);}else{var radios_as_copy=ge('emu_poll_itb_'+this.adId);return func.call(null,radios_as_copy,ele);}}});
  
  function pymkGrid(grid_id,show_explanation){copy_properties(this,{used_ids:[],boxes_displayed:0,payload_timeouts:0,grid_id:null,pymk_more_link:null,show_explanation:null});if(grid_id&&ge(grid_id)){this.show_explanation=!!show_explanation;this.grid_obj=$(grid_id);var id_divs=DOM.scry(this.grid_obj,'div.friend_grid_col');for(var i=0;i<id_divs.length;i++){this.used_ids.push(parseInt(id_divs[i].getAttribute('id').substring(3)));this.boxes_displayed++;}
  var more_link=DOM.scry(this.grid_obj,'a.show_more');if(more_link){this.pymk_more_link=more_link[0];}}else{Util.error('pymkGrid: Either the grid you have specified is invalid or is not detectable in the DOM.');}}
  copy_properties(pymkGrid.prototype,{addFriend:function(uid,page,score,source,log){this.modifyFriendship(uid,'add',null,page,score,source,log);return;},hideFriend:function(uid,page,score,source){this.modifyFriendship(uid,'blacklist',null,page,score,source);return;},modifyFriendship:function(uid,action_type,home_panel,page,score,source,log){var friend_data=this.getGridData($('fg_'+uid));var asyncData={used:this.used_ids,replace:uid,get:1,explanation:this.show_explanation,page:page};if(action_type=='blacklist'){asyncData.blacklist=true;asyncData.blacklist_type='blacklist';asyncData.score=score;asyncData.source=source;}else if(log){asyncData.log=true;asyncData.score=score;asyncData.source=source;}
  new AsyncRequest().setURI('/ajax/friend_guess.php').setData(asyncData).setHandler(bind(this,this.asyncHandleModify)).setReplayable(false).send();var friend_box=$('fg_'+uid);animation(friend_box).from('opacity',1).to('opacity',0).duration(300).go();if(home_panel){home_panel.addTo('outgoing',home_panel.constructGridItem(friend_data));}
  return;},asyncHandleRefresh:function(async){payload=async.getPayload();if(payload.victim&&payload.victim.length>0){for(var i=0;i<payload.victim.length;i++){if(this.used_ids[i]){animation($('fg_'+this.used_ids[i])).from('opacity',1).to('opacity',0).duration(300).go();}}
  for(var i=0;i<payload.victim.length;i++){if(this.used_ids[i]){this.replaceItem(this.used_ids[i],payload.victim[i]);}}
  for(var i=0;i<payload.victim.length;i++){this.used_ids.unshift(payload.victim[i].uid);}}
  if(!payload.more){this._hideMoreLink();}},asyncHandleModify:function(async){payload=async.getPayload();if(payload.victim&&payload.victim.length>0){this.replaceItem(payload.replace,payload.victim[0]);}else{this.hideItem(payload.replace);}
  return;},replaceItem:function(replace,victim){var replace_id='fg_'+replace;var box_id='fg_'+victim.uid;if(!ge(box_id)){var new_box=DOM.create('div',{id:box_id,className:'friend_grid_col clearfix'},HTML(victim.box_content));DOM.replace($(replace_id),new_box);animation($(box_id)).from('opacity',0).to('opacity',1).duration(400).go();this.used_ids.push(victim.uid);}else{this.hideItem(replace);}},hideItem:function(replace){this.payload_timeouts++;var replace_id='fg_'+replace;var anim=null;var suggestions=$$('#home_sidebar .sidebar_item.pymk');if(1==suggestions.length&&1==$$('#pymk_ajax_grid .friend_grid_row').length){anim=animation(suggestions[0]);}else{hide('fg_add_'+replace);$(replace_id).unreplaceable=true;var pymkRow=$(replace_id).parentNode;var collapseRow=true;for(var i=0;i<pymkRow.childNodes.length;i++){if(!pymkRow.childNodes[i].unreplaceable){collapseRow=false;break;}}
  if(collapseRow){anim=animation(pymkRow).ondone(DOM.remove.bind(null,pymkRow));}}
  if(anim){anim.to('height',0).duration(550).hide().ease(animation.ease.end).go();}
  this._hideMoreLink();},constructGridItem:function(grid_data){return this.constructRawGridItem(grid_data.uid,grid_data.content);},constructRawGridItem:function(uid,item_content){var gridItem=document.createElement('div');CSS.addClass(gridItem,'friend_grid_col');gridItem.setAttribute('id','friend_'+uid);gridItem.innerHTML=item_content;return gridItem;},getGridData:function(grid_object){if(CSS.hasClass(grid_object,'friend_grid_col')){var gridData={content:grid_object.innerHTML,uid:grid_object.getAttribute('id').toString().slice(3)}
  return gridData;}},_removeID:function(uid){for(var i=0;i<this.used_ids.length;i++){if(this.used_ids[i]==uid){this.used_ids.splice(i,1);}}
  return;},_hideMoreLink:function(){if(this.pymk_more_link){this.pymk_more_link.style.visibility='hidden';this.pymk_more_link=null;}}});function pymk_friend_added(link_object){pymk_add_friend(link_object.uid,link_object.render_explanation,null,link_object.page);}
  function pymk_add_friend(uid,has_explanation,existingGrid,page,score,source,log){if(!existingGrid){existingGrid=new pymkGrid('pymk_ajax_grid',has_explanation||false);}
  existingGrid.addFriend(uid,page,score,source,log);}
  function pymk_hide_friend(uid,has_explanation,existingGrid,page,score,source){if(!existingGrid){existingGrid=new pymkGrid('pymk_ajax_grid',has_explanation);}
  if(!score){score=-1;}
  if(!source){source='u';}
  existingGrid.hideFriend(uid,page,score,source);}
  
  function UIPagelet(element,src,context_data,data){this._element=ge(element||$N('div'));this._src=src||null;this._context_data=context_data||{};this._data=data||{};this._handler=bagofholding;return this;}
  copy_properties(UIPagelet.prototype,{getElement:function(){return this._element;},setHandler:function(handler){this._handler=handler;return this;},go:function(src,data){if(arguments.length>=2||typeof src=='string'){this._src=src;this._data=data||{};}else if(arguments.length==1){this._data=src;}
  this.refresh();return this;},refresh:function(){var handler=function(response){this._element.setContent(HTML(response.getPayload()));this._handler();}.bind(this);new AsyncRequest().setURI(this._src).setMethod('GET').setData({data:JSON.encode(merge(this._context_data,this._data))}).setReadOnly(true).setHandler(handler).setOption('bundle',true).send();return this;}});
  
  function pymk_refresh(onResponse,onError){if(window.pymk_refreshing){return;}
  var possible=['pymk_hp_box'];var locations=[];for(var i=0;i<possible.length;i++){if(ge(possible[i])){locations.push(possible[i]);}}
  if(locations.length==0){return;}
  var data={'locations':locations};var _onResponse=function(response){window.pymk_refreshing=false;var divs=response.getPayload();for(var id in divs){var location=ge(id);if(location&&divs[id].length>0){location.replace(HTML(divs[id]));}}
  if(onResponse){onResponse(response);}}
  var _onError=function(response){window.pymk_refreshing=false;if(onError){onError(response);}}
  new AsyncRequest().setURI('/ajax/pymk_refresh.php').setData(data).setOption('bundle',true).setHandler(_onResponse).setErrorHandler(_onError).send();window.pymk_refreshing=true;}
  
  function tz_calculate(timestamp){var d=new Date();var raw_offset=d.getTimezoneOffset()/30;var time_sec=d.getTime()/1000;var time_diff=Math.round((timestamp-time_sec)/1800);var rounded_offset=Math.round(raw_offset+time_diff)%48;if(rounded_offset==0){return 0;}else if(rounded_offset>24){rounded_offset-=Math.ceil(rounded_offset/48)*48;}else if(rounded_offset<-28){rounded_offset+=Math.ceil(rounded_offset/-48)*48;}
  return rounded_offset*30;}
  function ajax_tz_set(tzForm){var timestamp=tzForm.time.value;var gmt_off=-tz_calculate(timestamp);var cur_gmt_off=tzForm.tz_gmt_off.value;if(gmt_off!=cur_gmt_off){var ajaxUrl='/ajax/autoset_timezone_ajax.php';new AsyncSignal(ajaxUrl,{user:tzForm.user.value,gmt_off:gmt_off}).send();}}
  function tz_autoset(){var tz_form=ge('tz_autoset_form');if(tz_form){ajax_tz_set(tz_form);}}
  
  if (window.Bootloader) { Bootloader.done(["js\/bvpncaz74l4wggk8.pkg.js"]); }