/*
HTTP Host: static.ak.fbcdn.net
Generated: March 22nd 2010 5:09:18 AM PDT
Machine: 10.16.140.109
Locale: nu_ll
Path: js/9vqh08eb0k080sco.pkg.js
*/

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

function custom_source(_L0){this.parent.construct(this);if(_L0.length&&typeof(_L0[0])=="string")for(var ii=0;ii<_L0.length;ii++)_L0[ii]={t:_L0[ii],i:_L0[ii]};this.values=_L0;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(_L0,_L1){var _L2=['<div>',typeahead_source.highlight_found(_L0.t,_L1),'</div>'];if(_L0.s)_L2.push('<div><small>',htmlspecialchars(_L0.s),'</small></div>');return _L2.join('');};
function toggle_app_data(_L0,_L1){var _L2=ge(_L0);if(!_L2)return;var _L3=ge(_L1);if(!_L3)return;var _L4=$('dev_app_list').childNodes[0];if(!_L4)return;var _L5=ge('dev_app_infos');if(!_L5)return;var _L6=_L4.childNodes;for(var i=0;i<_L6.length;i++)if(CSS.hasClass(_L6[i],'flag_nav_item_selected')){CSS.removeClass(_L6[i],'flag_nav_item_selected');break;}var _L6=_L5.childNodes;for(var i=0;i<_L6.length;i++)if(CSS.hasClass(_L6[i],'app_show')){CSS.removeClass(_L6[i],'app_show');CSS.addClass(_L6[i],'app_hide');break;}CSS.addClass(_L2,'flag_nav_item_selected');CSS.removeClass(_L3,'app_hide');CSS.addClass(_L3,'app_show');}function app_source(_L0){var _L1=JSON.decode(_L0);if(_L1.searchable_apps){if(_L1.added_apps)this.added_apps=_L1.added_apps;_L1=_L1.searchable_apps;}this.parent.construct(this,_L1);}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(_L0,_L1){var _L2=_L0.it;var _L3=[];return ['<div class="app_option"><div class="icon" style="background-image: url(',_L2,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(_L0.t,_L1),'</span></div>'].join('');};app_source.prototype.gen_nomatch=function(){if(!this.added_apps)return this.parent.gen_nomatch();var _L0=typeahead_source.tokenize(this.owner.get_value());var _L1=[];for(var ii=0;ii<this.added_apps.length;ii++)if(typeahead_source.check_match(_L0,this.added_apps[ii]))_L1.push(this.added_apps[ii]);if(_L1.length==0){return _tx("No application found. Please note not all applications support tabs.");}else if(_L1.length==1){return _tx("No application found. Please note {app-name} has already been added, and not all applications support tabs.",{"app-name":_L1[0]});}else if(_L1.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":_L1[0],"app-name-2":_L1[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":_L1[0],"app-name-2":_L1[1]});};
function friend_source(_L0){if(typeof(_L0)=='object')_L0=_L0[0];this.bootstrap=this.bootstrap.bind(this,_L0);this.parent.construct(this);}friend_source.extend('static_source');friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=_tx("Start typing a name");friend_source.friends={};friend_source.friends_index={};friend_source.viewer_id=0;friend_source.prototype.cache_results=true;friend_source.prototype.bootstrap=function(_L0){if(friend_source.friends[_L0]){this.values=friend_source.friends[_L0];this.index=friend_source.friends_index[_L0];this.ready();}else new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_friends.php?'+_L0).setHandler(function(_L1){friend_source.friends[_L0]=this.values=this.filter_excluded(_L1.getPayload().friends);this.viewer_id=_L1.getPayload().viewer_id;this.build_index();friend_source.friends_index[_L0]=this.index;}.bind(this)).send();};friend_source.dirty=function(){friend_source.friends={};friend_source.friends_index={};typeaheadpro.dirty_instances();};friend_source.prototype.gen_html=function(_L0,_L1){var _L2=_L0.n||'&nbsp;';if(_L0.n===false){_L2=_tx("0 friends");}else if(typeof(_L0.n)=="object"){var _L3=[];for(var k in _L0.n)_L3.push(_L0.n[k]);if(_L3.length>3){_L2=_tx("{name1}, {name2}, {count} others",{name1:_L3[0],name2:_L3[1],count:_L3.length-2});}else if(_L3.length){_L2=_L3.join(', ');}else _L2=_tx("0 friends");}return ['<div>',typeahead_source.highlight_found(_L0.t,_L1),'</div><div><small>',_L2,'</small></div>'].join('');};friend_source.prototype.search_value=function(_L0){if(_L0=='\x5e\x5f\x5e')return [{t:_L0,n:'\x6b\x65\x6b\x65',i:10,it:'http://static.ak.facebook.com/pics/t_default.jpg'}];return this.parent.search_value(_L0);};friend_source.prototype._sort_text_obj=function(a,b){if(a.e&&!b.e)return 1;if(!a.e&&b.e)return -1;if(this.viewer_id==a.i)return -1;if(this.viewer_id==b.i)return 1;return a.t.localeCompare(b.t);};
function removeSection(_L0,i){hide(_L0+'_'+i);$(_L0+'_'+i+'_remove').value='true';$('num_'+_L0+'_entries').value--;$(_L0+'add_link').style.display='block';var _L2=ge(_L0+'last_divider');if(_L2)_L2.style.display='';}function addSection(_L0,_L1){var num=parseInt($('num_'+_L0+'_entries').value);show(_L0+'_'+(num+1));$('num_'+_L0+'_entries').value=num+1;if(num+1>=_L1){$(_L0+'add_link').style.display='none';var _L3=ge(_L0+'last_divider');if(_L3)_L3.style.display='none';}}function schoolChangeStatus(el,_L1){el=ge(el);var _L2=el.options[el.selectedIndex].value;concentrate_name=_L1+'_concentration';concentrate_adder=_L1+'_concentration_adder';concentrate_degree=_L1+'_degree';concentrate_value_count=_L1+'_concentration_value_count';switch(_L2){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(_L2=='2')showTableRow(getParentRow(concentrate_degree));break;default:hide(getParentRow(concentrate_degree));break;}}function addConcentration(_L0){concentrate_adder=_L0+'_adder';concentrate_value_count=_L0+'_value_count';if($(concentrate_value_count).value==2){$(concentrate_value_count).value=3;showTableRow(getParentRow(_L0+'3_name'));hide(getParentRow(concentrate_adder));}else{$(concentrate_value_count).value=2;showTableRow(getParentRow(_L0+'2_name'));}}function education_autocomplete_onselect(obj){var _L1=function(){var _L4=new concentration_source(this.network);_L4.text_placeholder=_tx("Type your major or minor");_L4.text_nomatch=_L4.text_noinput=false;var ta=new typeaheadpro(this,_L4);};$(this.custom_prefix+'_school_nk').value=obj?obj.i:-1;for(var i=1;i<=3;i++){var _L3=ge(this.custom_prefix+'_concentration'+i+'_name');if(_L3){typeaheadpro.kill_typeahead(_L3);if(obj){_L3.network=obj.i;_L3.onfocus=_L1.bind(_L3);}else{CSS.setClass(_L3,_L3.className.replace(/typeahead_[^\s]+/g,''));_L3.onfocus=null;}}}return false;}function education_autocomplete_onfound(_L0){if(!_L0)$(this.custom_prefix+'_school_nk').value=-1;}function workplace_autocomplete_onselect(obj){$(this.custom_prefix+'_company_nk').value=obj?obj.i:-1;return false;}function workplace_autocomplete_onfound(_L0){if(!_L0)$(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(_L0,i){var _L2=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(_L0,i);_L2.hide();}).show();return false;}function workhistory_remove_entry(i){var _L1=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',i);_L1.hide();}).show();return false;}function FamilyInfoController(_L0,_L1,_L2,_L3){this.root=$(_L0);this.new_family_field_markup=_L1;this.typeahead_param=_L2;this.cur_index=_L3;this.addNewLink=$('add_more_family');this.only_node=null;var _L4=DOM.scry(this.root,'div.family_member');if(_L4.length==1)this.only_node=_L4[0];for(var i=0;i<_L4.length;i++)this.setUpHandlers(_L4[i]);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(_L0){var _L1=DOM.find(_L0,'select.family_member_selector');var _L2=DOM.scry(_L0,'input[type="hidden"]')[0];var _L3=DOM.find(_L0,'input[type="text"].name_typeahead');var _L4=DOM.scry(_L0,'a.remove_link')[0];var _L5=_L2.value;var _L6=get_form_select_value(_L1);var _L7=_L3.value;var _L8=this.typeahead_param;var _L9=DOM.find(_L0,'input[type="text"].email_input');Event.listen(_L3,'focus',function(){var _La=new friend_source(_L8);_La.text_nomatch='';_La.text_noinput='';_La.text_placeholder=_tx("Enter Name");new typeaheadpro(this,_La,{max_results:5,onselect:FamilyInfoController.familyIdSelect,auto_select:false,_node:_L0,_select:_L1,_original_id:_L5,_original_relation:_L6,_hidden_input:_L2,_email_elem:_L9});});Event.listen(_L1,'change',function(){this.checkShowTextData(_L0,_L1,_L2,_L3);var _La=get_form_select_value(_L1);if(_L2.value&&_La!=0&&_La!=_L6){FamilyInfoController.constructNotifMessage(_L0,_L2,_L3.value,_L3,_L9);}else FamilyInfoController.removeNotifMessage(_L0);}.bind(this));Event.listen(_L3,'blur',function(){setTimeout(function(){if(!CSS.hasClass(_L3,'typeahead_found')&&_L7!=_L3.value){_L2.value='';FamilyInfoController.removeNotifMessage(_L0);}this.checkShowTextData(_L0,_L1,_L2,_L3);}.bind(this),5);}.bind(this));if(_L4)Event.listen(_L4,'click',function(){_L2.value='';_L3.value='';_L1.selectedIndex=0;if(!CSS.hasClass(_L0,'family_member_first')){CSS.addClass(_L0,'hidden_elem');}else CSS.addClass(_L4,'hidden_elem');return false;}.bind(this));};FamilyInfoController.prototype.checkShowTextData=function(_L0,_L1,_L2,_L3){var _L4=((_L2.value=='')&&_L3.value);var _L5=FamilyInfoController.CHILD_CONSTANTS[get_form_select_value(_L1)];var _L6=(_L4&&!_L5);if(_L6){var _L7=DOM.find(_L0,'div.email_explanation');DOM.setContent(_L7,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(_L3.value)})));}CSS.conditionClass(_L0,'with_child_metadata',(_L4&&_L5));CSS.conditionClass(_L0,'with_email',_L6);};FamilyInfoController.prototype.addFamilyField=function(){var _L0=HTML(this.new_family_field_markup).getRootNode();this.root.appendContent(_L0);this.setUpHandlers(_L0);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(_L0){if(_L0){if(_L0.i!=this._hidden_input.value){this._hidden_input.value=_L0.i;var _L1=get_form_select_value(this._select);if(_L1!=0&&((_L0.i!=this._original_id)||(_L1!=this._original_relation))){FamilyInfoController.constructNotifMessage(this._node,this._hidden_input,_L0.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(_L0){var _L1=DOM.scry(_L0,'div.notif_message');if(_L1[0])DOM.remove(_L1[0]);};FamilyInfoController.constructNotifMessage=function(_L0,_L1,_L2,_L3,_L4){FamilyInfoController.removeNotifMessage(_L0);var _L5=$N('div',{className:'notif_message'});_L5.setContent(_tx("We will notify {name}, who must confirm that you are family before we can create a link from your profile. ",{'name':_L2}));var _L6=HTML('<span> (<a>'+_tx("Cancel")+'</a>)</span>').getRootNode();_L5.appendContent(_L6);Event.listen(_L5.find('a'),'click',function(){DOM.remove(_L5);_L1.value='';_L3.value='';_L4.value='';}.bind(this));DOM.appendContent(_L0,_L5);};
function token(obj,_L1,_L2){if(obj.is&&(_L1.count_names(obj.is)>_L1.max_selections)){new ContextualDialog().setContext(_L1.obj).setTitle(_tx("Cannot add list.")).setBody(_tx("You may only message up to 20 people at once.")).show().setAutohide(1500);return null;}this.tokenizer=_L1;this.element=document.createElement('a');CSS.setClass(this.element,'token'+('class' in obj?' '+obj['class']:''));this.element.href='#';this.element.tabIndex=-1;this.element.onclick=function(_L3){return this._onclick(_L3?_L3:window.event);}.bind(this);this.element.onmousedown=function(_L3){(_L3?_L3:window.event).cancelBubble=true;return false;};this.render_obj(obj);this.obj=obj;this.element.token=this;this.tokenizer.hide_inline_placeholder();_L2?this.tokenizer.obj.insertBefore(this.element,_L2):this.tokenizer.obj.appendChild(this.element);}token.prototype.render_obj=function(obj){var _L1='';if(obj.np){var _L2='';}else var _L2='fb_protected="true" ';var _L3='class="fb_token_hidden_input" ';if(obj.e){_L1=['<input type="hidden" ',_L3,_L2,'name="emails[]" value="',obj.e,'" />'].join('');}else if(obj.i||obj.i===0){_L1=['<input type="hidden" ',_L3,_L2,'name="',this.tokenizer.obj.name,'[]" value="',obj.i,'" />'].join('');}else if(obj.is){for(var i=0,il=obj.is.length;i<il;i++)_L1+=['<input type="hidden" ',_L3,_L2,'name="',this.tokenizer.obj.name,'[]" value="',obj.is[i],'" />'].join('');this.explodable=true;this.n=obj.n;}this.text=obj.t;this.element.innerHTML=['<span><span><span><span>',_L1,htmlspecialchars(obj.t),'<span onclick="this.parentNode.parentNode.parentNode.parentNode.parentNode.token.remove(true); event.cancelBubble=true; return false;" ','onmouseover="CSS.setClass(this, \'x_hover\');" onmouseout="CSS.setClass(this, \'x\');" class="x">&nbsp;</span>','</span></span></span></span>'].join('');this.obj=obj;};token.prototype._onclick=function(_L0){var _L1=(new Date()).getTime();if(this.explodable&&this.tokenizer.last_select_time&&(_L1-this.tokenizer.last_select_time<1400)){var _L2=this.n;this.remove();var _L3=this.tokenizer.obj.getElementsByTagName('input');var _L4={};for(var i=0;i<_L3.length;++i)if(_L3[i].name==this.tokenizer.obj.id+'[]')_L4[_L3[i].value]=true;for(var id in _L2)if(!_L4[id])new token({'t':_L2[id],'i':id},this.tokenizer);}else this.select();this.tokenizer.last_select_time=_L1;_L0.cancelBubble=true;return false;};token.prototype.select=function(_L0){if(this.tokenizer.selected_token&&!_L0)this.tokenizer.selected_token.deselect();CSS.setClass(this.element,trim(this.element.className.replace('token_selected',''))+' token_selected');this.tokenizer.tab_stop_ignore_focus=true;if(this.tokenizer.tab_stop.disabled)this.tokenizer.tab_stop.disabled=false;this.tokenizer.tab_stop.focus();this.tokenizer.selected_token=this;if(_L0!==true){setTimeout(function(){this.select(true);}.bind(this),0);}else setTimeout(function(){this.tab_stop_ignore_focus=false;}.bind(this.tokenizer),0);};token.prototype.remove=function(_L0){this.element.parentNode.removeChild(this.element);this.element.token=null;this.tokenizer.selected_token=null;if(_L0)this.tokenizer._onmousedown();if(this.obj)this.tokenizer._ontokenremoved(this.obj);};token.prototype.deselect=function(){CSS.setClass(this.element,trim(this.element.className.replace('token_selected','')));this.tokenizer.selected_token=null;};
function tokenizer_input(_L0,_L1){if(!tokenizer_input.hacks){tokenizer_input.should_use_borderless_hack=ua.safari();tokenizer_input.should_use_shadow_hack=ua.ie()<8||ua.opera();tokenizer_input.hacks=true;}this.tokenizer=_L0;_L0.tokenizer_input=this;this.obj=document.createElement('input');this.obj.input=this;this.obj.tabIndex=-1;this.obj.size=1;this.obj.onmousedown=function(_L3){(_L3?_L3:window.event).cancelBubble=true;}.bind(this);this.shadow=document.createElement('span');CSS.setClass(this.shadow,'tokenizer_input_shadow');this.element=document.createElement('div');CSS.setClass(this.element,'tokenizer_input'+(tokenizer_input.should_use_borderless_hack?' tokenizer_input_borderless':''));this.element.appendChild(document.createElement('div'));this.element.firstChild.appendChild(this.obj);var _L2=(tokenizer_input.should_use_shadow_hack?DOM.getRootElement():this.element.firstChild);_L2.appendChild(this.shadow);_L1?_L0.obj.insertBefore(this.element,_L1):_L0.obj.appendChild(this.element);this.tokenizer.tab_stop.disabled=true;this.update_shadow();this.update_shadow=this.update_shadow.bind(this);this.tokenizer.inputs.push(this);this.parent.construct(this,this.obj,this.tokenizer.typeahead_source);if(this.focused){this.focus();this.obj.select();}copy_properties(this,_L0.properties||{});setInterval(this.update_shadow.bind(this),100);}tokenizer_input.extend('typeaheadpro');tokenizer_input.prototype.gen_nomatch=tokenizer_input.prototype.gen_loading=tokenizer_input.prototype.gen_placeholder=tokenizer_input.prototype.gen_noinput='';tokenizer_input.prototype.max_display=8;tokenizer_input.prototype.setup_anchor=function(){return this.tokenizer.obj;};tokenizer_input.prototype.update_shadow=function(){if(this.obj===null)return;try{var val=this.obj.value;}catch(e){return;}if(this.shadow_input!=val){this.shadow.innerHTML=htmlspecialchars((this.shadow_input=val)+'^_^');if(tokenizer_input.should_use_shadow_hack){this.obj.style.width=this.shadow.offsetWidth+'px';this.obj.value=val;}}};tokenizer_input.prototype._onblur=function(e){if(this.parent._onblur(e)===false)return false;this.tokenizer._onblur(e);if(this.changed&&!this.interactive){this.dirty_results();this.changed=false;return;}if(this.changed||this.interactive)this.select_suggestion(this.selectedindex);setTimeout(function(){this.disabled=false;}.bind(this.tokenizer.tab_stop),1000);tokenizerToDestroy=this;setTimeout(function(){tokenizerToDestroy.destroy();},0);};tokenizer_input.prototype._onfocus=function(){this.tokenizer.tab_stop.disabled=true;this.parent._onfocus();return true;};tokenizer_input.prototype._onkeydown=function(_L0){switch(_L0.keyCode){case 13:break;case 37:case 8:if(this.get_selection_start()!=0||this.obj.value!='')break;var _L1=this.element.previousSibling;if(_L1&&_L1.token)setTimeout(_L1.token.select.bind(_L1.token),0);break;case 39:case 46:if(this.get_selection_start()!=this.obj.value.length)break;var _L2=this.element.nextSibling;if(_L2&&_L2.token)setTimeout(_L2.token.select.bind(_L2.token),0);break;case 188:this._onkeydown({keyCode:13});return false;case 9:if(this.obj.value){this.advance_focus();this._onkeydown({keyCode:13});return false;}else if(!_L0.shiftKey){this.advance_focus();this.parent._onkeydown(_L0);return false;}break;}return this.parent._onkeydown(_L0);};tokenizer_input.prototype._onkeypress=function(_L0){switch(_L0.keyCode){case 9:return false;}setTimeout(this.update_shadow,0);return this.parent._onkeypress(_L0);};tokenizer_input.prototype.select_suggestion=function(_L0){if(this.suggestions&&_L0>=0&&this.suggestions.length>_L0){var _L1=this.tokenizer.obj.getElementsByTagName('input');var id=this.suggestions[_L0].i;for(i=0;i<_L1.length;i++)if(_L1[i].name==this.tokenizer.obj.id+'[]'&&_L1[i].value==id)return false;}return this.parent.select_suggestion(_L0);};tokenizer_input.prototype.get_selection_start=function(){if(this.obj.selectionStart!=undefined){return this.obj.selectionStart;}else return Math.abs(document.selection.createRange().moveStart('character',-1024));};tokenizer_input.prototype.onselect=function(obj){if(this.get_value()==''&&this.last_key==13){return this.tokenizer.onsubmit();}else if(obj){var _L1=this.tokenizer.obj.getElementsByTagName('input');for(i=0;i<_L1.length;i++)if(_L1[i].name==this.tokenizer.obj.id+'[]'&&_L1[i].value==obj.i)return false;new token(obj,this.tokenizer,this.element);this.clear();if(this.tokenizer.max_selections<=this.tokenizer.count_names())this.destroy.bind(this).defer();this.tokenizer._ontokenadded(obj);}this.tokenizer.typeahead_source.onselect_not_found.call(this);return false;};tokenizer_input.prototype._onsubmit=function(){return false;};tokenizer_input.prototype.capture_submit=function(){return false;};tokenizer_input.prototype.clear=function(){this.parent.clear();this.update_shadow();};tokenizer_input.prototype.destroy=function(){this.parent.destroy();if(this.shadow&&tokenizer_input.should_use_shadow_hack)DOM.remove(this.shadow);if(this.element)DOM.remove(this.element);if(this.tokenizer){var _L0=this.tokenizer.inputs.indexOf(this);if(_L0!=-1)this.tokenizer.inputs.splice(_L0,1);}this.tokenizer=this.element=this.shadow=null;return null;};
function tokenizer(obj,_L1,_L2,_L3,_L4){if(ua.safari()<500){tokenizer.valid_arrow_count=0;tokenizer.valid_arrow_event=function(){return tokenizer.valid_arrow_count++%2==0;};}else tokenizer.valid_arrow_event=function(){return true;};this.obj=obj;this.obj.tokenizer=this;this.obj.name=obj.id;this.typeahead_source=_L1;while(!/\btokenizer\b/.test(this.obj.className))this.obj=this.obj.parentNode;this.tab_stop=this.obj.getElementsByTagName('input')[0];this.inputs=[];this.tokenizer_inputs=[];this.obj.onmousedown=function(_L5){return this._onmousedown(_L5?_L5:window.event);}.bind(this);this.tab_stop.onfocus=function(_L5){return this._onfocus(_L5?_L5:window.event);}.bind(this);this.tab_stop.onblur=function(_L5){return this.tab_stop_onblur(_L5?_L5:window.event);}.bind(this);this.tab_stop.onkeydown=function(_L5){return this.tab_stop_onkeydown(_L5?_L5:window.event);}.bind(this);if(!_L2&&elementY(this.obj)>0&&this.obj.offsetWidth)this._onfocus();this.max_selections=_L3;copy_properties(this,_L4||{});this.properties=_L4;if(this.inline_placeholder_text)this.init_inline_placeholder();}tokenizer.prototype.onsubmit=bagofholding;tokenizer.prototype.setName=function(_L0){this.obj.name=_L0;};tokenizer.is_empty=function(obj){if(CSS.hasClass(obj,'tokenizer_locked')){return obj.getElementsByTagName('input').length==0;}else return (!obj.tokenizer||obj.tokenizer.count_names()==0);};tokenizer.prototype.get_token_values=function(){var r=[];var _L1=this.obj.getElementsByTagName('input');for(var i=0;i<_L1.length;++i)if(_L1[i].name&&_L1[i].value)r.push(_L1[i].value);return r;};tokenizer.prototype.get_token_strings=function(){var r=[];var _L1=this.obj.getElementsByTagName('a');for(var i=0;i<_L1.length;++i)if(typeof _L1[i].token!='undefined')r.push(_L1[i].token.text);return r;};tokenizer.prototype.clear=function(){var _L0=this.obj.getElementsByTagName('a');for(var i=_L0.length-1;i>=0;--i)if(typeof _L0[i].token!='undefined')_L0[i].token.remove();};tokenizer.prototype.remove_token=function(_L0){var _L1=this.obj.getElementsByTagName('a');for(var i=_L1.length-1;i>=0;--i)if(typeof _L1[i].token!='undefined'&&(_L1[i].token.obj.i==_L0||_L1[i].token.obj.flid==_L0)){_L1[i].token.remove();break;}};tokenizer.prototype.clear_current_input=function(){this.tokenizer_input.clear();};tokenizer.prototype._onmousedown=function(_L0){if(this.onfocus)this.onfocus();this.hide_inline_placeholder();setTimeout(function(){if(!this.inputs.length){if(this.max_selections>this.count_names()){this.tokenizer_inputs.push(new tokenizer_input(this));}else{var _L1=this.obj.getElementsByTagName('a');for(var i=_L1.length-1;i>=0;i--)if(typeof _L1[i].token!='undefined'){_L1[i].token.select();break;}}}else this.inputs[0].focus();}.bind(this),0);_L0?_L0.cancelBubble=true:false;return false;};tokenizer.prototype._onfocus=function(_L0){if(this.tab_stop_ignore_focus){this.tab_stop_ignore_focus=false;return;}this._onmousedown();};tokenizer.prototype._onblur=function(_L0){if(this.onblur)this.onblur();this.show_inline_placeholder();};tokenizer.prototype.tab_stop_onblur=function(_L0){this.selected_token?this.selected_token.deselect():false;};tokenizer.prototype.tab_stop_onkeydown=function(_L0){if(!_L0.keyCode||!this.selected_token)return;switch(_L0.keyCode){case 8:case 46:var tok=this.selected_token;var _L2=tok.element.previousSibling;if(_L2&&_L2.input){_L2.input.element.focus();}else this.tokenizer_inputs.push(new tokenizer_input(this,tok.element));tok.remove();return false;case 37:if(!tokenizer.valid_arrow_event())break;var tok=this.selected_token;var _L2=tok.element.previousSibling;if(_L2&&_L2.input){_L2.input.element.focus();}else if(this.max_selections>this.count_names()){this.tokenizer_inputs.push(new tokenizer_input(this,tok.element));}else return false;tok.deselect();return false;case 39:if(!tokenizer.valid_arrow_event())break;var tok=this.selected_token;var _L3=tok.element.nextSibling;if(_L3&&_L3.input){_L3.input.focus();}else if(this.max_selections>this.count_names()){var _L4=new tokenizer_input(this,tok.element.nextSibling);this.tokenizer_inputs.push(_L4);}else return false;tok.deselect();return false;}};tokenizer.prototype.count_names=function(_L0){var _L1=this.obj.getElementsByTagName('input');var _L2={};var _L3=0;for(var i=0;i<_L1.length;i++)if(_L1[i].type=='hidden'&&!_L2[_L1[i].value]){_L2[_L1[i].value]=true;++_L3;}if(_L0)for(var j=0;j<_L0.length;j++)if(!_L2[_L0[j]]){_L2[_L0[j]]=true;++_L3;}return _L3;};tokenizer.prototype.disable=function(){this.tab_stop.parentNode.removeChild(this.tab_stop);this.obj.className+=' tokenizer_locked';};tokenizer.prototype._ontokenadded=function(obj){if(this.ontokenadded)this.ontokenadded.call(this,obj);};tokenizer.prototype._ontokenremoved=function(obj){if(this.ontokenremoved)this.ontokenremoved.call(this,obj);};tokenizer.prototype._ontokennotfound=function(_L0){if(this.ontokennotfound)this.ontokennotfound.call(this,_L0);};tokenizer.prototype.init_inline_placeholder=function(){if(this.inline_placeholder)return;var _L0=$N('span',{className:'inline_placeholder'},this.inline_placeholder_text);if(!tokenizer.is_empty(this.obj))_L0.setStyle('display','none');this.obj.appendChild(_L0);this.inline_placeholder=_L0;};tokenizer.prototype.show_inline_placeholder=function(){if(this.inline_placeholder&&tokenizer.is_empty(this.obj))show(this.inline_placeholder);};tokenizer.prototype.hide_inline_placeholder=function(){if(this.inline_placeholder&&shown(this.inline_placeholder))hide(this.inline_placeholder);};tokenizer.prototype.get_source=function(){return this.typeahead_source;};tokenizer.prototype.set_source=function(_L0){this.typeahead_source=_L0;if(this.tokenizer_inputs.length)for(var ii=0;ii<this.tokenizer_inputs.length;ii++)this.tokenizer_inputs[ii].set_source(_L0);if(this.tokenizer_input)this.tokenizer_input.set_source(_L0);};
function ProfileBoxController(_L0,_L1,_L2,_L3){this.profileId=_L0;this.applications={};this.columns=_L3;this.tabId=_L2;var _L4=null;var obj;this.placeholderBox=document.createElement('div');CSS.setClass(this.placeholderBox,'box_placeholder');for(var i=0;i<_L1.length;i++)if(obj=ge('box_app_'+_L1[i])){_L4=obj.parentNode;var _L7={box:obj,id:_L1[i]};this.applications[_L7.id]=_L7;obj.addClass('moveable');(new Draggable(obj)).addHandle(obj.getElementsByTagName('h5')[0]).setNamespace('ProfileBoxController').setGutter(15).setUseAbsolute(true).setGrabHandler(function(_L8,obj){_L8.expandColumns();_L8.placeholderBox.style.height=obj.offsetHeight-6+'px';_L8.placeholderBox.style.width=obj.offsetWidth+'px';CSS.addClass(obj,'drag');obj.style.width=obj.offsetWidth+'px';obj.parentNode.insertBefore(_L8.placeholderBox,obj);obj.style.zIndex=100;}.bind(null,this,obj)).setDropHandler(function(_L8,obj){this.resetPosition();_L8.placeholderBox.parentNode.insertBefore(this.getDOM(),_L8.placeholderBox);_L8.placeholderBox.parentNode.removeChild(_L8.placeholderBox);_L8.resetColumns();_L8.saveChanges(obj);obj.style.width=null;obj.style.zIndex=null;}.bind(null,this,obj)).setKey('app_id',_L7.id);(new Droppable(obj)).setNamespace('ProfileBoxController').setZIndex(1).setDragMoveHandler(function(_L8,_L9,_La,_Lb){if(_La.getDOM().offsetHeight>=_Lb.y){var _Lc=ProfileBoxController.insertElement(_L8.placeholderBox,this.getDOM());_L8.placeholderBox.style.width=this.getDOM().offsetWidth+'px';}}.bind(null,this,_L7.id));}if(this.columns.length>1)for(var i=0;i<this.columns.length;i++)(new Droppable(this.columns[i].dom)).setNamespace('ProfileBoxController').setZIndex(0).setDragOverHandler(function(_L8,_L9,_La){if(_L8.placeholderBox.parentNode!=_L9){_L8.placeholderBox.style.width=_L9.offsetWidth+'px';_L9.appendChild(_L8.placeholderBox,this.getDOM());}}.bind(null,this,this.columns[i].dom));}ProfileBoxController.insertElement=function(_L0,_L1){var _L2=true,_L3=_L1.parentNode.childNodes;for(var i=0;i<_L3.length;i++)if(_L3[i]==_L1){break;}else if(_L3[i]==_L0){_L2=false;break;}if(_L2){_L1.parentNode.insertBefore(_L0,_L1);}else _L1.parentNode.insertBefore(_L1,_L0);return _L2;};ProfileBoxController.prototype.getAppFromId=function(id){return (/box_app_([0-9]+)/.exec(id)||[]).pop();};ProfileBoxController.prototype.getOrderFromDOM=function(){var _L0=[];this.columns.each(function(_L1){var _L2={column:_L1.column,order:[]};var _L3;var _L4=DOM.scry(_L1.dom,'div.box');for(var i=0;i<_L4.length;i++)if(_L4[i].id&&(_L3=this.getAppFromId(_L4[i].id)))_L2.order.push(parseInt(_L3,10));_L0.push(_L2);}.bind(this));return _L0;};ProfileBoxController.prototype.saveChanges=function(obj){var _L1=this.getAppFromId(obj.id);var _L2=DOM.find(obj,'div.app_custom_content');_L2.style.visibility='hidden';CSS.addClass(obj,'loading');new AsyncRequest().setURI('/ajax/profile/box.php').setData({action:'reorder',tab_id:this.tabId,order:this.getOrderFromDOM(),profile_id:this.profileId,app_id:_L1}).setHandler(function(_L3){DOM.replace(_L2,HTML(_L3.getPayload().box));CSS.removeClass(obj,'drag');CSS.removeClass(obj,'loading');}).send();};ProfileBoxController.prototype.expandColumns=function(){if(this.columns<2)return;var max=null;this.resetColumns();this.columns.each(function(_L1){max=Math.max(_L1.dom.offsetHeight,max);});this.columns.each(function(_L1){if(_L1.dom.offsetHeight!=max)_L1.dom.style.height=max+'px';});};ProfileBoxController.prototype.resetColumns=function(){this.columns.each(function(_L0){_L0.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(_L0,_L1,_L2){this.section_objs={};this.remember_edited=_L2;for(var i in _L1){var _L4=_L1[i];if(_L4.app_id){if(!NO_INLINE_EDITOR[_L4.app_id]){this.section_objs[_L4.section]=new ProfileInfoAppEditSection(_L4,this);ProfileInfoEdit.editors[_L4.section]=this.section_objs[_L4.section];}}else this.section_objs[_L4.section]=new ProfileInfoEditSection(_L4,this);}this.profile_id=_L0;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(_L0){this.edit_all_mode=true;for(var i in this.section_objs){var _L2=this.section_objs[i];if(_L2.canEdit()){_L2.has_editor=false;_L2.closeEditor();}}CSS.addClass(this.info_tab,'edit_all_mode');var _L3=true;for(var i in this.section_objs){var _L2=this.section_objs[i];if(!_L2.canEdit())continue;_L2.getHeaderElem().onclick=this.editAllSetActiveSection.bind(this,_L2);if(_L3){_L2.populateEditor();_L2.openEditor(false);CSS.addClass(_L2.getSectionElem(),'edit_mode');if(_L0)ProfileInfoEdit.scrollToSection($('info_edits_div'));}_L3=false;}return false;};ProfileInfoEdit.prototype.editAllSetActiveSectionNext=function(_L0){var _L1=false;for(var i in this.section_objs){var _L3=this.section_objs[i];if(!_L3.canEdit())continue;if(_L1){if(!_L3.is_open&&!_L3.has_editor){CSS.addClass(_L3.getSectionElem(),'edit_mode');_L3.populateEditor();}_L3.toggleEditor(true);_L1=false;}else if(_L3.section!=_L0.section)_L3.closeEditor();if(_L3.section==_L0.section)_L1=true;}};ProfileInfoEdit.prototype.editAllSetActiveSection=function(_L0){for(var i in this.section_objs){var _L2=this.section_objs[i];if(!_L2.canEdit())continue;if(_L2.section==_L0.section){if(!_L2.is_open&&!_L2.has_editor){CSS.addClass(_L2.getSectionElem(),'edit_mode');_L2.populateEditor();}_L2.toggleEditor(true);}else _L2.closeEditor();}};ProfileInfoEdit.prototype.onDoneEditingAll=function(){for(var i in this.section_objs){var _L1=this.section_objs[i];if(_L1.canEdit()){var _L2=_L1.getSectionElem();_L1.cancelEditor();_L1.closeEditor();_L1.has_editor=false;CSS.removeClass(_L1.getSectionElem(),'edit_mode');_L1.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(_L0){animation(DOMScroll.getScrollRoot()).to('scrollTop',elementY(_L0)-40).ease(animation.ease.end).duration(400).go();};function ProfileInfoEditSectionBase(_L0,_L1){this.type=0;this.is_open=false;this.has_editor=false;this.app_id=0;this.controller=_L1;copy_properties(this,_L0);var _L2=_L0.section;copy_properties(this,{section_id:('info_section_'+_L2),header_id:('info_section_header_'+_L2),info_id:('info_section_info_'+_L2),editor_id:('info_section_editor_'+_L2),edit_id:('info_section_edit_'+_L2),edit_jaws_id:('info_section_edit_jaws_'+_L2),save_id:('info_section_save_'+_L2),cancel_id:('info_section_cancel_'+_L2)});var _L3=DOM.scry(this.getHeaderElem(),'a.close_edit');this.header_cancel_link=(_L3.length?_L3[0]:null);var _L4=this.getSectionElem();_L4.onmouseover=function(){CSS.addClass(this,'hover');};_L4.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 _L0=this.getSaveElem();return _L0?_L0.form:null;},getCancelElem:function(){return $(this.cancel_id);},getAppId:function(){return this.app_id;},canEdit:function(){return true;}});ProfileInfoEditSectionBase.prototype.onClickEdit=function(){var _L0=this.getSectionElem();var _L1=this.getSectionElem();this.populateEditor();CSS.addClass(_L0,'edit_mode');CSS.removeClass(_L0,'empty');ProfileInfoEdit.scrollToSection(_L0);return false;};ProfileInfoEditSectionBase.prototype.populateEditor=function(){var _L0=this.getSectionElem();var _L1=this.getEditorElem();var _L2='<div class="fbloading"><span>'+_tx("Loading...")+'</span></div>';set_inner_html(_L1,_L2);var _L3={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(_L3).setHandler(this.replaceEditor.bind(this)).send();return false;};ProfileInfoEditSectionBase.prototype.replaceEditor=function(_L0){var _L1=this.getSectionElem();var _L2=this.getEditorElem();var _L3=_L0.getPayload();_L2.style.height='100px';DOM.setContent(_L2,HTML(_L3.editor));animation(_L2).to('height','auto').from('height','100px').duration(200).go();var _L4=this.getSaveElem();var _L5=this.getCancelElem();_L4.onclick=this.onSaveEditor.bind(this);_L5.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 _L0=this.getEditorElem();form=serialize_form(_L0);form['section']=this.section;if(this.app_id)form['app_id']=this.app_id;form['save']=1;var _L1='<div class="fbloading"><span>'+'Saving...'+'</span></div>';set_inner_html(_L0,_L1);new AsyncRequest().setURI(ProfileInfoEdit.uri).setData(form).setHandler(function(_L2){var _L3=_L2.getPayload();var _L4=this.getSectionElem();if(_L3.editor){this.replaceEditor(_L2);return false;}this.has_editor=false;if(_L3.display){CSS.removeClass(_L4,'empty');}else CSS.addClass(_L4,'empty');var _L5=this.getInfoElem();set_inner_html(_L5,_L3.display);if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(_L4,'edit_mode');ProfileInfoEdit.scrollToSection(_L4);}if(_L3.basic_info_summary)profile_basic_info_summary_refresh(_L3.basic_info_summary);}.bind(this)).send();return false;};ProfileInfoEditSectionBase.prototype.onCancelEditor=function(){var _L0=this.getSectionElem();CSS.removeClass(_L0,'edit_mode');if(!this.controller.edit_all_mode){this.cancelEditor();}else{this.closeEditor(true);this.has_editor=false;}ProfileInfoEdit.scrollToSection(_L0);return false;};ProfileInfoEditSectionBase.prototype.cancelEditor=function(){var _L0=this.getSectionElem();var _L1=this.getForm();if(_L1)_L1.is_inactive=true;this.has_editor=false;return false;};ProfileInfoEditSectionBase.prototype.toggleEditor=function(_L0){var _L1=this.getSectionElem();if(!this.is_open){this.openEditor(_L0);}else this.closeEditor();};ProfileInfoEditSectionBase.prototype.warnIfUnsaved=function(){if(!this.is_open)return false;var _L0=this.getForm();if(_L0&&_L0.original_state&&!are_equal(_L0.original_state,serialize_form(_L0))){var _L1=this.getSaveElem();var _L2=[];var _L3=function(){_L1.click();this.closeEditor(true);};_L2.push({name:'save',label:_tx("Save"),handler:_L3.bind(this)});_L2.push({name:'dont_save',label:_tx("Don't Save"),className:'inputaux',handler:this.closeEditor.bind(this,true)});_L2.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(_L2).setModal().show();return true;}return false;};ProfileInfoEditSectionBase.prototype.closeEditor=function(_L0){if(!_L0)if(this.warnIfUnsaved())return null;var _L1=this.getSectionElem();var _L2;if(this.has_editor&&(_L2=this.getForm()))_L2.is_inactive=true;CSS.addClass(_L1,'shut');CSS.removeClass(_L1,'open');this.is_open=false;};ProfileInfoEditSectionBase.prototype.openEditor=function(_L0){var _L1=this.getSectionElem();var _L2=this.getForm();if(_L2)_L2.is_inactive=false;CSS.addClass(_L1,'open');CSS.removeClass(_L1,'shut');this.is_open=true;if(_L0)ProfileInfoEdit.scrollToSection(_L1);};function ProfileInfoEditSection(_L0,_L1){this.parent.construct(this,_L0,_L1);var _L2=[this.edit_id,this.edit_jaws_id];for(i in _L2){var _L3=ge(_L2[i]);if(_L3)_L3.onclick=this.onClickEdit.bind(this);}}ProfileInfoEditSection.extend('ProfileInfoEditSectionBase');function ProfileInfoAppEditSection(_L0,_L1){this.parent.construct(this,_L0,_L1);this.app_id=_L0.app_id;if(ge('flyout_menu_info_section_'+this.app_id)){var _L2=this.getEditElem();var _L3=DOM.scry($('flyout_menu_info_section_'+this.app_id),'a');_L3[0].onclick=this.onClickEdit.bind(this);_L3[1].onclick=this.deleteBox.bind(this);flyout_menu(_L2).registerHTMLMenu('flyout_menu_info_section_'+this.app_id).setPosition(dropmenu.ALIGN_RIGHT).addHook('show',function(){CSS.addClass(_L2,'selected');}.bind(this)).addHook('hide',function(){CSS.removeClass(_L2,'selected');}.bind(this));}this.items={};this.order={};this.on=true;}ProfileInfoAppEditSection.extend('ProfileInfoEditSectionBase');ProfileInfoAppEditSection.prototype.deleteBox=function(){var _L0=this.getSectionElem();var uri='/ajax/profile/editinfo.php';var _L2={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_REMOVE_APP_SECTION,app_id:this.app_id};new AsyncRequest().setURI(uri).setData(_L2).setHandler(function(_L3){var _L4=elementY(_L0);animation(_L0).to('height',0).blind().duration(200).hide().go();animation(DOMScroll.getScrollRoot()).to('scrollTop',_L4-150).ease(animation.ease.end).duration(200).go();}).send();return false;};ProfileInfoAppEditSection.editors={};ProfileInfoAppEditSection.prototype.newAdd=function(row){var uri='/ajax/profile/editinfo.php';var _L2={profile_id:this.controller.profile_id,section:this.app_id,type:EDIT_APP_THUMBS,new_add:true,new_index:row.i,app_id:this.app_id};var _L3=function(_L4){var _L5=$('info_section_info_'+this.app_id);var _L6=document.createElement('div');set_inner_html(_L6,_L4.payload.item);_L5.childNodes[0].childNodes[1].appendChild(_L6);}.bind(this);new AsyncRequest().setURI(uri).setData(_L2).setHandler(_L3).send();};ProfileInfoAppEditSection.prototype.onSaveEditor=function(){var _L0=this;var _L1=_L0.getSectionElem();var _L2=_L0.getEditorElem();var _L3={};var dds=_L1.getElementsByTagName('li');for(var i=0;i<dds.length;i++)_L3[i]=dds[i].getAttribute('item');var uri='/ajax/profile/editinfo.php';var _L7={'profile_id':this.controller.profile_id,'section':this.app_id,'type':EDIT_APP_THUMBS,'save':true,'items':_L3,'app_id':this.app_id};if(this.controller.edit_all_mode){this.closeEditor(true);this.controller.editAllSetActiveSectionNext(this);}else{CSS.removeClass(_L1,'edit_mode');ProfileInfoEdit.scrollToSection(_L1);}new AsyncRequest().setURI(uri).setData(_L7).send();return false;};function ProfileBoxesEdit(id,_L1,_L2,_L3){_L3=_L3||{};for(var j=0;j<_L2.length;j++){var _L5=$(_L2[j]);var _L6=DOM.scry(_L5,'div.box');for(var i=0;i<_L6.length;++i){var _L8=_L6[i];var _L9=DOM.scry(_L8,'a.box_editor');if(_L9.length>0){var _La=_L9[0];var _Lb=_La.childNodes.length?_La.firstChild:'';var _Lc=_L8.id.replace('box_app_','');var _Ld=document.createElement('div');if(_Lb){_Ld.appendChild(_Lb);CSS.removeClass(_Lb,'hidden_elem');}if(!ProfileBoxesEdit.NON_MOVEABLE[_Lc]){if(_L3['name']&&_L3['moveable_to_section'][_Lc]){var _Le=document.createElement('a');_Le.href='#';_Le.innerHTML=_tx("Move to {tab_name} tab",{'tab_name':_L3['name']});_Le.onclick=moveToTab.bind(this,id,_Lc,_L3['from'],_L3['to'],_L3['to_tab_name'],new URI(_L3['next_uri']));_Ld.appendChild(_Le);}else{var _Lf=document.createElement('span');CSS.addClass(_Lf,'unmovable');DOM.setContent(_Lf,_tx("This Box cannot be added to the Wall tab"));_Ld.appendChild(_Lf);}if(!ProfileBoxesEdit.NON_REMOVEABLE[_Lc]){var _L10=document.createElement('a');_L10.href='#';_L10.innerHTML=_tx("Remove Box");_L10.onclick=removeAppBox.bind(this,id,_Lc,_L1,'box_app_');_Ld.appendChild(_L10);}}var _L11=ProfileBoxesEdit.flymenuStyle[_Lc]||'flyout_menu_18 link_menu';var _L12='box_edit_menu_'+_Lc;var menu=dropmenu.getExistingInstance(_L12);if(menu)menu.destroy();(new flyout_menu(_La)).setMarkupContent(_L12,_L11,_tx("Edit Box"),_Ld).addHook('show',function(_La){CSS.addClass(_La,'selected');}.bind(null,_La)).addHook('hide',function(_La){CSS.removeClass(_La,'selected');}.bind(null,_La));CSS.removeClass(_La,'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(_L0){var _L1=$N('div');CSS.addClass(_L1,'loading_layer');_L0.parentNode.style.position='relative';_L1.style.position='absolute';_L0.parentNode.appendChild(_L1);return _L1;}function profile_basic_info_summary_refresh(_L0){$('flyout_menu_profile_basic_info_editor').remove();DOM.replace($('basic_info_summary_box'),HTML(_L0));}function profile_basic_info_summary_editor_onclick(){var _L0=$('basic_info_summary_box');var _L1=profile_insert_loading_layer(this);var key=this.value;var _L3=DOM.find(_L0,'div.'+key);var _L4=!this.checked?animation(_L3).to('height','0px').to('opacity',0).duration(200).hide():animation(_L3).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:key}:{hide:key}).setHandler(function(_L5){var _L6=DOM.find(_L0,'div.no_info');var _L7=true;var _L8=DOM.scry(this.form,'input[type="checkbox"]');for(var ii=0;ii<_L8.length&&_L7;ii++)_L7&=!shown(_L8[ii])||!_L8[ii].checked;_L7?show(_L6):hide(_L6);_L4.go();}.bind(this)).setErrorHandler(function(_L5){this.checked=!this.checked;ErrorDialog.showAsyncError(_L5);}.bind(this)).setFinallyHandler(DOM.remove.bind(null,_L1)).send();}var FriendsBoxEditor={_submit:function(_L0){var _L1=$('app_content_2356318349');var _L2=DOM.find(_L1,'div.loading_placeholder');var _L3=$('profile_friends_box_inner_content');Vector2.getElementDimensions(_L3).setElementHeight(_L2);CSS.addClass(_L1,'is_loading');new AsyncRequest().setURI('/ajax/profile/friends_box.php').setData(_L0).setHandler(function(_L4){payload=_L4.getPayload();DOM.replace(_L3,HTML(payload.friendsBox));}).setFinallyHandler(CSS.removeClass.bind(null,_L1,'is_loading')).send();},setNumToShow:function(_L0){FriendsBoxEditor._submit({max_num_to_show:_L0.value});},toggleNetwork:function(_L0){var _L1=serialize_form(_L0.form)['networks'];var _L2={};var _L3=DOM.scry($('content_box_edit_menu_2356318349'),'div.networks_error')[0];if(_L1){_L2['networks']=_L1;hide(_L3);}else{show(_L3);_L0.checked=true;return false;}FriendsBoxEditor._submit(_L2);return true;},addFriendOrList:function(_L0){var _L1;if(_L0.flid){_L1={add_friend_list:_L0.flid};}else if(_L0.i)_L1={add_friend:_L0.i};FriendsBoxEditor._submit(_L1);},removeFriendOrList:function(_L0){var _L1;if(_L0.flid){_L1={remove_friend_list:_L0.flid};}else if(_L0.i)_L1={remove_friend:_L0.i};FriendsBoxEditor._submit(_L1);},toggleShowNetworks:function(_L0){FriendsBoxEditor._submit({show_networks:_L0.checked});},toggleShowFriendsBox:function(_L0){FriendsBoxEditor._submit({hide_friendsbox:!_L0.checked});}};var ConnectionsBoxEditor={_submit:function(_L0){var _L1=$('app_content_70004827638');var _L2=DOM.find(_L1,'div.loading_placeholder');var _L3=$('profile_connections_box_inner_content');Vector2.getElementDimensions(_L3).setElementHeight(_L2);CSS.addClass(_L1,'is_loading');new AsyncRequest().setURI('/ajax/profile/connections_box.php').setData(_L0).setHandler(function(_L4){DOM.replace(_L3,HTML(_L4.getPayload()));}).setFinallyHandler(CSS.removeClass.bind(null,_L1,'is_loading')).send();},setNumToShow:function(_L0){ConnectionsBoxEditor._submit({max_num_to_show:_L0.value});}};function BlurbEditor(_L0,_L1,_L2){this.root=_L0;this.text=_L1;this.profileId=_L2;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));}else ;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(_L0){this.mode=_L0;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();}else Util.error('Trying to update mode with this.mode='+this.mode+'. Oh noez, a race condition.');},toggleEditor:function(){if(this.mode==BlurbEditor.EDIT){this.blur();}else if(this.mode==BlurbEditor.READ){this._updateView(BlurbEditor.EDIT);}else if(this.mode==BlurbEditor.UPDATING){}return false;},blur:function(e){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(_L1){DOM.setContent(this.textElem,HTML(_L1.getPayload()));}.bind(this)).setFinallyHandler(function(){this._updateView(BlurbEditor.READ);CSS.removeClass(this.inputBox,'updating');this.inputBox.disabled=false;}.bind(this)).send();},_syncText:function(_L0){this.text=trim(_L0);this.inputBox.value=this.text;},onkeypress:function(e){var _L1=Event.getKeyCode(e);if(_L1==KEYS.TAB){this.blur();return false;}if(_L1==KEYS.ESC){this._syncText(this.text);this.blur();return false;}return true;}});function profilePictureEditorCreateFlyout(){var _L0=$('edit_profilepicture');var _L1=$('edit_profilepicture_icon');return flyout_menu(_L0).registerHTMLMenu($('profile_picture_flyout')).setPosition(dropmenu.ALIGN_LEFT).setIconPosition(_L1).addHook('show',function(_L0){CSS.addClass(_L0,'edit_profilepicture_icon_disabled');}.bind(null,_L0)).addHook('hide',function(_L0){CSS.removeClass(_L0,'edit_profilepicture_icon_disabled');}.bind(null,_L0));}function basicProfileEditorSetup(_L0,_L1){var _L2=DOM.find($(_L0),'a.box_editor');flyout_menu(_L2).registerHTMLMenu(_L1).setMenuClickArea(DOM.find($(_L1),'div.menu_custom')).setPosition(dropmenu.ALIGN_LEFT).addHook('show',CSS.addClass.bind(null,_L2,'selected')).addHook('hide',CSS.removeClass.bind(null,_L2,'selected'));CSS.removeClass(_L2,'hidden_elem');}

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