/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 18th 2010 11:33:02 AM PDT
Machine: 10.16.139.101
Locale: nu_ll
Path: js/58kuswau1gws40k4.pkg.js
*/

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

function typeahead_mentions(a,c,b){this.element=$(a);b=copy_properties({delimiter:'@',anchor_block:true,max_display:4,max_results:4,auto_select:false},b||{});this.active=true;this.selected=null;c=new search_friend_source(c,true);c.allowTypes([search_friend_source.TYPES.USER,search_friend_source.TYPES.PAGE,search_friend_source.TYPES.APP,search_friend_source.TYPES.GROUP,search_friend_source.TYPES.EVENT]);this.parent.construct(this,a,c,b);CSS.addClass(this.dropdown,'typeahead_search');CSS.addClass(this.dropdown,'typeahead_mentions');this.initializeCleanup();this.hide();}typeahead_mentions.extend('typeaheadpro');copy_properties(typeahead_mentions.prototype,{_onchange:bagofholding,set_class:bagofholding,set_value:bagofholding,update_class:bagofholding,recalc_scroll:bagofholding,clear_placeholder:bagofholding,initializeCleanup:function(){Event.listen(this.element,'drop',Event.kill);Event.listen(this.element,'paste',function(){this.element.setOpacity(0);this.element.setStyle('height',this.element.offsetHeight+'px');this.cleanup.bind(this).defer(100);}.bind(this));},setup_anchor:function(){return this.element.parentNode.parentNode;},get_value:function(){var d=Text.getRange(),b=Text.getFocusNode(d,this.element),e=Text.getFocusValue(d,b),c=Text.getFocusOffset(d,b);if(!d||!e||d.collapsed===false)return '';var a=e.lastIndexOf(this.delimiter,c);if(a<0||(a>0&&(/\w/).test(e.charAt(a-1))))return '';return e.slice(a,c).trim();},check_value:function(){if(DOM.getText(this.element).lastIndexOf(this.delimiter)==-1){if(this.value==this.delimiter)this.hide();return;}if(!this.ready||!this.active){if(!this.loading){this.loading=true;this.source.initialize(function(){this.ready=true;this.results_text=this.delimiter;this.check_value();}.bind(this));this.set_message(_tx("Hle\u00f0ur..."));this.show();}return;}var a=this.get_value();if(a!=this.value){this.dirty_results();this.value=a;}if(a==this.delimiter){this.set_message(_tx("Type the name of someone or something..."));this.show();}},_onblur:function(event){this.fixBreak();this.hide();},_onfocus:function(event){this.fixBreak();this.focused=true;this.results_text='';},_onkeydown:function(event){event=$E(event);var a=event?Event.getKeyCode(event):-1;if(ua.firefox()&&event.getModifiers().meta&&(a==KEYS.LEFT||a==KEYS.RIGHT))event.kill();if(a==KEYS.RETURN)if(this.visible){event.kill();}else if(document.selection){Text.insertBreak();event.kill();}if(this.visible)return this.parent._onkeydown(event);},_onkeypress:function(event){if(this.visible)return this.parent._onkeypress(event);var a=event?Event.getKeyCode(event):-1;if(ua.firefox()&&a==KEYS.BACKSPACE){var b=Text.getFocusNode(),c=Text.getFocusOffset();if(c==0){b=b.previousSibling;}else if(b==this.element&&c>0)b=this.element.childNodes[c-1];if(this.isMention(b))DOM.remove(b);}},_onkeyup:function(event){this.check_value();if(this.visible)return this.parent._onkeyup(event);},_onselect:function(h){if(!h)return;var j=this.value,f=this.element.childNodes;for(var a=0,c=f.length;a<c;a++){var e=f[a];if(this.isText(e)){var i=e.data,b=i.lastIndexOf(j,Text.getFocusOffset());if(b>-1){var d=this.createMention(h);var g=document.createTextNode(i.substring(0,b).replace(/[\s\xa0]*$/g,'')+"\xa0");e.data="\xa0"+i.substring(b+j.length).replace(/^[\s\xa0]*/g,'');this.element.insertBefore(d,e);this.element.insertBefore(g,d);this.cleanup();Text.setFocusAfter(d);break;}}}this.hide();},createSpacer:function(){return document.createTextNode("\xa0");},createMention:function(c){var a={id:c.i,text:c.t};var b=$N('a',{href:'#',tabIndex:-1,className:'mention',unselectable:'on',contentEditable:false,oncontextmenu:Event.kill,onclick:Event.kill,onfocus:Event.kill},$N('span',{contentEditable:!!document.selection},a.text));Event.listen(b,'mousedown',this.selectMention.bind(this,b));DataStore.set(b,'mention',a);return b;},selectMention:function(a,event){if(event)event.kill();if(!a)return;if(!a.previousSibling)DOM.insertBefore(this.createSpacer(),a);setTimeout(function(){this.element.focus();Text.selectNode(a);}.bind(this),0);},cleanup:function(){var a=this.element.firstChild;while(a){if(!this.isText(a)&&!this.isMention(a)&&!this.isBreak(a)){var c=document.createTextNode((DOM.getText(a)||''));this.element.replaceChild(c,a);a=c;}var b=a.previousSibling;if(b&&this.isText(b)&&this.isText(a)){a.data=b.data+a.data;this.element.removeChild(b);}else a=a.nextSibling;}this.element.setStyle('height','').setOpacity(1);Text.focusElement(this.element);},getMessage:function(){var a=$A(this.element.childNodes).map(function(c){if(this.isBreak(c))return "\n";var b=this.isMention(c);if(b){var d=b.text.replace(/[\\\]:]/g,function(e){return '\\'+e;});return '@['+b.id+':'+d+']';}return DOM.getText(c);},this);return a.join('').replace(/\xa0/g,' ').trim();},setMessage:function(a){DOM.setText(this.element,a);this.fixBreak();},focusInput:function(){this.element.focus();},setActive:function(a){this.active=a;if(!a)DOM.setText(this.element,DOM.getText(this.element));},enable:function(){this.element.contentEditable=true;return this;},disable:function(){this.element.contentEditable=false;return this;},isBreak:function(a){return DOM.isNode(a,'br');},isText:function(a){return DOM.isNode(a,['#text','#whitespace']);},isMention:function(a){return DOM.isNode(a,'a')&&DataStore.get(a,'mention');},fixBreak:document.selection?bagofholding:function(){var a=this.element.lastChild;if(!a||!this.isBreak(a))this.element.appendChild($N('br'));}});var Text=(function(){var a;if(window.getSelection){a={getRange:function(b){b=b||this.getSelection();return b.rangeCount>0?b.getRangeAt(0):null;},getSelection:function(){return window.getSelection();},getFocusNode:function(b){b=b||this.getRange();return b&&b.endContainer;},getFocusValue:function(c,b){c=c||this.getRange();b=b||this.getFocusNode(c);return b.data;},getFocusOffset:function(c,b){c=c||this.getRange();return c.endOffset||0;},setFocus:function(b,c){if(!b)return;this.getSelection().collapse(b,c);},setFocusAfter:function(b){var c=b.parentNode;this.setFocus(c,$A(c.childNodes).indexOf(b)+1);},focusElement:function(b){b.focus();this.setFocus(b,b.childNodes.length);},insertBreak:bagofholding,selectNode:function(b){if(!b)return;var d=this.getSelection(),c=this.getRange(d);d.collapse(b,0);c.selectNode(b);d.addRange(c);}};}else if(document.selection)a={getRange:function(){return this.getSelection().createRange();},getSelection:function(){return document.selection;},getFocusNode:function(c,b){if(b)return b;c=c||this.getRange();return c.parentElement();},getFocusValue:function(c,b){c=c||this.getRange();b=b||this.getFocusNode(c);return b.innerText;},getFocusOffset:function(e,b){e=e||this.getRange();b=b||this.getFocusNode(e);var d=b,c=0;while(d==b){e.moveStart('character',-1);d=e.parentElement();c++;}return e.text.length;},setFocus:function(f,g){var i=this.getRange(),c=i.parentElement(),e=0,b=[],h=f.previousSibling;while(h){var j=h.previousSibling;b.push(c.removeChild(h));h=j;}i.moveToElementText(c);i.collapse();i.moveEnd('character',(g+e));i.collapse(false);i.select();for(var d=0;d<b.length;d++)c.insertBefore(b[d],c.firstChild);},setFocusAfter:function(b){var c=this.getRange();c.moveToElementText(b);c.moveEnd('character',1);c.collapse(false);c.select();},focusElement:function(b){b.focus();this.setFocusAfter(b);},insertBreak:function(){var b=this.getRange();b.pasteHTML('<br/>');b.moveEnd('character',1);b.collapse();b.select();},selectNode:function(b){var c=this.getRange();c.moveToElementText(b);c.moveStart('character',-1);c.moveEnd('character',1);c.select();}};return a;})();
function UIComposer(d,b,e,c){if(!d){throw new Error('UIComposer instantiated with no root.');return false;}this.root=d;this.id=d.id;this.input=b;this.user=e;var a={};try{a=JSON.decode(window.name);}catch(e){}if(a.pub){c.autoload=a.pub;c.autoloadData=a.pubdata;window.name='';}this.options=c;this.resetState=this.root.className;this.suppressMentions=(ua.opera()||ua.firefox()<3||ua.safariPreWebkit()||ua.iphone());this.initializeAttachments(c.attachments);this.extraSubmitData={};UIComposer.storeInstance(d.id,this);onunloadRegister(function(){delete UIComposer.instances[d.id];},true);this.isOnHomepage=c.isOnHomepage;if(c.isOnHomepage&&this.textAreaFocused()){this.ensureInitialized(true);}else if(c.autoload)this.ensureInitialized();}UIComposer.mixin('Arbiter',{ensureInitialized:function(a){if(this.initialized)return;this.initialized=true;this.initialize(a);},initialize:function(a){var c={contentArea:null,endpoint:'/ajax/updatestatus.php',autoload:null,autoloadData:null,targetID:0,attachments:[],contextData:{},placeholder:null,privacyWidget:null,privacyOptions:{},maxInputLength:0,mentionsData:null,overrideAttachmentEndpoint:false,sourceAppID:null,initialTextareaHeight:36,targetedPrivacyWidget:null};copy_properties(this,copy_properties(c,this.options));this.shouldHide=true;this.submitButton=DOM.scry(this.root,'span.UIComposer_SubmitButton input.UIButton_Text')[0]||null;this.privacyButton=DOM.scry(this.root,'div.UIComposer_PrivacyWidget')[0]||null;this.privacyCallout=DOM.scry(this.root,'div.UIComposer_PrivacyCallout')[0]||null;this.targetedPrivacyButton=DOM.scry(this.root,'div.UIComposer_TargetedPrivacyWidget')[0]||null;this.doMentionsPromptUpdatePref=false;this.doMentionsPromptUpdateOnsubmit=false;this.doMentionsCallout='';this.shownMentionsCallout=false;var b=DOM.scry(this.root,'form')[0];if(b)DOM.replace(b,DOM.scry(b,'div.UIComposer_Content')[0]);if(c.mentionsData&&!this.suppressMentions){this.initializeMentions(c.mentionsData);}else this.initializeTextarea(c.maxInputLength,c.initialTextareaHeight);this.initializeAutoscrape(a);this.initializeEvents();if(c.autoload)this.loadAttachment(c.autoload,c.autoloadData);},initializeAttachments:function(c){if(!c.length)return;this.apps=c.map(function(d){return d.app_id;});this.attachments=c;var b=this.root.find('ul.UIComposer_Attachments');var a=this.root.find('div.UIComposer_AttachmentArea');this.attachmentList=new UIComposerAttachmentList(this,b);this.attachmentArea=new UIComposerAttachmentArea(this,a);b.style.visibility='visible';this.buttonArea=DOM.scry(this.root,'div.UIComposer_ButtonArea')[0];},initializeTextarea:function(b,a){new TextAreaControl(this.input).setMaxLength(b).setOriginalHeight(a).setAutogrow(true).onfocus();this.input.onfocus='';},initializeMentions:function(e){var c=$N('div',{id:this.input.id,className:'Mentions_Input',contentEditable:true},document.createTextNode(this.input.value));CSS.setStyle(c,'width',this.input.offsetWidth+'px');DOM.replace(this.input,c);this.input=c;setTimeout(function(){c.focus();},0);var d=new typeahead_mentions(c,e.typeahead);this.getMessage=d.getMessage.bind(d);this.setMessage=d.setMessage.bind(d);this.focusInput=d.focusInput.bind(d);var b=this.enable.bind(this);this.enable=function(){d.enable();b();};var a=this.disable.bind(this);this.disable=function(){d.disable();a();};this.mentions=d;if(this.mentions){this.doMentionsPromptUpdatePref=e.prompt;this.doMentionsCallout=e.callout;}},initializeAutoscrape:function(b){var a=new UrlDetector(this.input);a.subscribe('urlDetected',this.autoScrape.bind(this));a.setSuppressDetectionCheck(this.hasState.bind(this,UIComposer.STATE.ATTACHMENT_AREA));if(b)a.startDetectionInterval();},initializeEvents:function(){addEventBase(this.input,'focus',this.focus.bind(this));Event.listen(this.submitButton,'click',this.post.bind(this));if(this.attachmentArea){var a=function(){this.shouldHide=false;}.bind(this);Event.listen(this.root,'click',a);Event.listen(this.root,'mousedown',a);Event.listen(document.body,'click',function(){if(this.shouldHide)this.blur();this.shouldHide=true;}.bind(this));}},focus:function(){this.ensureInitialized(true);if(this.privacyWidget){if(this.privacyOptions.change_default_dialog&&!this.privacyChangedToken)this.privacyChangedToken=this.privacyWidget.subscribe('privacyChanged',function(c,b){this.showChangeDefaultPrivacyDialog(b);}.bind(this));if(this.privacyOptions.callout&&!this.privacyMenuActivatedToken)this.privacyMenuActivatedToken=this.privacyWidget.subscribe('menuActivated',function(c,b){this.closePrivacyCallout();this.privacyWidget.unsubscribe(this.privacyMenuActivatedToken);delete this.privacyMenuActivatedToken;}.bind(this));}this.showMentionsCallout();var a=this.getMessage().trim();if(!a||a==this.placeholder){this.input.removeClass('DOMControl_placeholder');this.clearMessage();}this.showPrivacyCallout();this.mentionsPromptUpdatePref();Arbiter.inform(UIIntentionalStreamMessage.SET_AUTO_INSERT,{pause:true});if(this.isOnHomepage)this.buttonArea.removeClass('hidden_elem');this.addState(UIComposer.STATE.INPUT_FOCUSED);this.inform(UIComposer.EVENT.FOCUS,{});return this;},blur:function(){if(this.privacyWidget&&this.privacyWidget.dialogOpen()){if(!this.privacyCloseDialogToken)this.privacyCloseDialogToken=this.privacyWidget.subscribe('closeDialog',function(){this.privacyWidget.unsubscribe(this.privacyCloseDialogToken);delete this.privacyCloseDialogToken;}.bind(this));}else{if(this.attachmentList&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA)){this.removeState(UIComposer.STATE.INPUT_FOCUSED);if(!this.getMessage())this.clearMessage();if(this.isOnHomepage)this.buttonArea.addClass('hidden_elem');}this.hidePrivacyCallout();}if(!this.getMessage().trim()&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.resetMessage();this.hideMentionsCallout();Arbiter.inform(UIIntentionalStreamMessage.SET_AUTO_INSERT,{pause:false});this.inform(UIComposer.EVENT.BLUR,{});return this;},autoScrape:function(event,a){this.loadAttachment(UIComposer.APP_ID_POSTED,{url:a});},setAttachment:function(a){this.attachmentArea.setAttachment(a);return this;},getAttachment:function(){return this.attachmentArea.getAttachment();},setSourceAppId:function(a){this.sourceAppID=a;return this;},getSourceAppId:function(){return this.sourceAppID;},loadAttachment:function(a,c){this.ensureInitialized();var b=this.attachments[this.apps.indexOf(a)];if(this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.reset(true,false,false);if(!b){this.attachmentList.reset();return false;}this.attachmentList.select(b,c);this.focus();},showAttachment:function(a,b){this.focus();if(a.supports_privacy){this.showPrivacyWidget();this.showTargetedPrivacyWidget();}else{this.hidePrivacyWidget();this.hideTargetedPrivacyWidget();}this.hidePrivacyCallout();this.hideMentionsCallout();this.attachmentArea.show(a,b);this.inform(UIComposer.EVENT.SHOW_ATTACHMENT,{attachment:a});return this;},reset:function(b,c,a){if(b&&this.attachmentArea){this.attachmentList.reset();this.attachmentArea.reset();this.removeState(UIComposer.STATE.ATTACHMENT_AREA);this.removeState(UIComposer.STATE.ATTACHMENT_LOADED);}this.resetSubmitButtonText();if(this.privacyWidget)this.privacyWidget.reset();if(this.targetedPrivacyWidget)this.targetedPrivacyWidget.reset();this.showPrivacyWidget();this.showTargetedPrivacyWidget();this.enable();if(c)this.resetMessage();if(a!==false){this.focusInput();}else this.removeState(UIComposer.STATE.INPUT_FOCUSED);this.shouldHide=true;this.inform(UIComposer.EVENT.RESET,{});return this;},addState:function(a){this.root.addClass(a);return this;},removeState:function(a){this.root.removeClass(a);return this;},hasState:function(a){return this.root.hasClass(a);},toggleState:function(a){CSS.toggleClass(this.root,a);return this;},disable:function(){this.input.disabled=true;return this.addState(UIComposer.STATE.INPUT_DISABLED).disableButton();},enable:function(){this.input.disabled=false;return this.removeState(UIComposer.STATE.INPUT_DISABLED).enableButton();},disableButton:function(){this.disabled=true;CSS.addClass(this.submitButton.parentNode,'UIButton_Disabled');return this;},enableButton:function(){this.disabled=false;CSS.removeClass(this.submitButton.parentNode,'UIButton_Disabled');return this;},getPrivacyData:function(){if(this.privacyWidget)return this.privacyWidget.getData();return null;},getTargetedPrivacyData:function(){if(this.targetedPrivacyWidget)return this.targetedPrivacyWidget.getData();return null;},getData:function(){var b=this.getEndpoint();var a={},c=this.getMessage();if(!this.isValidPost())return null;if(!this.hasState(UIComposer.STATE.ATTACHMENT_AREA)){copy_properties(a,this.targetID>0?UIComposer.TARGET_DATA:UIComposer.HOME_DATA);copy_properties(a,{status:c,target_id:this.targetID,profile_id:this.user,app_id:this.sourceAppID,privacy_data:{}});copy_properties(a,this.extraSubmitData);if(this.attachmentArea&&this.attachmentArea.visible){copy_properties(a,this.attachmentArea.getData());if(!a.app_id)a.app_id=this.attachmentArea.attachment.app_id;}}else{a=this.attachmentArea.getData();if(a){copy_properties(a,{id:this.user,target_id:this.targetID,app_id:this.attachmentArea.attachment.app_id,action:'post',button:'publish_button',comment_text:c});if(this.attachmentArea.attachment.supports_privacy)a.privacy_data={};}}if(a){a.composer_id=this.id;a.hey_kid_im_a_composer=true;if(this.privacyWidget&&a.privacy_data)copy_properties(a.privacy_data,this.getPrivacyData());if(this.targetedPrivacyWidget){a.targeted_privacy_data={};copy_properties(a.targeted_privacy_data,this.getTargetedPrivacyData());}if(this.contextData)copy_properties(a,this.contextData);}return a;},setExtraSubmitData:function(b,a){this.extraSubmitData['composer_'+b]=a;return this;},clearExtraSubmitData:function(a){delete this.extraSubmitData['composer_'+a];return this;},isValidPost:function(){var a=this.getMessage();if(a==this.placeholder)return false;if(this.endpoint==this.getEndpoint()&&!a)return false;return true;},getEndpoint:function(){var a;if(this.hasState(UIComposer.STATE.ATTACHMENT_LOADED))a=this.attachmentArea.getEndpoint();return a||this.endpoint;},post:function(){if(this.disabled||!this.initialized)return false;if(this.privacyOptions.everyone_warning&&this.privacyWidget&&this.privacyWidget.isEveryonePrivacy()){this.showConfirmEveryonePrivacyDialog();return false;}this._post();return false;},_post:function(){var b=this.getEndpoint(),a=this.getData();if(!a)return false;this.disable();if(this.doMentionsCallout=='inmsg')a.mentions_suggest=1;if(this.shownMentionsCallout){a.shown_mentions_callout=1;if(this.doMentionsCallout)a.close_mentions_callout=1;}if(this.doMentionsPromptUpdateOnsubmit){a.mentions_composermsg_submit=1;this.doMentionsPromptUpdateOnsubmit=false;}this.hideMentionsCallout();var d=new AsyncRequest().setURI(b).setData(a).setHandler(this.handleResponse.bind(this)).setErrorHandler(this.handleError.bind(this)).setFinallyHandler(this.enable.bind(this));for(var c in this.contextData)d.setContextData(c,this.contextData[c]);d.send();},handleError:function(c){var a=c.getError();var b=c.getPayload();switch(a){case kError_Platform_CallbackValidationFailure:return this.showError(b.errorTitle,b.errorMessage);case kError_Platform_ApplicationResponseInvalid:return this.showError(b.errorTitle,b.showDebug?b.errorMessage:_tx("Vi\u00f0b\u00e6tu villa. Reyndu aftur s\u00ed\u00f0ar."));default:this.shouldHide=false;this.reset();return this.showError(c.getErrorSummary(),c.getErrorDescription());}},handleResponse:function(d){this.extraSubmitData={};var b=d.getError();var a=d.getErrorIsWarning();var c=d.getPayload();if(c.mentions_announce&&this.doMentionsCallout=='inmsg'){this.doMentionsCallout='focus';DOM.find(this.root,'div.UIComposer_MentionsCallout .UIComposer_PrivacyCallout_Text').setContent(c.mentions_announce);this.showMentionsCallout();}else{this.closeMentionsCallout(true);this.reset(true,true).publish(d);if(b&&a)ErrorDialog.showAsyncError(d);}},publish:function(e){var a=this.contentArea;if(a&&a.addContent){var c=e,f,g;if(e.getPayload){var d=e.getPayload();f=d.status;c=d.markup;if(d.payload_is_content)g=d;}g=g||HTML(c).getRootNode();var b=500;a.addContent(g,b);if(a.setStatus&&f)setTimeout(function(){a.setStatus(f);},b);}if(this.privacyWidget)this.privacyWidget.reset();if(this.targetedPrivacyWidget)this.targetedPrivacyWidget.reset();return this;},showPrivacyWidget:function(){show(this.privacyButton);},hidePrivacyWidget:function(){hide(this.privacyButton);},showTargetedPrivacyWidget:function(){show(this.targetedPrivacyButton);},hideTargetedPrivacyWidget:function(){hide(this.targetedPrivacyButton);},showPrivacyCallout:function(){this.root.scry('div.UIComposer_PrivacyCallout').map(show);},hidePrivacyCallout:function(){this.root.scry('div.UIComposer_PrivacyCallout').map(hide);},closePrivacyCallout:function(){this.hidePrivacyCallout();this.savePrivacyData('close','callout',function(){this.root.scry('div.UIComposer_PrivacyCallout').map(DOM.remove);}.bind(this));},showMentionsCallout:function(){if(this.doMentionsCallout!='focus'||this.hasState(UIComposer.STATE.ATTACHMENT_AREA))return;if(this.attachmentList)this.attachmentList.hide();this.shownMentionsCallout=true;this.root.scry('div.UIComposer_MentionsCallout').map(show);},hideMentionsCallout:function(){if(this.attachmentList&&!this.hasState(UIComposer.STATE.ATTACHMENT_AREA))this.attachmentList.reset();this.root.scry('div.UIComposer_MentionsCallout').map(hide);},closeMentionsCallout:function(a){this.hideMentionsCallout();if(this.shownMentionsCallout&&this.doMentionsCallout){this.doMentionsCallout='';if(a)return;new AsyncRequest().setURI('/ajax/mentions_ue.php').setData({type:'callout'}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();}},mentionsPromptUpdatePref:function(){if(this.doMentionsPromptUpdatePref){new AsyncRequest().setURI("/ajax/mentions_ue.php").setData({type:'prompt'}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();this.doMentionsPromptUpdatePref=false;this.doMentionsPromptUpdateOnsubmit=true;}},savePrivacyData:function(c,d,a){d=d||c;a=a||bagofholding;var b={};b[c]=true;new AsyncRequest().setData(b).setURI('/ajax/privacy/save_composer_data.php').setHandler(function(f){var e=f.getPayload();this.privacyOptions[d]=e[d];a();}.bind(this)).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();},showChangeDefaultPrivacyDialog:function(b){var a=function(){this.privacyWidget.unsubscribe(this.privacyChangedToken);delete this.privacyChangedToken;}.bind(this);new Dialog().setAsync(new AsyncRequest().setURI('/ajax/privacy/change_default_dialog.php').setData({privacy_data:b})).setHandler(this.savePrivacyData.bind(this,'seen_changed_default','change_default_dialog',a)).show();},showConfirmEveryonePrivacyDialog:function(){new Dialog().setAsync(new AsyncRequest().setURI('/ajax/privacy/confirm_everyone_dialog.php')).setHandler(this.savePrivacyData.bind(this,'seen_everyone','everyone_warning',this._post.bind(this))).show();},getContextData:function(){return this.contextData;},resetMessage:function(){this.input.addClass('DOMControl_placeholder');this.input.setStyle('height','');this.setMessage(this.placeholder);},clearMessage:function(){this.setMessage('');},getMessage:function(){return this.input.value.trim();},setMessage:function(a){this.input.value=a;},showError:function(b,a){new ErrorDialog().setTitle(b).setBody(a||_tx("Vi\u00f0b\u00e6tu villa. Reyndu aftur s\u00ed\u00f0ar.")).setButtons([Dialog.OK]).show();},resetSubmitButtonText:function(){if(this.orig_button_text)this.setSubmitButtonText(this.orig_button_text);},setSubmitButtonText:function(a){if(a)if(this.submitButton&&this.submitButton.value){this.orig_button_text=this.orig_button_text||this.submitButton.value;this.submitButton.value=a;}},focusInput:function(){this.input.select();this.input.focus();},textAreaFocused:function(){var a=DOM.scry(this.root,'textarea.UIComposer_TextArea')[0];return !a.hasClass('DOMControl_placeholder');}});copy_properties(UIComposer,{instances:{},getInstance:function(a){return this.instances[a];},storeInstance:function(b,a){this.instances[b]=a;},focusInstance:function(a){var c=this.instances;var b=c[a];if(!b)return;onloadRegister(function(){c[a].focus();setTimeout(function(){c[a].input.focus();},0);});},animation:function(b,a){return animation(b).ondone(a||bagofholding).ease(animation.ease.end).duration(200);}});copy_properties(UIComposer,{DIALOG_WIDTH:560,DIALOG_WIDTH_PIC:620,APP_ID_POSTED:2309869772,HOME_DATA:{action:'HOME_UPDATE',home_tab_id:1,profile_id:null,status:null,target_id:null},TARGET_DATA:{action:'PROFILE_UPDATE',profile_id:null,status:null,target_id:null},STATE:{PIC_NONE:'UIComposer_STATE_PIC_NONE',PIC_INSIDE:'UIComposer_STATE_PIC_INSIDE',PIC_OUTSIDE:'UIComposer_STATE_PIC_OUTSIDE',INPUT_FOCUSED:'UIComposer_STATE_INPUT_FOCUSED',INPUT_DISABLED:'UIComposer_STATE_INPUT_DISABLED',ATTACHMENT_AREA:'UIComposer_STATE_ATTACHMENT_AREA',ATTACHMENT_LOADED:'UIComposer_STATE_ATTACHMENT_LOADED'},EVENT:{FOCUS:'focus',BLUR:'blur',SHOW_ATTACHMENT:'show_attachment',RESET:'reset'}});
function UIComposerAttachmentList(c,g){this.composer=c;this.root=g;this.title=c.root.find('div.UIComposer_AttachmentTitle');var a=c.attachments,f=$A(DOM.scry(g,'li.UIComposer_Attachment a')),d=f.length;var e=function(j,i){var h=a[i];h.index=i;Event.listen(j,'click',this.select.bind(this,h,null));}.bind(this);var b=function(h,i){var j=$N('a',{href:"#",className:'UIComposer_MoreItem'},[$N('span',{className:'UIComposer_MoreIcon',style:{backgroundImage:'url('+h.menu_icon+')'}}),HTML(h.caption)]);e(j,i+d);return j;};f.each(e);if(a.length>d){this.menu=new UIActionMenu().setSuppressButton(true).setSuppressText(true).setTooltip(_tx("Meira")).setContentCallback(function(){return $N('div',a.slice(d).map(b));});g.appendChild($N('li',{className:'UIComposer_More'},this.menu.root));}}UIComposerAttachmentList.prototype={select:function(a,b){this.title.setContent(a.caption);this.title.setStyle('backgroundImage','url('+a.icon+')');this.composer.showAttachment(a,b);if(this.menu)this.menu.hideMenu();hide(this.root);return false;},hide:function(){hide(this.root);},reset:function(){show(this.root);}};
function MessageComposer(c,a,d,b){this.parent.construct(this,c,a,d,b);MessageComposer.instance=this;this.ensureInitialized();}MessageComposer.extend('UIComposer');MessageComposer.mixin({isInbox:true,getData:function(){var a=this.parent.getData();if(a){var b=serialize_form(this.root);b.ids=b['ids_'+this.id];a=copy_properties(b,a);}return a;},isValidPost:function(){return true;},postWithPhotoAttachment:function(d){var a={pid:d};var b={app_data:a,app_id:this.app_id,id:this.user,target_id:this.targetID,app_id:this.attachmentArea.attachment.app_id,comment_text:this.getMessage()};var c=serialize_form(this.root);c.ids=c['ids_'+this.id];b=copy_properties(c,b);b=copy_properties(c,this.getContextData());new AsyncRequest().setURI('/ajax/gigaboxx/endpoint/MessageComposerEndpoint.php').setData(b).setHandler(this.handleResponse.bind(this)).setErrorHandler(this.handleError.bind(this)).setFinallyHandler(this.enable.bind(this)).send();},reset:function(b,c,a){this.parent.reset(b,c,a);if(c){this.hideError();window.Dialog&&Dialog.getCurrent()&&Dialog.getCurrent().hide();}return this;},showError:function(b,a){$(this.id+'_title').setContent(HTML(b));$(this.id+'_msg').setContent(HTML(a));show($(this.id+'_error'));},hideError:function(){$(this.id+'_title').empty();$(this.id+'_msg').empty();hide($(this.id+'_error'));},focusInput:function(){this.input.focus();}});
UIIntentionalStory={_moreDetails:{},morePrivacyDetails:function(b,c,a){if(is_empty(this._moreDetails))onunloadRegister(function(){this._moreDetails={};}.bind(this));if(this._moreDetails[b])return;this._moreDetails[b]=true;new AsyncRequest().setURI('/ajax/privacy/more_details.php').setData({fbid:b,privacy_data:c}).setHandler(function(e){var d=e.getPayload().explanation;DOM.setContent(DOM.find(a,'span.uiTooltipText'),d);}).setErrorHandler(bagofholding).setTransportErrorHandler(bagofholding).send();}};
function UIIntentionalStreamWallToWall(g,d,e,f,c,a,h,b){this.parent.construct(this,g,d,e,f,h,b);copy_properties(this,{id:c,banter_id:a});}UIIntentionalStreamWallToWall.prototype.getValidParams=function(){return UIIntentionalStreamWallToWall.VALID_PARAMS;};UIIntentionalStreamWallToWall.prototype.getEndpoint=function(){return UIIntentionalStreamWallToWall.ENDPOINT;};UIIntentionalStreamWallToWall.extend('UIIntentionalStream');copy_properties(UIIntentionalStreamWallToWall,{VALID_PARAMS:['id','banter_id'],ENDPOINT:'/ajax/stream/walltowall.php'});
function ProfileStream(f,h,e,b,g,a,c,d){this.profile_id=f;this.viewer_id=h;this.filter=b;this.can_edit=a;this.is_page=c;this.is_split=d;this.settings_loaded=false;this.min_time=0;this.max_time=e;this.ajax_endpoint_uri='/ajax/stream/profile.php';this.streamElem=$('profile_minifeed');this.streamContainerElem=$('profile_stream_container');this.settingsElem=ge('profile_settings');this.pagerNextElem=ge('profile_pager_container');this.cache={};this.cache[this.filter]={html:this.streamElem.innerHTML,max_time:this.max_time,see_more:g};if(ProfileStream.instance)delete ProfileStream.instance;ProfileStream.instance=this;return this;}ProfileStream.getInstance=function(){return ProfileStream.instance;};ProfileStream.animationDuration=300;ProfileStream.dirtyCache=function(){if(stream=ProfileStream.getInstance())stream.cache={};};ProfileStream.FILTER={ALL_POSTS:1,POSTS_BY_ME:2,POSTS_BY_OTHERS:3,SINGLE_STORY:4,SETTINGS:-1};ProfileStream.clearStatusUI=function(){var a=$('profile_status');animation(a).to('opacity',0).duration(200).ondone(function(){CSS.addClass(a,'hidden_elem');}).go();};ProfileStream.setOnVisible=function(a){ProfileStream.onVisible=a;};ProfileStream.prototype.setStatus=function(e){if(this.can_edit&&e){var c=ge('profile_status');if(!c)return;var b=150;var d=$('status_text');var f=$('status_time_inner');var a=function(){d.setContent(HTML(e));f.setContent(HTML(_tx("r\u00e9tt \u00e1\u00f0an")));var h=ge('status_source');var g=ge('status_mobile_indicator');if(h)CSS.addClass(h,'hidden_elem');if(g)CSS.addClass(g,'hidden_elem');CSS.removeClass(c,'hidden_elem');new animation(c).to('opacity',1).duration(b).go();};if(DOM.getText(d).trim()){new animation(c).to('opacity',0).duration(b).ondone(a).go();}else{CSS.setOpacity(c,0);b=300;a();}}};ProfileStream.prototype.addContent=function(a){var f=bagofholding;var c=false;var d=null;if(this.filter!=ProfileStream.FILTER.ALL_POSTS){if(this.can_edit&&this.filter!=ProfileStream.FILTER.POSTS_BY_ME){c=true;d=this.is_split?_tx("This post will be moved to the Stream tab."):_tx("This post will appear in your filter.");}if(!this.can_edit&&this.filter!=ProfileStream.FILTER.POSTS_BY_OTHERS){c=true;d=this.is_split?_tx("\u00deetta innlegg ver\u00f0ur f\u00e6rt yfir \u00e1 veggflipan."):(this.is_page?_tx("\u00deetta innlegg mun birtast \u00ed s\u00edu a\u00f0d\u00e1anda."):_tx("This post will appear in the Friends filter."));}}if(c){var g=HTML('<div class="UIMessageBox status">'+d+'</div>');a=DOM.create('div',{},[g,a]);f=function(){animation(a).duration(6000).checkpoint().to('opacity','0').duration(ProfileStream.animationDuration).ondone(function(){DOM.remove(a);}).go();};}CSS.setStyle(a,'height','0px');CSS.setOpacity(a,'0');var e=this.streamElem.find('div.UIIntentionalStory_Profile_First');if(e)e.removeClass('UIIntentionalStory_Profile_First');CSS.addClass(a,'UIIntentionalStory_Profile_First');$(this.streamElem).prependContent(a);ProfileStream.dirtyCache();new animation(a).to('height','auto').to('opacity','1').duration(ProfileStream.animationDuration).ondone(f).go();var b=this.streamElem.scry('div.empty_wall');if(b.length)new animation(b[0]).to('opacity','0').duration(ProfileStream.animationDuration).ondone(function(){DOM.remove(b[0]);}).go();};ProfileStream.prototype.fadeAndSwap=function(a,b){animation(a).to('opacity',0).duration(100).hide().ondone(function(){CSS.setOpacity(b,0);animation(b).to('opacity',1).from(0).duration(100).show().go();}).go();return true;};ProfileStream.prototype.showSettings=function(c){if(this.filter==ProfileStream.FILTER.SETTINGS)return false;this.filter=ProfileStream.FILTER.SETTINGS;var g=function(){this.fadeAndSwap(this.streamContainerElem,this.settingsElem);}.bind(this);if(this.settings_loaded){g();}else{var a={id:this.profile_id};var f=URI.getRequestURI().getQueryData();var b=['show_importer','import_sid','import_uid'];for(var d=0;d<b.length;++d){var e=b[d];if(f[e])a[e]=f[e];}new AsyncRequest().setMethod('GET').setReadOnly(true).setData(a).setHandler(function(h){DOM.setContent($('profile_settings'),HTML(h.getPayload().innards));this.settings_loaded=true;g();}.bind(this)).setURI('/ajax/profile/show_settings.php').send();}return false;};ProfileStream.prototype.loadStream=function(b){var a=function(e,f){DOM.setContent(this.streamElem,HTML(e));if(f)this.fadeAndSwap(this.settingsElem,this.streamContainerElem);}.bind(this);var c=this.max_time;var d=false;if(this.min_time==0&&this.cache[this.filter]){this.max_time=this.cache[this.filter].max_time;if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'hidden_elem',!this.cache[this.filter].see_more);a(this.cache[this.filter].html,b);b=false;d=false;}if(ProfileStream.onVisible){ProfileStream.onVisible.remove();ProfileStream.onVisible=null;}this.loading=true;new AsyncRequest().setMethod('GET').setReadOnly(true).setURI(this.ajax_endpoint_uri).setData({profile_id:this.profile_id,viewer_id:this.viewer_id,filter:this.filter,max_time:c,try_scroll_load:d}).setContextData('clicktype','Filter Stories or Pagination',this.viewer_id!=this.profile_id).setHandler(function(e){if(this.max_time==0)this.cache[this.filter]={html:e.payload.stream_html,max_time:e.payload.max_time,see_more:e.payload.see_more};this.max_time=e.payload.max_time;if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'hidden_elem',!e.payload.see_more);a(e.payload.stream_html,b);}.bind(this)).setFinallyHandler(function(){this.loading=false;}.bind(this)).send();};ProfileStream.prototype.showStream=function(a){if(this.loading)return false;var b=this.filter;this.filter=a;this.min_time=0;this.max_time=0;this.loadStream(b==ProfileStream.FILTER.SETTINGS);return false;};ProfileStream.prototype.showMore=function(a,b){this.loading=true;new AsyncRequest().setMethod('GET').setReadOnly(true).setStatusElement(this.pagerNextElem).setURI(this.ajax_endpoint_uri).setData({profile_id:this.profile_id,viewer_id:this.viewer_id,filter:this.filter,is_scroll_load:b,max_time:this.max_time}).setContextData('clicktype','Filter Stories or Pagination',this.viewer_id!=this.profile_id).setHandler(function(d){if(this.pagerNextElem)CSS.conditionClass(this.pagerNextElem,'hidden_elem',!d.payload.see_more);DOM.appendContent(this.streamElem,HTML(d.payload.stream_html));this.max_time=d.payload.max_time;if(this.min_time==0)this.cache[this.filter]={html:this.streamElem.innerHTML,max_time:this.max_time,see_more:d.payload.see_more};}.bind(this)).setFinallyHandler(function(){this.loading=false;}.bind(this)).send();if(!b){var c={src:ft.NF_SOURCE_MINIFEED,evt:ft.NF_EVENT_SEE_MORE,actrs:this.profile_id,type:'page'};ft.logData(c);}};ProfileStream._createDialogOptionField=function(a,c){var b='<div class="dialog_option">'+'<input type="checkbox" id="'+a+'"/>'+'<span class="dialog_option_text">'+c+'</span>'+'</div>';return b;};

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