/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 21st 2010 7:37:07 AM PDT
Machine: 10.16.140.110
Locale: nu_ll
Path: js/6yw1kmf3f74sk80s.pkg.js
*/

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

function custom_source(b){this.parent.construct(this);if(b.length&&typeof(b[0])=="string")for(var a=0;a<b.length;a++)b[a]={t:b[a],i:b[a]};this.values=b;this.build_index();}custom_source.extend('static_source');custom_source.prototype.text_placeholder=custom_source.prototype.text_noinput=false;custom_source.prototype.gen_html=function(c,a){var b=['<div>',typeahead_source.highlight_found(c.t,a),'</div>'];if(c.s)b.push('<div><small>',htmlspecialchars(c.s),'</small></div>');return b.join('');};
function toggle_app_data(g,h){var d=ge(g);if(!d)return;var e=ge(h);if(!e)return;var c=$('dev_app_list').childNodes[0];if(!c)return;var b=ge('dev_app_infos');if(!b)return;var a=c.childNodes;for(var f=0;f<a.length;f++)if(CSS.hasClass(a[f],'flag_nav_item_selected')){CSS.removeClass(a[f],'flag_nav_item_selected');break;}var a=b.childNodes;for(var f=0;f<a.length;f++)if(CSS.hasClass(a[f],'app_show')){CSS.removeClass(a[f],'app_show');CSS.addClass(a[f],'app_hide');break;}CSS.addClass(d,'flag_nav_item_selected');CSS.removeClass(e,'app_hide');CSS.addClass(e,'app_show');}function app_source(b){var a=JSON.decode(b);if(a.searchable_apps){if(a.added_apps)this.added_apps=a.added_apps;a=a.searchable_apps;}this.parent.construct(this,a);}app_source.extend('custom_source');app_source.prototype.text_noinput='Enter an application name.';app_source.prototype.text_placeholder='Enter an application name.';app_source.prototype.gen_html=function(d,a){var c=d.it;var b=[];return ['<div class="app_option"><div class="icon" style="background-image: url(',c,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(d.t,a),'</span></div>'].join('');};app_source.prototype.gen_nomatch=function(){if(!this.added_apps)return this.parent.gen_nomatch();var c=typeahead_source.tokenize(this.owner.get_value());var a=[];for(var b=0;b<this.added_apps.length;b++)if(typeahead_source.check_match(c,this.added_apps[b]))a.push(this.added_apps[b]);if(a.length==0){return _tx("No application found. Please note not all applications support tabs.");}else if(a.length==1){return _tx("No application found. Please note {app-name} has already been added, and not all applications support tabs.",{"app-name":a[0]});}else if(a.length==2){return _tx("No application found. Please note {app-name-1} and {app-name-2} have already been added, and not all applications support tabs.",{"app-name-1":a[0],"app-name-2":a[1]});}else return _tx("No application found. Please note applications including {app-name-1} and {app-name-2} have already been added, and not all applications support tabs.",{"app-name-1":a[0],"app-name-2":a[1]});};
function removeSection(c,a){hide(c+'_'+a);$(c+'_'+a+'_remove').value='true';$('num_'+c+'_entries').value--;$(c+'add_link').style.display='block';var b=ge(c+'last_divider');if(b)b.style.display='';}function addSection(d,b){var c=parseInt($('num_'+d+'_entries').value);show(d+'_'+(c+1));$('num_'+d+'_entries').value=c+1;if(c+1>=b){$(d+'add_link').style.display='none';var a=ge(d+'last_divider');if(a)a.style.display='none';}}function schoolChangeStatus(a,b){a=ge(a);var c=a.options[a.selectedIndex].value;concentrate_name=b+'_concentration';concentrate_adder=b+'_concentration_adder';concentrate_degree=b+'_degree';concentrate_value_count=b+'_concentration_value_count';switch(c){case '3':case '1':case '2':showTableRow(getParentRow(concentrate_name+'1'));if($(concentrate_value_count).value>=2){showTableRow(getParentRow(concentrate_name+'2'));}else hide(getParentRow(concentrate_name+'2'));if($(concentrate_value_count).value>=3){showTableRow(getParentRow(concentrate_name+'3'));}else{hide(getParentRow(concentrate_name+'3'));showTableRow(getParentRow(concentrate_adder));}hide(getParentRow(concentrate_degree));$(concentrate_degree).value='';if(c=='2')showTableRow(getParentRow(concentrate_degree));break;default:hide(getParentRow(concentrate_degree));break;}}function addConcentration(a){concentrate_adder=a+'_adder';concentrate_value_count=a+'_value_count';if($(concentrate_value_count).value==2){$(concentrate_value_count).value=3;showTableRow(getParentRow(a+'3_name'));hide(getParentRow(concentrate_adder));}else{$(concentrate_value_count).value=2;showTableRow(getParentRow(a+'2_name'));}}function education_autocomplete_onselect(c){var d=function(){var e=new concentration_source(this.network);e.text_placeholder=_tx("Type your major or minor");e.text_nomatch=e.text_noinput=false;var f=new typeaheadpro(this,e);};$(this.custom_prefix+'_school_nk').value=c?c.i:-1;for(var b=1;b<=3;b++){var a=ge(this.custom_prefix+'_concentration'+b+'_name');if(a){typeaheadpro.kill_typeahead(a);if(c){a.network=c.i;a.onfocus=d.bind(a);}else{CSS.setClass(a,a.className.replace(/typeahead_[^\s]+/g,''));a.onfocus=null;}}}return false;}function education_autocomplete_onfound(a){if(!a)$(this.custom_prefix+'_school_nk').value=-1;}function workplace_autocomplete_onselect(a){$(this.custom_prefix+'_company_nk').value=a?a.i:-1;return false;}function workplace_autocomplete_onfound(a){if(!a)$(this.custom_prefix+'_company_nk').value=-1;}function checkNameLegit(){if($('i_swear').checked){$('name_change_form').submit();}else $('error').style.display='';}function on_work_history_city_selected(){}function education_remove_school(c,b){var a=new Dialog().setTitle(_tx("Remove this school?")).setBody(_tx("Are you sure you want to remove this school? You will lose all the data currently stored about it.")).setButtons([Dialog.newButton('remove',_tx("Remove")),Dialog.CANCEL]).setHandler(function(){removeSection(c,b);a.hide();}).show();return false;}function workhistory_remove_entry(b){var a=new Dialog().setTitle(_tx("Remove this job?")).setBody(_tx("Are you sure you want to remove this job? You will lose all the data currently stored.")).setButtons([Dialog.newButton('remove',_tx("Remove")),Dialog.CANCEL]).setHandler(function(){removeSection('work_history',b);a.hide();}).show();return false;}function FamilyInfoController(e,d,f,a){this.root=$(e);this.new_family_field_markup=d;this.typeahead_param=f;this.cur_index=a;this.addNewLink=$('add_more_family');this.only_node=null;var c=DOM.scry(this.root,'div.family_member');if(c.length==1)this.only_node=c[0];for(var b=0;b<c.length;b++)this.setUpHandlers(c[b]);this.checkHideAddNewLink();Event.listen(this.addNewLink,'click',this.addFamilyField.bind(this));}FamilyInfoController.CHILD_CONSTANTS={'104':1,'105':1};FamilyInfoController.MAX_FIELDS=100;FamilyInfoController.prototype.setUpHandlers=function(d){var i=DOM.find(d,'select.family_member_selector');var c=DOM.scry(d,'input[type="hidden"]')[0];var b=DOM.find(d,'input[type="text"].name_typeahead');var h=DOM.scry(d,'a.remove_link')[0];var e=c.value;var f=get_form_select_value(i);var g=b.value;var j=this.typeahead_param;var a=DOM.find(d,'input[type="text"].email_input');Event.listen(b,'focus',function(){var k=new friend_source(j);k.text_nomatch='';k.text_noinput='';k.text_placeholder=_tx("Enter Name");new typeaheadpro(this,k,{max_results:5,onselect:FamilyInfoController.familyIdSelect,auto_select:false,_node:d,_select:i,_original_id:e,_original_relation:f,_hidden_input:c,_email_elem:a});});Event.listen(i,'change',function(){this.checkShowTextData(d,i,c,b);var k=get_form_select_value(i);if(c.value&&k!=0&&k!=f){FamilyInfoController.constructNotifMessage(d,c,b.value,b,a);}else FamilyInfoController.removeNotifMessage(d);}.bind(this));Event.listen(b,'blur',function(){setTimeout(function(){if(!CSS.hasClass(b,'typeahead_found')&&g!=b.value){c.value='';FamilyInfoController.removeNotifMessage(d);}this.checkShowTextData(d,i,c,b);}.bind(this),5);}.bind(this));if(h)Event.listen(h,'click',function(){c.value='';b.value='';i.selectedIndex=0;if(!CSS.hasClass(d,'family_member_first')){CSS.addClass(d,'hidden_elem');}else CSS.addClass(h,'hidden_elem');return false;}.bind(this));};FamilyInfoController.prototype.checkShowTextData=function(f,g,c,b){var e=((c.value=='')&&b.value);var d=FamilyInfoController.CHILD_CONSTANTS[get_form_select_value(g)];var h=(e&&!d);if(h){var a=DOM.find(f,'div.email_explanation');DOM.setContent(a,HTML(_tx("Enter an email for <b>{name}<\/b>. {name} will receive an invitation to become your friend on Facebook and confirm your Family Request.",{name:htmlize(b.value)})));}CSS.conditionClass(f,'with_child_metadata',(e&&d));CSS.conditionClass(f,'with_email',h);};FamilyInfoController.prototype.addFamilyField=function(){var a=HTML(this.new_family_field_markup).getRootNode();this.root.appendContent(a);this.setUpHandlers(a);if(this.only_node){CSS.removeClass(this.only_node,'family_member_only');this.only_node=null;}this.new_family_field_markup=this.new_family_field_markup.replace(new RegExp('\\['+this.cur_index+'\\]','g'),'['+(this.cur_index+1)+']');this.cur_index++;this.checkHideAddNewLink();};FamilyInfoController.prototype.checkHideAddNewLink=function(){if(this.cur_index>=FamilyInfoController.MAX_FIELDS)CSS.addClass(this.addNewLink,'hidden_elem');};FamilyInfoController.familyIdSelect=function(b){if(b){if(b.i!=this._hidden_input.value){this._hidden_input.value=b.i;var a=get_form_select_value(this._select);if(a!=0&&((b.i!=this._original_id)||(a!=this._original_relation))){FamilyInfoController.constructNotifMessage(this._node,this._hidden_input,b.t,this.obj,this._email_elem);}else FamilyInfoController.removeNotifMessage(this._node);}CSS.removeClass(this._node,'with_child_metadata');CSS.removeClass(this._node,'with_email');this._email_elem.value='';}};FamilyInfoController.removeNotifMessage=function(a){var b=DOM.scry(a,'div.notif_message');if(b[0])DOM.remove(b[0]);};FamilyInfoController.constructNotifMessage=function(g,d,f,c,b){FamilyInfoController.removeNotifMessage(g);var e=$N('div',{className:'notif_message'});e.setContent(_tx("We will notify {name}, who must confirm that you are family before we can create a link from your profile. ",{name:f}));var a=HTML('<span> (<a>'+_tx("Cancel")+'</a>)</span>').getRootNode();e.appendContent(a);Event.listen(e.find('a'),'click',function(){DOM.remove(e);d.value='';c.value='';b.value='';}.bind(this));DOM.appendContent(g,e);};
function ProfileBoxController(g,a,h,b){this.profileId=g;this.applications={};this.columns=b;this.tabId=h;var e=null;var f;this.placeholderBox=document.createElement('div');CSS.setClass(this.placeholderBox,'box_placeholder');for(var d=0;d<a.length;d++)if(f=ge('box_app_'+a[d])){e=f.parentNode;var c={box:f,id:a[d]};this.applications[c.id]=c;f.addClass('moveable');(new Draggable(f)).addHandle(f.getElementsByTagName('h5')[0]).setNamespace('ProfileBoxController').setGutter(15).setUseAbsolute(true).setGrabHandler(function(i,j){i.expandColumns();i.placeholderBox.style.height=j.offsetHeight-6+'px';i.placeholderBox.style.width=j.offsetWidth+'px';CSS.addClass(j,'drag');j.style.width=j.offsetWidth+'px';j.parentNode.insertBefore(i.placeholderBox,j);j.style.zIndex=100;}.bind(null,this,f)).setDropHandler(function(i,j){this.resetPosition();i.placeholderBox.parentNode.insertBefore(this.getDOM(),i.placeholderBox);i.placeholderBox.parentNode.removeChild(i.placeholderBox);i.resetColumns();i.saveChanges(j);j.style.width=null;j.style.zIndex=null;}.bind(null,this,f)).setKey('app_id',c.id);(new Droppable(f)).setNamespace('ProfileBoxController').setZIndex(1).setDragMoveHandler(function(k,i,l,m){if(l.getDOM().offsetHeight>=m.y){var j=ProfileBoxController.insertElement(k.placeholderBox,this.getDOM());k.placeholderBox.style.width=this.getDOM().offsetWidth+'px';}}.bind(null,this,c.id));}if(this.columns.length>1)for(var d=0;d<this.columns.length;d++)(new Droppable(this.columns[d].dom)).setNamespace('ProfileBoxController').setZIndex(0).setDragOverHandler(function(j,i,k){if(j.placeholderBox.parentNode!=i){j.placeholderBox.style.width=i.offsetWidth+'px';i.appendChild(j.placeholderBox,this.getDOM());}}.bind(null,this,this.columns[d].dom));}ProfileBoxController.insertElement=function(d,e){var a=true,c=e.parentNode.childNodes;for(var b=0;b<c.length;b++)if(c[b]==e){break;}else if(c[b]==d){a=false;break;}if(a){e.parentNode.insertBefore(d,e);}else e.parentNode.insertBefore(e,d);return a;};ProfileBoxController.prototype.getAppFromId=function(a){return (/box_app_([0-9]+)/.exec(a)||[]).pop();};ProfileBoxController.prototype.getOrderFromDOM=function(){var a=[];this.columns.each(function(c){var d={column:c.column,order:[]};var b;var e=DOM.scry(c.dom,'div.box');for(var f=0;f<e.length;f++)if(e[f].id&&(b=this.getAppFromId(e[f].id)))d.order.push(parseInt(b,10));a.push(d);}.bind(this));return a;};ProfileBoxController.prototype.saveChanges=function(c){var a=this.getAppFromId(c.id);var b=DOM.find(c,'div.app_custom_content');b.style.visibility='hidden';CSS.addClass(c,'loading');new AsyncRequest().setURI('/ajax/profile/box.php').setData({action:'reorder',tab_id:this.tabId,order:this.getOrderFromDOM(),profile_id:this.profileId,app_id:a}).setHandler(function(d){DOM.replace(b,HTML(d.getPayload().box));CSS.removeClass(c,'drag');CSS.removeClass(c,'loading');}).send();};ProfileBoxController.prototype.expandColumns=function(){if(this.columns<2)return;var a=null;this.resetColumns();this.columns.each(function(b){a=Math.max(b.dom.offsetHeight,a);});this.columns.each(function(b){if(b.dom.offsetHeight!=a)b.dom.style.height=a+'px';});};ProfileBoxController.prototype.resetColumns=function(){this.columns.each(function(a){a.dom.style.height=null;});};var KEY_VAL=1;var VERTICAL_THUMBS=5;var EDIT_APP_THUMBS=6;var EDIT_REMOVE_APP_SECTION=7;var NO_INLINE_EDITOR={2361831622:1,2530096808:1};function ProfileInfoEdit(b,e,c){this.section_objs={};this.remember_edited=c;for(var a in e){var d=e[a];if(d.app_id){if(!NO_INLINE_EDITOR[d.app_id]){this.section_objs[d.section]=new ProfileInfoAppEditSection(d,this);ProfileInfoEdit.editors[d.section]=this.section_objs[d.section];}}else this.section_objs[d.section]=new ProfileInfoEditSection(d,this);}this.profile_id=b;this.info_tab=$('info_tab');this.info_sections=$('info_edit_sections');this.edit_all=$('info_edit_all');this.done_editing_all=$('info_done_editing_all');this.edit_all.onclick=this.onEditAll.bind(this,true);this.done_editing_all.onclick=this.onDoneEditingAll.bind(this);}ProfileInfoEdit.editors={};ProfileInfoEdit.uri='/ajax/profile/editinfo.php';ProfileInfoEdit.prototype.onEditAll=function(c){this.edit_all_mode=true;for(var a in this.section_objs){var d=this.section_objs[a];if(d.canEdit()){d.has_editor=false;d.closeEditor();}}CSS.addClass(this.info_tab,'edit_all_mode');var b=true;for(var a in this.section_objs){var d=this.section_objs[a];if(!d.canEdit())continue;d.getHeaderElem().onclick=this.editAllSetActiveSection.bind(this,d);if(b){d.populateEditor();d.openEditor(false);CSS.addClass(d.getSectionElem(),'edit_mode');if(c)ProfileInfoEdit.scrollToSection($('info_edits_div'));}b=false;}return false;};ProfileInfoEdit.prototype.editAllSetActiveSectionNext=function(a){var b=false;for(var c in this.section_objs){var d=this.section_objs[c];if(!d.canEdit())continue;if(b){if(!d.is_open&&!d.has_editor){CSS.addClass(d.getSectionElem(),'edit_mode');d.populateEditor();}d.toggleEditor(true);b=false;}else if(d.section!=a.section)d.closeEditor();if(d.section==a.section)b=true;}};ProfileInfoEdit.prototype.editAllSetActiveSection=function(a){for(var b in this.section_objs){var c=this.section_objs[b];if(!c.canEdit())continue;if(c.section==a.section){if(!c.is_open&&!c.has_editor){CSS.addClass(c.getSectionElem(),'edit_mode');c.populateEditor();}c.toggleEditor(true);}else c.closeEditor();}};ProfileInfoEdit.prototype.onDoneEditingAll=function(){for(var a in this.section_objs){var c=this.section_objs[a];if(c.canEdit()){var b=c.getSectionElem();c.cancelEditor();c.closeEditor();c.has_editor=false;CSS.removeClass(c.getSectionElem(),'edit_mode');c.getHeaderElem().onclick=null;}}if(this.remember_edited)new AsyncSignal('/ajax/nux_highlight.php',{action:"edit_info_tab"}).send();CSS.removeClass(this.info_tab,'edit_all_mode');this.edit_all_mode=false;return false;};ProfileInfoEdit.scrollToSection=function(a){animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(a)-40).ease(animation.ease.end).duration(400).go();};function ProfileInfoEditSectionBase(e,b){this.type=0;this.is_open=false;this.has_editor=false;this.app_id=0;this.controller=b;copy_properties(this,e);var c=e.section;copy_properties(this,{section_id:('info_section_'+c),header_id:('info_section_header_'+c),info_id:('info_section_info_'+c),editor_id:('info_section_editor_'+c),edit_id:('info_section_edit_'+c),edit_jaws_id:('info_section_edit_jaws_'+c),save_id:('info_section_save_'+c),cancel_id:('info_section_cancel_'+c)});var a=DOM.scry(this.getHeaderElem(),'a.close_edit');this.header_cancel_link=(a.length?a[0]:null);var d=this.getSectionElem();d.onmouseover=function(){CSS.addClass(this,'hover');};d.onmouseout=function(){CSS.removeClass(this,'hover');};}copy_properties(ProfileInfoEditSectionBase.prototype,{getSectionElem:function(){return $(this.section_id);},getHeaderElem:function(){return $(this.header_id);},getInfoElem:function(){return $(this.info_id);},getEditorElem:function(){return $(this.editor_id);},getEditElem:function(){return $(this.edit_id);},getEditJawsElem:function(){return $(this.edit_jaws_id);},getSaveElem:function(){return $(this.save_id);},getForm:function(){var a=this.getSaveElem();return a?a.form:null;},getCancelElem:function(){return $(this.cancel_id);},getAppId:function(){return this.app_id;},canEdit:function(){return true;}});ProfileInfoEditSectionBase.prototype.onClickEdit=function(){var b=this.getSectionElem();var a=this.getSectionElem();this.populateEditor();CSS.addClass(b,'edit_mode');CSS.removeClass(b,'empty');ProfileInfoEdit.scrollToSection(b);return false;};ProfileInfoEditSectionBase.prototype.populateEditor=function(){var d=this.getSectionElem();var b=this.getEditorElem();var c='<div class="fbloading"><span>'+_tx("Loading...")+'</span></div>';set_inner_html(b,c);var a={profile_id:this.controller.profile_id,section:this.section,type:6,app_id:this.getAppId(),edit_mode:true};new AsyncRequest().setURI(ProfileInfoEdit.uri).setReadOnly(true).setData(a).setHandler(this.replaceEditor.bind(this)).send();return false;};ProfileInfoEditSectionBase.prototype.replaceEditor=function(d){var f=this.getSectionElem();var b=this.getEditorElem();var c=d.getPayload();b.style.height='100px';DOM.setContent(b,HTML(c.editor));animation(b).to('height','auto').from('height','100px').duration(200).go();var e=this.getSaveElem();var a=this.getCancelElem();e.onclick=this.onSaveEditor.bind(this);a.onclick=this.onCancelEditor.bind(this);this.header_cancel_link&&(this.header_cancel_link.onclick=this.onCancelEditor.bind(this));this.has_editor=true;return false;};ProfileInfoEditSectionBase.prototype.onSaveEditor=function(){var a=this.getEditorElem();form=serialize_form(a);form.section=this.section;if(this.app_id)form.app_id=this.app_id;form.save=1;var b='<div class="fbloading"><span>'+'Saving...'+'</span></div>';set_inner_html(a,b);new AsyncRequest().setURI(ProfileInfoEdit.uri).setData(form).setHandler(function(e){var d=e.getPayload();var f=this.getSectionElem();if(d.editor){this.replaceEditor(e);return false;}this.has_editor=false;if(d.display){CSS.removeClass(f,'empty');}else CSS.addClass(f,'empty');var c=this.getInfoElem();set_inner_html(c,d.display);if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(f,'edit_mode');ProfileInfoEdit.scrollToSection(f);}if(d.basic_info_summary)profile_basic_info_summary_refresh(d.basic_info_summary);}.bind(this)).send();return false;};ProfileInfoEditSectionBase.prototype.onCancelEditor=function(){var a=this.getSectionElem();CSS.removeClass(a,'edit_mode');if(!this.controller.edit_all_mode){this.cancelEditor();}else{this.closeEditor(true);this.has_editor=false;}ProfileInfoEdit.scrollToSection(a);return false;};ProfileInfoEditSectionBase.prototype.cancelEditor=function(){var b=this.getSectionElem();var a=this.getForm();if(a)a.is_inactive=true;this.has_editor=false;return false;};ProfileInfoEditSectionBase.prototype.toggleEditor=function(a){var b=this.getSectionElem();if(!this.is_open){this.openEditor(a);}else this.closeEditor();};ProfileInfoEditSectionBase.prototype.warnIfUnsaved=function(){if(!this.is_open)return false;var b=this.getForm();if(b&&b.original_state&&!are_equal(b.original_state,serialize_form(b))){var d=this.getSaveElem();var a=[];var c=function(){d.click();this.closeEditor(true);};a.push({name:'save',label:_tx("Save"),handler:c.bind(this)});a.push({name:'dont_save',label:_tx("Don't Save"),className:'inputaux',handler:this.closeEditor.bind(this,true)});a.push(Dialog.CANCEL);new Dialog().setTitle(_tx("Unsaved Changes")).setBody(_tx("Some of your changes have not been saved.  Would you like to save your changes now?")).setButtons(a).setModal().show();return true;}return false;};ProfileInfoEditSectionBase.prototype.closeEditor=function(c){if(!c)if(this.warnIfUnsaved())return null;var b=this.getSectionElem();var a;if(this.has_editor&&(a=this.getForm()))a.is_inactive=true;CSS.addClass(b,'shut');CSS.removeClass(b,'open');this.is_open=false;};ProfileInfoEditSectionBase.prototype.openEditor=function(b){var c=this.getSectionElem();var a=this.getForm();if(a)a.is_inactive=false;CSS.addClass(c,'open');CSS.removeClass(c,'shut');this.is_open=true;if(b)ProfileInfoEdit.scrollToSection(c);};function ProfileInfoEditSection(d,a){this.parent.construct(this,d,a);var b=[this.edit_id,this.edit_jaws_id];for(i in b){var c=ge(b[i]);if(c)c.onclick=this.onClickEdit.bind(this);}}ProfileInfoEditSection.extend('ProfileInfoEditSectionBase');function ProfileInfoAppEditSection(d,a){this.parent.construct(this,d,a);this.app_id=d.app_id;if(ge('flyout_menu_info_section_'+this.app_id)){var b=this.getEditElem();var c=DOM.scry($('flyout_menu_info_section_'+this.app_id),'a');c[0].onclick=this.onClickEdit.bind(this);c[1].onclick=this.deleteBox.bind(this);flyout_menu(b).registerHTMLMenu('flyout_menu_info_section_'+this.app_id).setPosition(dropmenu.ALIGN_RIGHT).addHook('show',function(){CSS.addClass(b,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(b,'selected');}.bind(this));}this.items={};this.order={};this.on=true;}ProfileInfoAppEditSection.extend('ProfileInfoEditSectionBase');ProfileInfoAppEditSection.prototype.deleteBox=function(){var a=this.getSectionElem();var c='/ajax/profile/editinfo.php';var b={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_REMOVE_APP_SECTION,app_id:this.app_id};new AsyncRequest().setURI(c).setData(b).setHandler(function(e){var d=elementY(a);animation(a).to('height',0).blind().duration(200).hide().go();animation(DOMScroll.getScrollRoot()).to('scrollTop',d-150).ease(animation.ease.end).duration(200).go();}).send();return false;};ProfileInfoAppEditSection.editors={};ProfileInfoAppEditSection.prototype.newAdd=function(c){var d='/ajax/profile/editinfo.php';var a={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_APP_THUMBS,new_add:true,new_index:c.i,app_id:this.app_id};var b=function(g){var f=$('info_section_info_'+this.app_id);var e=document.createElement('div');set_inner_html(e,g.payload.item);f.childNodes[0].childNodes[1].appendChild(e);}.bind(this);new AsyncRequest().setURI(d).setData(a).setHandler(b).send();};ProfileInfoAppEditSection.prototype.onSaveEditor=function(){var g=this;var f=g.getSectionElem();var c=g.getEditorElem();var e={};var b=f.getElementsByTagName('li');for(var d=0;d<b.length;d++)e[d]=b[d].getAttribute('item');var h='/ajax/profile/editinfo.php';var a={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_APP_THUMBS,save:true,items:e,app_id:this.app_id};if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(f,'edit_mode');ProfileInfoEdit.scrollToSection(f);}new AsyncRequest().setURI(h).setData(a).send();return false;};function ProfileBoxesEdit(j,t,s,p){p=p||{};for(var k=0;k<s.length;k++){var c=$(s[k]);var b=DOM.scry(c,'div.box');for(var i=0;i<b.length;++i){var d=b[i];var h=DOM.scry(d,'a.box_editor');if(h.length>0){var g=h[0];var f=g.childNodes.length?g.firstChild:'';var a=d.id.replace('box_app_','');var m=document.createElement('div');if(f){m.appendChild(f);CSS.removeClass(f,'hidden_elem');}if(!ProfileBoxesEdit.NON_MOVEABLE[a]){if(p.name&&p.moveable_to_section[a]){var o=document.createElement('a');o.href='#';o.innerHTML=_tx("Move to {tab_name} tab",{tab_name:p.name});o.onclick=moveToTab.bind(this,j,a,p.from,p.to,p.to_tab_name,new URI(p.next_uri));m.appendChild(o);}else{var q=document.createElement('span');CSS.addClass(q,'unmovable');DOM.setContent(q,_tx("This Box cannot be added to the Wall tab"));m.appendChild(q);}if(!ProfileBoxesEdit.NON_REMOVEABLE[a]){var r=document.createElement('a');r.href='#';r.innerHTML=_tx("Remove Box");r.onclick=removeAppBox.bind(this,j,a,t,'box_app_');m.appendChild(r);}}var e=ProfileBoxesEdit.flymenuStyle[a]||'flyout_menu_18 link_menu';var n='box_edit_menu_'+a;var l=dropmenu.getExistingInstance(n);if(l)l.destroy();(new flyout_menu(g)).setMarkupContent(n,e,_tx("Edit Box"),m).addHook('show',function(u){CSS.addClass(u,'selected');}.bind(null,g)).addHook('hide',function(u){CSS.removeClass(u,'selected');}.bind(null,g));CSS.removeClass(g,'hidden_elem');}}}}ProfileBoxesEdit.NON_MOVEABLE={2356318349:1};ProfileBoxesEdit.NON_REMOVEABLE={2530096808:1,8152663228:1,7919256574:1,70004827638:1};ProfileBoxesEdit.flymenuStyle={2356318349:'flyout_menu_18'};function profile_insert_loading_layer(b){var a=$N('div');CSS.addClass(a,'loading_layer');b.parentNode.style.position='relative';a.style.position='absolute';b.parentNode.appendChild(a);return a;}function profile_basic_info_summary_refresh(a){$('flyout_menu_profile_basic_info_editor').remove();DOM.replace($('basic_info_summary_box'),HTML(a));}function profile_basic_info_summary_editor_onclick(){var d=$('basic_info_summary_box');var c=profile_insert_loading_layer(this);var a=this.value;var b=DOM.find(d,'div.'+a);var e=!this.checked?animation(b).to('height','0px').to('opacity',0).duration(200).hide():animation(b).to('height','auto').from('0px').to('opacity',1).from(0).duration(200).show();new AsyncRequest().setURI('/ajax/profile/basic_info.php').setData(this.checked?{show:a}:{hide:a}).setHandler(function(j){var i=DOM.find(d,'div.no_info');var f=true;var g=DOM.scry(this.form,'input[type="checkbox"]');for(var h=0;h<g.length&&f;h++)f&=!shown(g[h])||!g[h].checked;f?show(i):hide(i);e.go();}.bind(this)).setErrorHandler(function(f){this.checked=!this.checked;ErrorDialog.showAsyncError(f);}.bind(this)).setFinallyHandler(DOM.remove.bind(null,c)).send();}var FriendsBoxEditor={_submit:function(b){var a=$('app_content_2356318349');var d=DOM.find(a,'div.loading_placeholder');var c=$('profile_friends_box_inner_content');Vector2.getElementDimensions(c).setElementHeight(d);CSS.addClass(a,'is_loading');new AsyncRequest().setURI('/ajax/profile/friends_box.php').setData(b).setHandler(function(e){payload=e.getPayload();DOM.replace(c,HTML(payload.friendsBox));}).setFinallyHandler(CSS.removeClass.bind(null,a,'is_loading')).send();},setNumToShow:function(a){FriendsBoxEditor._submit({max_num_to_show:a.value});},toggleNetwork:function(a){var c=serialize_form(a.form).networks;var b={};var d=DOM.scry($('content_box_edit_menu_2356318349'),'div.networks_error')[0];if(c){b.networks=c;hide(d);}else{show(d);a.checked=true;return false;}FriendsBoxEditor._submit(b);return true;},addFriendOrList:function(b){var a;if(b.flid){a={add_friend_list:b.flid};}else if(b.i)a={add_friend:b.i};FriendsBoxEditor._submit(a);},removeFriendOrList:function(b){var a;if(b.flid){a={remove_friend_list:b.flid};}else if(b.i)a={remove_friend:b.i};FriendsBoxEditor._submit(a);},toggleShowNetworks:function(a){FriendsBoxEditor._submit({show_networks:a.checked});},toggleShowFriendsBox:function(a){FriendsBoxEditor._submit({hide_friendsbox:!a.checked});}};var ConnectionsBoxEditor={_submit:function(b){var a=$('app_content_70004827638');var d=DOM.find(a,'div.loading_placeholder');var c=$('profile_connections_box_inner_content');Vector2.getElementDimensions(c).setElementHeight(d);CSS.addClass(a,'is_loading');new AsyncRequest().setURI('/ajax/profile/connections_box.php').setData(b).setHandler(function(e){DOM.replace(c,HTML(e.getPayload()));}).setFinallyHandler(CSS.removeClass.bind(null,a,'is_loading')).send();},setNumToShow:function(a){ConnectionsBoxEditor._submit({max_num_to_show:a.value});}};function BlurbEditor(b,c,a){this.root=b;this.text=c;this.profileId=a;this.textElem=DOM.find(this.root,'div.text_wrapper');this.editLink=DOM.find(this.root,'a.edit_link');this.promptElem=DOM.find(this.root,'div.prompt');this.editorElem=DOM.find(this.root,'div.edit');this.inputBox=DOM.find(this.editorElem,'textarea');this.needCursorHack=ua.firefox()<3;this.cursorHacked=false;this.editLink.onmousedown=chain(this.editLink.onmousedown,this.toggleEditor.bind(this));this.promptElem.onmousedown=chain(this.promptElem.onmousedown,this.toggleEditor.bind(this));this.inputBox.onfocus=chain(this.inputBox.onfocus,DOM.setCaretPosition.bind(null,this.inputBox,0,Number.POSITIVE_INFINITY));this.inputBox.onkeypress=chain(this.inputBox.onkeypress,this.onkeypress.bind(this));if(!this.needCursorHack)this.inputBox.onblur=chain(this.inputBox.onblur,this.blur.bind(this));this.mode=BlurbEditor.READ;CSS.removeClass(this.editLink,'hidden_elem');}BlurbEditor.EDIT=1;BlurbEditor.READ=2;BlurbEditor.UPDATING=3;copy_properties(BlurbEditor.prototype,{_updateView:function(a){this.mode=a;if(this.mode==BlurbEditor.READ){CSS.removeClass(this.root,'blurb_editing');this.editLink.title=_tx("Edit");hide(this.editorElem);if(!this.text){hide(this.textElem);hide(this.editLink);show(this.promptElem);}else{hide(this.promptElem);show(this.textElem);show(this.editLink);}}else if(this.mode==BlurbEditor.EDIT){CSS.addClass(this.root,'blurb_editing');this.editLink.title=_tx("Save");this.inputBox.value=this.text;hide(this.textElem);hide(this.promptElem);show(this.editLink);show(this.editorElem);if(this.needCursorHack&&!this.cursorHacked){this.inputBox.focus();this.inputBox.blur();this.inputBox.onblur=chain(this.inputBox.onblur,this.blur.bind(this));this.cursorHacked=true;}this.inputBox.focus();}},toggleEditor:function(){if(this.mode==BlurbEditor.EDIT){this.blur();}else if(this.mode==BlurbEditor.READ){this._updateView(BlurbEditor.EDIT);}else this.mode==BlurbEditor.UPDATING;return false;},blur:function(a){if(this.mode!=BlurbEditor.EDIT)return;if(this.text==this.inputBox.value){this._updateView(BlurbEditor.READ);return;}this.mode=BlurbEditor.UPDATING;this.inputBox.disabled=true;CSS.addClass(this.inputBox,'updating');this._syncText(this.inputBox.value);new AsyncRequest().setURI('/ajax/profile/blurb.php').setData({blurb:this.text,profile_id:this.profileId}).setHandler(function(b){DOM.setContent(this.textElem,HTML(b.getPayload()));}.bind(this)).setFinallyHandler(function(){this._updateView(BlurbEditor.READ);CSS.removeClass(this.inputBox,'updating');this.inputBox.disabled=false;}.bind(this)).send();},_syncText:function(a){this.text=trim(a);this.inputBox.value=this.text;},onkeypress:function(a){var b=Event.getKeyCode(a);if(b==KEYS.TAB){this.blur();return false;}if(b==KEYS.ESC){this._syncText(this.text);this.blur();return false;}return true;}});function profilePictureEditorCreateFlyout(){var a=$('edit_profilepicture');var b=$('edit_profilepicture_icon');return flyout_menu(a).registerHTMLMenu($('profile_picture_flyout')).setPosition(dropmenu.ALIGN_LEFT).setIconPosition(b).addHook('show',function(c){CSS.addClass(c,'edit_profilepicture_icon_disabled');}.bind(null,a)).addHook('hide',function(c){CSS.removeClass(c,'edit_profilepicture_icon_disabled');}.bind(null,a));}function basicProfileEditorSetup(c,b){var a=DOM.find($(c),'a.box_editor');flyout_menu(a).registerHTMLMenu(b).setMenuClickArea(DOM.find($(b),'div.menu_custom')).setPosition(dropmenu.ALIGN_LEFT).addHook('show',CSS.addClass.bind(null,a,'selected')).addHook('hide',CSS.removeClass.bind(null,a,'selected'));CSS.removeClass(a,'hidden_elem');}

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