/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  July 13th 2009 7:36:42 AM PDT                                */
/*      Machine:  10.16.140.109                                                */
/*       Source:  Global Cache                                                 */
/*     Location:  js/6t99vbwpdu8s80oo.pkg.js h:bo5t8qsd                        */
/*       Locale:  en_US                                                        */
/*         Path:  js/6t99vbwpdu8s80oo.pkg.js                                   */


function RoundedImage(imgSrc){this.imgSrc=imgSrc;this.imgAlt="";this.thesize=RoundedImage.SIZE_DEFAULT;this.background=RoundedImage.BACKGROUND_DEFAULT;}
RoundedImage.SIZE_LARGE='UIRoundedImage_LARGE';RoundedImage.SIZE_SMALL='UIRoundedImage_SMALL';RoundedImage.SIZE_TINY='UIRoundedImage_TINY';RoundedImage.SIZE_DEFAULT=RoundedImage.SIZE_LARGE;RoundedImage.BACKGROUND_NONE='UIRoundedImage_NONE';RoundedImage.BACKGROUND_WHITE='UIRoundedImage_WHITE';RoundedImage.BACKGROUND_GIRLIE='UIRoundedImage_GIRLIE';RoundedImage.BACKGROUND_DARK='UIRoundedImage_DARK';RoundedImage.BACKGROUND_DEFAULT=RoundedImage.BACKGROUND_WHITE;copy_properties(RoundedImage.prototype,{setAlt:function(name){this.imgAlt=name;},setSize:function(size){this.thesize=size;},setBackground:function(bg_const){if(this.corners){CSS.setClass(this.corners,'UIRoundedImage_Corners '+bg_const);}else{this.background=bg_const;}},render:function(){if(this.root){return;}
var controllerClassName='UIRoundedImage'
+' '+this.thesize
+' '+this.background;this.root=$N("span",{className:controllerClassName});var pic=new Image();pic.alt=this.imgAlt;pic.src=this.imgSrc;CSS.setClass(pic,'UIRoundedImage_Image');this.root.appendChild(pic);this.corners=$N("span",{className:'UIRoundedImage_Corners'},$N("span",{className:'UIRoundedImage_CornersSprite'},$N("span",{className:'invisible_png'})));this.root.appendChild(this.corners);return this.root;}});

function collect_data_attrib(elem,type){var merged_data={};var attr_name='data-'+type;while(elem&&!DOM.isNode(elem,'body')){var attr_data_str=elem.getAttribute(attr_name);if(attr_data_str){var attr_data=JSON.decode(attr_data_str);for(var i in attr_data){if(merged_data[i]==undefined){merged_data[i]=attr_data[i];}}}
elem=elem.parentNode;}
return merged_data;}

function feedcomment_get_feedback_sources(){return{'FEEDBACK_SOURCE_PROFILE':0,'FEEDBACK_SOURCE_NEWS_FEED':1,'FEEDBACK_SOURCE_OBJECT':2,'FEEDBACK_SOURCE_MOBILE':3,'FEEDBACK_SOURCE_EMAIL':4,'FEEDBACK_SOURCE_API':5,'FEEDBACK_SOURCE_OBJECTS_PAGE':6};}
function feedcomment_constants(){}
feedcomment_constants.MAX_COMMENTS_TO_SHOW=1000;function feedcomment_get_target_from_element(elem){return collect_data_attrib(elem,'comment');}
function fc_with_target(fn){return function(elem){var target_info=feedcomment_get_target_from_element(elem);if(!target_info){Util.error('failed to find target info for '+elem)
return;}
var args=$A(arguments);args[0]=target_info;return fn.apply(null,args);};}
var feedcomment_submit_d=fc_with_target(function(target_info){return feedcomment_submit(target_info.target_fbid,target_info.item_id,target_info.source,target_info.target_owner,target_info.type_id,target_info.assoc_obj_id,null,target_info.check_hash,target_info.source_app_id)});function feedcomment_submit(target_fbid,item_id,source,target_owner,type_id,assoc_object_id,link_data_str,check_hash,source_app_id){var add_comment_form=_feedcomment_get_add_comment_form(target_fbid,item_id);var add_comment_textarea=_feedcomment_get_add_comment_textarea(target_fbid,item_id);var comment_button=_feedcomment_get_add_comment_button(target_fbid,item_id);var publish_checkbox=_feedcomment_get_publish_story_checkbox(target_fbid,item_id);var credits_giver_input=_feedcomment_get_credits_giver_input(target_fbid,item_id);var num_credits=(credits_giver_input&&parseInt(credits_giver_input.value,10))||0;var feedcomment_arguments=arguments;var publish_story=true;if(publish_checkbox){publish_story=publish_checkbox.checked;}
var onResponse=function(asyncResponse){var payload=asyncResponse.getPayload();if('userData'in payload&&payload.userData=='nux'){if(asyncResponse.isReplay()){return;}
new Dialog(payload).setButtons([{label:_tx("Confirm"),handler:function(){feedcomment_submit.apply(this,feedcomment_arguments)},name:'confirm_comment'},Dialog.CANCEL]).show();}else{feedcomment_add_comment_onsuccess(payload,target_fbid,item_id,source);}}
var comment_text=(add_comment_textarea.getControl&&add_comment_textarea.getControl().getValue())||'';comment_text=trim(comment_text);if(comment_text||num_credits){var endpoint=num_credits?'/ajax/giftcredits/prompt.php':'/ajax/inline_comments.php';var post_data={'assoc_object_id':assoc_object_id,'check_hash':check_hash,'comment_text':comment_text,'item_id':item_id,'link_data':link_data_str,'source':source,'target_fbid':target_fbid,'target_owner':target_owner,'type_id':type_id,'source_app_id':source_app_id,'num_credits':num_credits,'publish_story':publish_story};if(num_credits){var fragment=_feedcomment_get_commentable_item_div(target_fbid,item_id,source).getAttribute('id');post_data={app_id:19675640871,receiver:target_owner,back_url:URI.getRequestURI().setFragment(fragment).toString(),order_info:JSON.encode(post_data)};}
comment_button.disabled=true;add_comment_textarea.disabled=true;new AsyncRequest().setURI(endpoint).setData(post_data).setContextData('clicktype','Write Comment').setHandler(bind(this,handle_require_email_conf_response,onResponse,null,null)).setFinallyHandler(function(){comment_button.disabled=false;add_comment_textarea.disabled=false;}).send();}else{feed_comment_cancel_add_box_onblur();animation(add_comment_textarea).to('background','#fff').from('#fcc').duration(140).go();}
return status;}
function feedcomment_add_comment_onsuccess(result,target_fbid,item_id,source){var add_comment_form=_feedcomment_get_add_comment_form(target_fbid,item_id);var add_comment_textarea=_feedcomment_get_add_comment_textarea(target_fbid,item_id);var comment_button=_feedcomment_get_add_comment_button(target_fbid,item_id);var publish_checkbox=_feedcomment_get_publish_story_checkbox(target_fbid,item_id);var credits_giver_input=_feedcomment_get_credits_giver_input(target_fbid,item_id);var num_credits=(credits_giver_input&&parseInt(credits_giver_input.value,10))||0;if(num_credits&&'title'in result&&'body'in result){new Dialog(result).show();return;}
if(!Rect.getViewportBounds().contains(Rect.getElementBounds(comment_button))){var scroll_offset=-1*Math.max(Vector2.getViewportDimensions().y/2,100);animation(DOMScroll.getScrollRoot()).to('scrollTop',Vector2.getElementPosition(comment_button).y+scroll_offset).ease(animation.ease.end).duration(1500).go();}
if('last_comment'in result){feedcomment_append_comment(target_fbid,item_id,result.last_comment,result.comment_count,source);}else{feedcomment_sync_with_markup(target_fbid,item_id,result.all_comments_html,result.comment_count,source);}
if(credits_giver_input){if('balance_html'in result){var balance_divs=DOM.scry(document.body,'div.comments_add_box span.balance_text');var node=HTML(result.balance_html);for(var i=balance_divs.length-1;i>=0;--i){balance_divs[i].setContent(node);}}
credits_giver_input.value=0;DOM.find(add_comment_form,'div.credits_giver_row').removeClass('credits_giver_row_revealed');}
add_comment_textarea.value='';if(add_comment_textarea.getControl){add_comment_textarea.getControl().setPlaceholderText(_tx("Write another comment..."));}
feed_comment_hide_add_box(target_fbid,item_id,source,false);}
function feed_comment_record_add_box_onblur(timeoutId){feed_comment_record_add_box_onblur.timeoutId=timeoutId;}
function feed_comment_cancel_add_box_onblur(){var timeoutId=feed_comment_record_add_box_onblur.timeoutId;if(timeoutId){clearTimeout(timeoutId);}}
var feed_comment_hide_add_box_d=fc_with_target(function(target_info,onblur_event){return feed_comment_hide_add_box(target_info.target_fbid,target_info.item_id,target_info.source,onblur_event);});function feed_comment_hide_add_box(target_fbid,item_id,source,onblur_event){var add_comment_textarea=_feedcomment_get_add_comment_textarea(target_fbid,item_id);if(add_comment_textarea){var has_entered_text=add_comment_textarea.getControl&&add_comment_textarea.getControl().getValue();if(!has_entered_text){var commentable_item=_feedcomment_get_commentable_item_div(target_fbid,item_id,source);var comments=_feedcomment_get_feed_comments(target_fbid,item_id);var hovering_over_link=(DOM.scry(commentable_item,'a.feedback_hover').length>0);if(!(onblur_event&&hovering_over_link)){feed_comment_perform_hide_add_box(commentable_item,comments,add_comment_textarea);}}
feedcomment_hide_credits_nux_tip(target_fbid,item_id);}}
function feed_comment_perform_hide_add_box(commentable_item,comments,add_comment_textarea){if(!add_comment_textarea){return false;}
if(add_comment_textarea.getControl&&add_comment_textarea.getControl().getValue()){return false;}
var num_comments=DOM.scry(comments,'div.ufi_section').length;var has_likes=(DOM.scry(commentable_item,'div.has_likes').length>0);var has_feedback=(num_comments>0)||has_likes;var is_single_profile_story=CSS.hasClass(commentable_item,'single_profile_story');if(!has_feedback&&!is_single_profile_story){CSS.addClass(commentable_item,'collapsed_comments');CSS.removeClass(commentable_item,'expanded_comments');if(CSS.hasClass(commentable_item,'story_ff')){CSS.addClass(commentable_item,'ff_collapsed_comments');CSS.removeClass(commentable_item,'ff_expanded_comments');}}
if(add_comment_textarea.getControl){window.setTimeout(function(){CSS.addClass(commentable_item,'hidden_add_button');},1);}
DataStore.set(commentable_item,'commentLinkShouldCloseAddBox',false);return true;}
var feed_comment_show_add_button_d=fc_with_target(function(target_info){feed_comment_show_add_button(target_info.target_fbid,target_info.item_id,target_info.source);});function feed_comment_show_add_button(target_fbid,item_id,source){var commentable_item=_feedcomment_get_commentable_item_div(target_fbid,item_id,source);CSS.removeClass(commentable_item,'hidden_add_button');}
function _feed_comment_update_count(target_fbid,item_id,item_total_count,source){var commentable_item=_feedcomment_get_commentable_item_div(target_fbid,item_id,source);feedback_update_toggle_counts(target_fbid,item_id,source,item_total_count);if(item_total_count==0){CSS.removeClass(commentable_item,'with_comments');CSS.addClass(commentable_item,'no_comments');}else{if(CSS.hasClass(commentable_item,'no_comments')){CSS.removeClass(commentable_item,'no_comments');CSS.addClass(commentable_item,'with_comments');}
if(CSS.hasClass(commentable_item,'autoexpand_mode')){toggle_feedcomments_box_open(target_fbid,item_id,source,false);}}}
function load_more_feed_comments(target_fbid,item_id,target_owner,type_id,assoc_object_id,source,check_hash,range,highlighted_comment_ids){var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);var comments=DOM.scry(feed_comments,'.ufi_section');var first_comment_id=null;for(var i=0;i<comments.length&&!first_comment_id;i++){first_comment_id=_feedcomment_get_comment_id(comments[i]);}
load_all_feed_comments(target_fbid,item_id,target_owner,type_id,assoc_object_id,source,check_hash,range,highlighted_comment_ids,first_comment_id);}
function load_all_feed_comments(target_fbid,item_id,target_owner,type_id,assoc_object_id,source,check_hash,range,highlighted_comment_ids,merge_cutoff_id){if(!assoc_object_id){assoc_object_id=0;}
if(!source){var sources=feedcomment_get_feedback_sources();source=sources['FEEDBACK_SOURCE_PROFILE'];}
if(merge_cutoff_id){var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);if(CSS.hasClass(feed_comments,'paging')){return;}else{CSS.addClass(feed_comments,'paging');}}
var add_comment_form=_feedcomment_get_add_comment_form(target_fbid,item_id);var onResponse=function(asyncResponse){var result=asyncResponse.getPayload();feedcomment_sync_with_markup(target_fbid,item_id,result.all_comments_html,result.comment_count,source,merge_cutoff_id,result.pager,result.force_update,result.num_new_comments);var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);var highlights=DOM.scry(feed_comments,'div.comment_highlighted');for(var i=0;i<highlights.length;i++){animation(highlights[i]).duration(500).checkpoint().to('backgroundColor','#ECEFF5').duration(1500).ondone(CSS.removeClass.bind(null,highlights[i],'comment_highlighted')).go();}};new AsyncRequest().setURI('/ajax/inline_comments.php').setData({'assoc_object_id':assoc_object_id,'check_hash':check_hash,'get_all':1,'comments_range':range,'item_id':item_id,'target_fbid':target_fbid,'target_owner':target_owner,'type_id':type_id,'source':source,'highlighted_comment_ids':highlighted_comment_ids,'cutoff_id':merge_cutoff_id}).setHandler(onResponse).send();}
function feedcomment_sync_with_markup(target_fbid,item_id,markup,comment_count,source,merge_cutoff_id,paging_header,force_update,num_new_comments){if(force_update){window.location.reload(true);return;}
var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);if(feed_comments){if(merge_cutoff_id){var container=DOM.find(feed_comments,'.paging_container');DOM.prependContent(container,HTML(markup));feedcomment_update_paging_header(feed_comments,paging_header);var comments_pages=DOM.scry(container,'.comments_page');var new_comment_page=comments_pages[0];animation(new_comment_page).from('height',0).to('height','auto').duration(60*num_new_comments).ondone(feedcomment_cutoff_excessive_comments.curry(feed_comments,container,comments_pages,new_comment_page,num_new_comments)).go();}else{set_inner_html(feed_comments,markup);}
_feed_comment_update_count(target_fbid,item_id,comment_count,source);}}
function feedcomment_update_paging_header(feed_comments,paging_header){CSS.removeClass(feed_comments,'paging');var header=DOM.find(feed_comments,'.paging_header');if(paging_header){set_inner_html(header,paging_header);}else{feed_comments.removeChild(header);}}
function feedcomment_cutoff_excessive_comments(feed_comments,paging_container,comments_pages,new_comment_page,num_new_comments){var total_comments=DataStore.get(paging_container,'total_comments');DataStore.set(new_comment_page,'num_comments',num_new_comments);if(!total_comments){var original_page=comments_pages[1];total_comments=DOM.scry(original_page,'.ufi_section').length;DataStore.set(original_page,'num_comments',total_comments);}
total_comments+=num_new_comments;for(var i=comments_pages.length-1;i>=0&&total_comments>feedcomment_constants.MAX_COMMENTS_TO_SHOW;i--){var comments_page=comments_pages[i];var num_comments=DataStore.get(comments_page,'num_comments');paging_container.removeChild(comments_page);total_comments-=num_comments;if(!CSS.hasClass(feed_comments,'comments_cutoff')){CSS.addClass(feed_comments,'comments_cutoff');}}
DataStore.set(paging_container,'total_comments',total_comments);}
function feedcomment_scroll_to_comments(target_fbid,item_id,center){var div=_feedcomment_get_comments_target_wrapper(target_fbid,item_id);if(div){DOMScroll.scrollTo(div,true,center);}}
function feedcomment_remove_comment(target_fbid,item_id,comment_id,comment_count,source){var comment=_feedcomment_get_comment(target_fbid,item_id,comment_id);if(comment){DOM.remove(comment);_feed_comment_update_count(target_fbid,item_id,comment_count,source);}}
function feedcomment_append_comment(target_fbid,item_id,markup,comment_count,source){var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);if(feed_comments){DOM.appendContent(feed_comments,HTML(markup));_feed_comment_update_count(target_fbid,item_id,comment_count,source);}}
function feedcomment_emote(target_fbid,item_id){var feed_comments=_feedcomment_get_feed_comments(target_fbid,item_id);if(!feed_comments){return;}
if(DataStore.get(feed_comments,'emote_magic')){return;}
var nodes=DOM.scry(feed_comments,'div.comment_actual_text');for(var i=0;i<nodes.length;i++){var node=nodes[i];var comment=node.innerHTML;var emotiveComment=Emote.htmlEmote(comment,HTML);if(comment!=emotiveComment){DOM.setContent(node,HTML(emotiveComment));}}
DataStore.set(feed_comments,'emote_magic',true);onunloadRegister(DataStore.remove.bind(DataStore,feed_comments,'emote_magic'));}
function remove_feed_comment_dialog(target_fbid,item_id,comment_id,target_owner,source,type_id,assoc_object_id,check_hash){var add_comment_form=_feedcomment_get_add_comment_form(target_fbid,item_id);var onResponse=function(asyncResponse){var result=asyncResponse.getPayload();feedcomment_remove_comment(target_fbid,item_id,comment_id,result.comment_count,source);};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/inline_comments.php').setData({'assoc_object_id':assoc_object_id,'check_hash':check_hash,'del_id':comment_id,'item_id':item_id,'source':source,'target_fbid':target_fbid,'target_owner':target_owner,'type_id':type_id}).setContextData('clicktype','Delete Comment').setHandler(onResponse).send();})},Dialog.CANCEL]).show();}
var toggle_feedcomments_box_open_d=fc_with_target(function(target_info,focus){return toggle_feedcomments_box_open(target_info.target_fbid,target_info.item_id,target_info.source,focus);});function toggle_feedcomments_box_open(sole_target_fbid,item_id,source,focus){var commentable_item=_feedcomment_get_commentable_item_div(sole_target_fbid,item_id,source);if(commentable_item){var hidden=false;if(DataStore.get(commentable_item,'commentLinkShouldCloseAddBox')){hidden=feed_comment_perform_hide_add_box(commentable_item,_feedcomment_get_feed_comments(sole_target_fbid,item_id),_feedcomment_get_add_comment_textarea(sole_target_fbid,item_id));}
if(!hidden){CSS.removeClass(commentable_item,'collapsed_comments');CSS.addClass(commentable_item,'expanded_comments');if(CSS.hasClass(commentable_item,'story_ff')){CSS.removeClass(commentable_item,'ff_collapsed_comments');CSS.addClass(commentable_item,'ff_expanded_comments');}
var first_textarea=_feedcomment_get_first_item_textarea(commentable_item);if(first_textarea&&focus){first_textarea.focus();}
DataStore.set(commentable_item,'commentLinkShouldCloseAddBox',true);}}}
function toggle_feedcomments_box(sole_target_fbid,item_id,source,focus){var commentable_item=_feedcomment_get_commentable_item_div(sole_target_fbid,item_id,source);if(commentable_item){CSS.toggleClass(commentable_item,'expanded_comments');CSS.toggleClass(commentable_item,'collapsed_comments');if(CSS.hasClass(commentable_item,'story_ff')){CSS.toggleClass(commentable_item,'ff_expanded_comments');CSS.toggleClass(commentable_item,'ff_collapsed_comments');}
var first_textarea=_feedcomment_get_first_item_textarea(commentable_item);if(first_textarea&&focus){if(CSS.hasClass(commentable_item,'expanded_comments')){first_textarea.focus();}}}}
function _feedcomment_get_commentable_item_div(target_fbid,item_id,source){var commentable_item;var sources=feedcomment_get_feedback_sources();if(source==sources['FEEDBACK_SOURCE_OBJECT']||source==sources['FEEDBACK_SOURCE_OBJECTS_PAGE']){commentable_item=ge('commentable_item_'+item_id);}else{commentable_item=ge('div_story_'+item_id+'_'+target_fbid);if(!commentable_item){commentable_item=ge('div_story_'+item_id);}}
return commentable_item;}
function _feedcomment_get_commentable_item_div_nosource(target_fbid,item_id){var div;if(div=ge('commentable_item_'+item_id)){return div;}else if(div=ge('div_story_'+item_id+'_'+target_fbid)){return div;}else{return ge('div_story_'+item_id);}}
function feedback_update_toggle_counts(target_fbid,item_id,source,count){var commentable_item=_feedcomment_get_commentable_item_div(target_fbid,item_id,source);if(commentable_item){var links=DOM.scry(commentable_item,'span.feedback_link_count');for(var i=0;i<links.length;++i){var link=links[i];DOM.setText(link,count);}}}
function _feedcomment_get_comments_target_wrapper(target_fbid,item_id){return _feedcomment_get_first_existing_elem('comment_box',target_fbid,item_id);}
function _feedcomment_get_feed_comments(target_fbid,item_id){return _feedcomment_get_first_existing_elem('comments_list_wrapper',target_fbid,item_id);}
function _feedcomment_get_add_comment_form(target_fbid,item_id){return _feedcomment_get_first_existing_elem('add_comment',target_fbid,item_id);}
function _feedcomment_get_add_comment_textarea(target_fbid,item_id){return _feedcomment_get_first_existing_elem('add_comment_text',target_fbid,item_id);}
function _feedcomment_get_publish_story_checkbox(target_fbid,item_id){return _feedcomment_get_first_existing_elem('publish_story',target_fbid,item_id);}
function _feedcomment_get_credits_giver_input(target_fbid,item_id){return _feedcomment_get_first_existing_elem('credits_giver',target_fbid,item_id);}
function _feedcomment_get_first_item_textarea(commentable_item){var textareas=commentable_item.getElementsByTagName('textarea');if(textareas.length>0){return textareas[0];}else{return null;}}
function _feedcomment_get_add_comment_button(target_fbid,item_id){return _feedcomment_get_first_existing_elem('submit_comment',target_fbid,item_id);}
function _feedcomment_get_add_comment_wrapper(target_fbid,item_id){return _feedcomment_get_first_existing_elem('add_comment_wrapper',target_fbid,item_id)}
function _feedcomment_get_comment(target_fbid,item_id,comment_id){var elem;if(elem=ge('comment_'+item_id+'_'+target_fbid+'_'+comment_id)){return elem;}else{return ge('comment_'+target_fbid+'_'+comment_id);}}
function _feedcomment_get_comment_id(ufi_section_div){var match=/^comment_(?:\d+_){1,2}(\d+)$/.exec(ufi_section_div.id);if(match){match=match[1];}
return match;}
function _feedcomment_get_first_existing_elem(prefix,target_fbid,item_id){var div=_feedcomment_get_commentable_item_div_nosource(target_fbid,item_id);if(div){var found=div.scry('*.'+prefix);if(found.length){return found[0];}}
var elem;if(elem=ge(prefix+'_'+item_id+'_'+target_fbid)){return elem;}else if(elem=ge(prefix+'_'+target_fbid)){return elem;}else{return ge(prefix+'_'+item_id)}}
function _feedcomment_get_credits_nux_tip(target_fbid,item_id){return _feedcomment_get_first_existing_elem('credits_nux_tip',target_fbid,item_id);}
function feedcomment_log_ufi_with_credits(){new AsyncRequest().setURI('/ajax/giftcredits/log.php').send();}
function feedcomment_show_credits_nux_tip(target_fbid,item_id){var elem=_feedcomment_get_credits_nux_tip(target_fbid,item_id);var input_elem=_feedcomment_get_credits_giver_input(target_fbid,item_id);if(!elem||!input_elem){return;}
if(!shown(elem)){Vector2.getElementPosition(input_elem,'document').add(-5,25).setElementPosition(elem);$('content').appendChild(elem);animation(elem).to('opacity',1).from(0).show().duration(200).go();}
var timeoutId=DataStore.get(elem,'nuxTipTimeoutId');if(timeoutId){clearTimeout(timeoutId);DataStore.remove(elem,'nuxTipTimeoutId');}}
function feedcomment_hide_credits_nux_tip(target_fbid,item_id){var elem=_feedcomment_get_credits_nux_tip(target_fbid,item_id);if(!elem){return;}
DataStore.set(elem,'nuxTipTimeoutId',setTimeout(hide.bind(null,elem),150));}
function feedcomment_increment_credits_input(input_id,default_increment){var input_elem=$(input_id);if(!input_elem){return;}
var cur_value=parseInt(input_elem.value,10)||0;if(cur_value<0){cur_value=0;}
input_elem.value=cur_value+default_increment;return true;}
function feedcomment_verify_credits(input_elem){if(input_elem.value==''){input_elem.value=0;}else if(!/^\d*$/.test(input_elem.value)){input_elem.value=0;animation(input_elem).to('background','#fff').from('#fcc').duration(140).go();}}

function InlineParticipants(targetId,asyncUri){this.asyncUri=asyncUri;this.target=$(targetId);this.targetId=targetId;if((!this.target)||this.target.pending){return;}
if(this.target.cached){this.toggleVisibility();}else{this.initializeFromTarget();this.fetchParticipants();}}
copy_properties(InlineParticipants.prototype,{fetchParticipants:function(){this.target.pending=true;new AsyncRequest().setURI(this.asyncUri).setMethod('GET').setReadOnly(true).setData(this.getFetchData()).setHandler(bind(this,'fetchedActorsResponse')).setErrorHandler(bind(this,'fetchedActorsError')).send();this.loadTimeout=setTimeout(this.showLoadIndicator.bind(this),200);},showLoadIndicator:function(){this.loadTimeout=null;if(this.target.pending){this.loading=true;CSS.addClass(this.target,'participants_loading');show(this.target);}},hideLoadIndicator:function(){if(this.loadTimeout){clearTimeout(this.loadTimeout);this.loadTimeout=null;}
if(this.loading){CSS.removeClass(this.target,'participants_loading');}},getSearchUri:function(){return this.target.getAttribute("search_href");},fetchedActorsResponse:function(asyncResponse){var payload=asyncResponse.getPayload();var show_more=payload["has_more"];var actors=payload["actors"];var see_all_js=payload["see_all_js"];var nameContainers=[];if(!actors){return this.fetchedActorsError();}
this.hideLoadIndicator();for(var i=0;i<actors.length;i++){var container=this.createNameContainer(actors[i]);this.target.appendChild(container);}
if(show_more){var search_uri=this.getSearchUri();var search_text=payload['more_text']||this.getSearchText();if(search_uri){var search_link=$N('a',{href:search_uri,className:'see_all'},search_text);if(see_all_js){var click_handler=new Function(see_all_js);Event.listen(search_link,'click',click_handler);}
this.target.appendChild(search_link);}}
this.target.pending=false;this.target.cached=true;this.toggleVisibility(true);animation(this.target).show().from('opacity',0).to('opacity',1).duration(450).go();},getSearchText:function(){return _tx("See all...");},fetchedActorsError:function(asyncResponse){this.target.pending=false;var search_uri=this.getSearchUri();if(search_uri){goURI(search_uri);}else{hide(this.target);}},createNameContainer:function(spec){var container=$N("div",{title:spec.name,className:"name_container "+
(spec.div_class||"")},null);var img=new RoundedImage(spec.img_src);img.setAlt(spec.name);if(this.cornerBackground){img.setBackground(this.cornerBackground);}
var pic=img.render();if(spec.profile_href){var pic_link=$N('a',{className:"pic_container",href:spec.profile_href,onclick:spec.profile_onclick||''},pic);var name_link=$N('a',{href:spec.profile_href,onclick:spec.profile_onclick||''},spec.first_name);}else{var pic_link=$N('span',{className:"pic_container"},pic);var name_link=$N('span',{className:"name_link"},spec.first_name);}
container.appendChild(pic_link);container.appendChild($N('span',{className:"name"},name_link));return container;},toggleVisibility:function(first_time){if(!first_time){toggle(this.targetId);}}});function StoryParticipants(targetId){var asyncUri='/ajax/feed_participants_ajax.php';this.parent.construct(this,targetId,asyncUri);}
copy_properties(StoryParticipants.prototype,{initializeFromTarget:function(){this.storyKey=this.target.getAttribute("story_key");this.storyUser=this.target.getAttribute("user");},getFetchData:function(){return{sid:this.storyKey,uid:this.storyUser};}});StoryParticipants.extend('InlineParticipants');function MutualFriends(targetId){var asyncUri='/ajax/mutual_friends_ajax.php';this.parent.construct(this,targetId,asyncUri);}
copy_properties(MutualFriends.prototype,{initializeFromTarget:function(){this.friend=this.target.getAttribute("friend");},getFetchData:function(){return{uid:this.friend};},getSearchText:function(){return _tx("See all mutual friends");}});MutualFriends.extend('InlineParticipants');function SearchMutualFriends(targetId){this.parent.construct(this,targetId);}
copy_properties(SearchMutualFriends.prototype,{getFetchData:function(){return{uid:this.friend,max:8};}});SearchMutualFriends.extend('MutualFriends');function SuggestionReceivers(targetId,suggesters,newcomer,receiver){var asyncUri='/ajax/suggestion_receivers_ajax.php';copy_properties(this,{suggesters:suggesters,newcomer:newcomer,receiver:receiver});this.parent.construct(this,targetId,asyncUri);}
copy_properties(SuggestionReceivers.prototype,{getFetchData:function(){return{suggesters:this.suggesters,newcomer:this.newcomer,receiver:this.receiver};},initializeFromTarget:bagofholding});SuggestionReceivers.extend('InlineParticipants');function LikeParticipants(feedback_params,target_id,search_uri){var asyncUri='/ajax/like/participants.php';copy_properties(this,{feedback_params:feedback_params,search_uri:search_uri,cornerBackground:RoundedImage.BACKGROUND_GIRLIE});this.parent.construct(this,target_id,asyncUri);}
copy_properties(LikeParticipants.prototype,{getFetchData:function(){return{feedback_params:JSON.encode(this.feedback_params)};},getSearchUri:function(){return this.search_uri;},fetchedActorsResponse:function(response){LikeController.informUpdateState(this.feedback_params.target_fbid,response.getPayload().like_state_info);this.parent.fetchedActorsResponse(response);},initializeFromTarget:bagofholding,toggleVisibility:function(first_time){if(first_time){toggle_feedcomments_box_open(this.feedback_params.target_fbid,this.feedback_params.item_id,this.feedback_params.source,false);}
CSS.toggleClass(this.target.parentNode,'participants_not_expanded');this.parent.toggleVisibility(first_time);}});LikeParticipants.extend('InlineParticipants');

function TextAreaControl(textarea){copy_properties(this,{autogrow:false,clearHeightOnBlur:false,shadow:null,originalHeight:null,metricsValue:null});this.parent.construct(this,textarea);};TextAreaControl.extend('TextInputControl');copy_properties(TextAreaControl.prototype,{setAutogrow:function(autogrow,clearHeightOnBlur){this.autogrow=autogrow;this.clearHeightOnBlur=clearHeightOnBlur;this.refreshShadow();CSS.addClass(this.getRoot(),'DOMControl_autogrow');return this;},setFocused:function(focused){if(this.autogrow&&!focused&&this.isEmpty()&&this.clearHeightOnBlur){this.getRoot().style.height='';}
return this.parent.setFocused(focused);},setOriginalHeight:function(height){this.originalHeight=height;return this;},onupdate:function(){this.parent.onupdate();var r=this.getRoot();if(this.autogrow&&r.value!=this.metricsValue){this.metricsValue=r.value;if(CSS.getStyle(r,'fontSize')==""){return false;}
copy_properties(this.shadow.style,{fontSize:parseInt(CSS.getStyle(r,'fontSize'),10)+'px',fontFamily:CSS.getStyle(r,'fontFamily'),width:(Vector2.getElementDimensions(r).x-8)+'px'});DOM.setContent(this.shadow,HTML(htmlize(r.value)));if(this.isEmpty()&&this.originalHeight){r.style.height=this.originalHeight+'px';}else{r.style.height=Math.max(this.originalHeight,Vector2.getElementDimensions(this.shadow).y+15)+'px';}}},refreshShadow:function(){if(this.autogrow){this.shadow=$N('div',{className:'DOMControl_shadow'});DOM.getRootElement().appendChild(this.shadow);var r=this.getRoot();if(!this.originalHeight){this.originalHeight=parseInt(CSS.getStyle(r,'height'),10)||Vector2.getElementDimensions(this.getRoot()).y;}}else{if(this.shadow){DOM.remove(this.shadow);}
this.shadow=null;}}});function autogrow_textarea(element){element=$(element);if(!element._hascontrol){element._hascontrol=true;new TextAreaControl(element).setAutogrow(true);}}

function LikeController(){}
copy_properties(LikeController,{saveChangeLike_d:fc_with_target(function(target_info,like_exists){var feedback_params={actor:target_info.target_owner,viewer:target_info.viewer,item_id:target_info.item_id,target_fbid:target_info.target_fbid,type_id:target_info.type_id,source:target_info.source,assoc_obj_id:target_info.assoc_obj_id,extra_story_params:target_info.extra_story_params};LikeController.saveChangeLike(feedback_params,like_exists,target_info.check_hash);}),saveChangeLike:function(feedback_params,like_exists,check_hash){var target_fbid=feedback_params.target_fbid;LikeController.informChangeLike(target_fbid,like_exists);var data={feedback_params:JSON.encode(feedback_params),should_delete:!like_exists,check_hash:check_hash};var handler=bind(null,LikeController.changeLikeResponse,target_fbid,like_exists);new AsyncRequest().setURI('/ajax/like/like.php').setData(data).setHandler(handler).setErrorHandler(handler).send();},changeLikeResponse:function(target_fbid,like_exists,response){if(response.isReplay()){LikeController.informChangeLike(target_fbid,like_exists);}else{if(response.getError()){if(!response.getErrorIsWarning()){LikeController.informChangeLike(target_fbid,!like_exists);}
ErrorDialog.showAsyncError(response);}}},informChangeLike:function(target_fbid,like_exists){LikeController.informUpdateState(target_fbid,{exists:like_exists});},informUpdateState:function(target_fbid,message){Arbiter.inform('like/update/'+target_fbid,message);}});function LikeComponent(feedback_params,exists,container_id){copy_properties(this,{feedback_params:feedback_params,exists:exists,container_id:container_id,container:null});Arbiter.subscribe('like/update/'+feedback_params.target_fbid,this.updateState.bind(this));}
copy_properties(LikeComponent.prototype,{updateState:function(type,message){if(!this.init()){return;}
this._updateState(message);},_updateState:function(message){if(typeof message.exists!='undefined'){this._updateLikeState(message.exists);}},_updateLikeState:function(exists){if(exists==this.exists){return;}
this.exists=exists;this.updateClasses();},init:function(){this.container=ge(this.container_id);return!!this.container;},updateClasses:function(){CSS.conditionClass(this.container,'like_exists',this.exists);CSS.conditionClass(this.container,'like_not_exists',!this.exists);},_updateContent:function(div_exists,div_not_exists,content_exists,content_not_exists){content_exists=HTML(content_exists);content_not_exists=HTML(content_not_exists);if(content_exists!=div_exists.innerHTML){DOM.setContent(div_exists,content_exists);}
if(content_not_exists!=div_not_exists.innerHTML){DOM.setContent(div_not_exists,content_not_exists);}}});function LikeLink(feedback_params,exists,container_id){this.parent.construct(this,feedback_params,exists,container_id);}
LikeLink.extend('LikeComponent');function LikeBox(feedback_params,exists,has_other_users,container_id){copy_properties(this,{has_other_users:has_other_users,animating:false,pending_animation:false});this.parent.construct(this,feedback_params,exists,container_id);}
copy_properties(LikeBox,{BOX_ANIM_TIME:200,SENTENCE_ANIM_TIME:200,PIC_ANIM_TIME:300});copy_properties(LikeBox.prototype,{init:function(){if(!this.parent.init()){return false;}
copy_properties(this,{sentence_container:DOM.find(this.container,'div.like_sentence_container'),sentence_exists:DOM.find(this.container,'div.like_sentence_exists'),sentence_not_exists:DOM.find(this.container,'div.like_sentence_not_exists')});return true;},updateClasses:function(){this.parent.updateClasses();var has_likes=this.exists||this.has_other_users;CSS.conditionClass(this.container,'has_likes',has_likes);CSS.conditionClass(this.container,'no_likes',!has_likes);},onDoneAnimating:function(){this.animating=false;if(this.pending_animation){this.pending_animation=false;this._animate();}else{this.updateClasses();}},_updateState:function(message){if(message.sentence_exists&&message.sentence_not_exists){this._updateContent(this.sentence_exists,this.sentence_not_exists,message.sentence_exists,message.sentence_not_exists);if(!this.init()){return false;}}
this.parent._updateState(message);},_updateLikeState:function(exists){if(exists==this.exists){return;}
this.exists=exists;if(this.animating){this.pending_animation=!this.pending_animation;return false;}
this._animate();},_animate:function(){this.animating=true;var was_expanded=(!this.exists||this.has_other_users);var expanded=(this.exists||this.has_other_users);var ondone=bind(this,'onDoneAnimating');if(!was_expanded&&expanded){ondone();CSS.setOpacity(this.sentence_container,0);animation(this.container).from('height','0px').to('height','auto').duration(LikeBox.BOX_ANIM_TIME).show().go();animation(this.sentence_container).to('opacity',1).duration(LikeBox.BOX_ANIM_TIME).go();return;}else if(was_expanded&&!expanded){var close_ondone=bind(this,function(){ondone();feed_comment_hide_add_box(this.feedback_params.target_fbid,this.feedback_params.item_id,this.feedback_params.source,false);});animation(this.sentence_container).to('opacity',0).duration(LikeBox.BOX_ANIM_TIME).go();animation(this.container).to('height','0px').duration(LikeBox.BOX_ANIM_TIME).hide().ondone(close_ondone).go();return;}
var sentence_show=this.exists?this.sentence_exists:this.sentence_not_exists;var sentence_hide=this.exists?this.sentence_not_exists:this.sentence_exists;animation(sentence_hide).to('opacity',0).duration(LikeBox.SENTENCE_ANIM_TIME).hide().go();var sentence_show_anim=animation(sentence_show).from('opacity',0).to('opacity',1).duration(LikeBox.SENTENCE_ANIM_TIME).show();var viewer_pic=DOM.scry(this.container,'div.like_participant_viewer')[0];if(!viewer_pic){sentence_show_anim.ondone(ondone);}
sentence_show_anim.go();animation(this.sentence_container).from('height',Vector2.getElementDimensions(sentence_hide).y).to('height',Vector2.getElementDimensions(sentence_show).y).duration(LikeBox.SENTENCE_ANIM_TIME).go();if(viewer_pic){var border_pic=DOM.scry(this.container,'div.like_participant_border')[0];if(this.exists){CSS.setOpacity(viewer_pic,0);var viewer_anim=animation(viewer_pic).from('width','0px').to('width','auto').show().duration(LikeBox.PIC_ANIM_TIME).checkpoint().to('opacity',1).duration(LikeBox.PIC_ANIM_TIME).ondone(ondone);if(border_pic){animation(border_pic).to('opacity',0).hide().duration(LikeBox.PIC_ANIM_TIME).ondone(bind(viewer_anim,viewer_anim.go)).go();}else{viewer_anim.go();}}else{var viewer_anim=animation(viewer_pic).to('opacity',0).duration(LikeBox.PIC_ANIM_TIME).checkpoint().to('width','0px').duration(LikeBox.PIC_ANIM_TIME);if(border_pic){var border_anim=animation(border_pic).from('opacity',0).to('opacity',1).show().duration(LikeBox.PIC_ANIM_TIME).ondone(ondone);viewer_anim.ondone(bind(border_anim,border_anim.go));}else{viewer_anim.ondone(ondone);}
viewer_anim.go();}}}});LikeBox.extend('LikeComponent');

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