/*
HTTP Host: b.static.ak.fbcdn.net
Generated: March 15th 2010 6:31:15 PM PDT
Machine: 10.16.140.108
Locale: nu_ll
Path: js/bf7s29ctadc0gc0s.pkg.js
*/

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

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 se encontraron aplicaciones. No todas las aplicaciones admiten pesta\u00f1as.");}else if(a.length==1){return _tx("No se encontr\u00f3 la aplicaci\u00f3n. Por favor observa que {app-name} ya se ha a\u00f1adido, y no todas las aplicaciones soportan etiquetas.",{"app-name":a[0]});}else if(a.length==2){return _tx("No se ha encontrado la aplicaci\u00f3n. Por favor, Observa que {app-name-1} y {app-name-2} ya se han a\u00f1adido, y que no todas las aplicaciones admiten pesta\u00f1as.",{"app-name-1":a[0],"app-name-2":a[1]});}else return _tx("No se encontr\u00f3 la aplicaci\u00f3n. Por favor observa que las aplicaciones incluyendo {app-name-1} y {app-name-2} ya han sido a\u00f1adidas, y no todas las aplicaciones soportan etiquetas.",{"app-name-1":a[0],"app-name-2":a[1]});};
function friend_source(a){if(typeof(a)=='object')a=a[0];this.bootstrap=this.bootstrap.bind(this,a);this.parent.construct(this);}friend_source.extend('static_source');friend_source.prototype.text_noinput=friend_source.prototype.text_placeholder=_tx("Empieza a escribir un nombre");friend_source.friends={};friend_source.friends_index={};friend_source.viewer_id=0;friend_source.prototype.cache_results=true;friend_source.prototype.bootstrap=function(a){if(friend_source.friends[a]){this.values=friend_source.friends[a];this.index=friend_source.friends_index[a];this.ready();}else new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_friends.php?'+a).setHandler(function(b){friend_source.friends[a]=this.values=this.filter_excluded(b.getPayload().friends);this.viewer_id=b.getPayload().viewer_id;this.build_index();friend_source.friends_index[a]=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(a,b){var e=a.n||'&nbsp;';if(a.n===false){e=_tx("0 amigos");}else if(typeof(a.n)=="object"){var d=[];for(var c in a.n)d.push(a.n[c]);if(d.length>3){e=_tx("{name1}, {name2}, {count} otros",{name1:d[0],name2:d[1],count:d.length-2});}else if(d.length){e=d.join(', ');}else e=_tx("0 amigos");}return ['<div>',typeahead_source.highlight_found(a.t,b),'</div><div><small>',e,'</small></div>'].join('');};friend_source.prototype.search_value=function(a){if(a=='\x5e\x5f\x5e')return [{t:a,n:'\x6b\x65\x6b\x65',i:10,it:'http://static.ak.facebook.com/pics/t_default.jpg'}];return this.parent.search_value(a);};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(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("Escribe tu mayor o menor");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("\u00bfEliminar este centro?")).setBody(_tx("\u00bfSeguro que deseas eliminar este centro? Si lo haces, perder\u00e1s toda la informaci\u00f3n que tienes guardada sobre el mismo.")).setButtons([Dialog.newButton('remove',_tx("Eliminar")),Dialog.CANCEL]).setHandler(function(){removeSection(c,b);a.hide();}).show();return false;}function workhistory_remove_entry(b){var a=new Dialog().setTitle(_tx("\u00bfEliminar este empleo?")).setBody(_tx("\u00bfSeguro que deseas eliminar este empleo? Si lo haces, perder\u00e1s toda la informaci\u00f3n actualmente guardada.")).setButtons([Dialog.newButton('remove',_tx("Eliminar")),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("Escribe el nombre");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("Enviaremos una notificaci\u00f3n a {name}, quien tendr\u00e1 que confirmar que sois familia antes de crear un enlace desde tu perfil.",{name:f}));var a=HTML('<span> (<a>'+_tx("Cancelar")+'</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 friend_and_email_source(a){a=a?a+'&include_emails=1':'';this.parent.construct(this,a);}friend_and_email_source.extend('friend_source');friend_and_email_source.prototype.text_noinput=friend_and_email_source.prototype.text_placeholder=_tx("Escribe el nombre de un amigo, lista o direcci\u00f3n de correo electr\u00f3nico");friend_and_email_source.prototype.text_nomatch=_tx("Puedes escribir una direcci\u00f3n de correo electr\u00f3nico...");friend_and_email_source.prototype.onselect_not_found=function(){emails=this.results_text.split(/[,; ]/);for(var d=0;d<emails.length;d++){var f=emails[d].replace(/^\s+|\s+$/g,'');var c=/.*\@.*\.[a-z]+$/;if(!c.test(f))continue;var b={t:f,e:f};var e=new token(b,this.tokenizer,this.element);var a={email:f,pluses:false};new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_email.php').setData(a).setHandler(function(h){if(h.getPayload()){var g=h.getPayload().token;this.render_obj(g);this.tokenizer._ontokenadded(g);}else this.tokenizer._ontokennotfound(f);}.bind(e)).setErrorHandler(function(g){ErrorDialog.showAsyncError(g);this.remove(false);}.bind(e)).send();}this.clear();};
function friendlist_source(a){this.parent.construct(this,a);this.generation=0;}friendlist_source.extend('friend_source');friendlist_source.master_generation=1;friendlist_source.dirty=function(){friend_source.dirty();friendlist_source.master_generation++;};friendlist_source.prototype.friend_lists=false;friendlist_source.prototype.text_placeholder=_tx("Empieza a escribir el nombre de un amigo o lista de amigos...");friendlist_source.prototype.return_friend_lists=function(){if(!this.friend_lists||(this.generation<friendlist_source.master_generation)||(this.friend_lists&&this.friend_lists.length==0)){this.generation=friendlist_source.master_generation;this.friend_lists=[];var b=this.index;var d=[];var c=[];if(!b.length||!(b.length>=1))return;for(var a=0;a<b.length;a++)if(b[a].o.flid&&!c[b[a].o.flid]){c[b[a].o.flid]=true;d.push(b[a].o);}var e=d.sort(function(f,g){if(f.t>g.t){return 1;}else if(f.t<g.t){return -1;}else return 0;});this.friend_lists=e;}return this.friend_lists;};friendlist_source.prototype.search_value=function(a){if(a=='**FRIENDLISTS**')return this.return_friend_lists();return this.parent.search_value(a);};friendlist_source.prototype.gen_nomatch=function(){if(this.showing_icon_list){return _tx("No tienes listas de amigos. Usa la p\u00e1gina de amigos para crear una lista.");}else return this.parent.gen_nomatch();};
function token(b,c,a){if(b.is&&(c.count_names(b.is)>c.max_selections)){new ContextualDialog().setContext(c.obj).setTitle(_tx("No se puede agregar la lista.")).setBody(_tx("Solo puedes enviar un mensaje a 20 personas de una vez como m\u00e1ximo.")).show().setAutohide(1500);return null;}this.tokenizer=c;this.element=document.createElement('a');CSS.setClass(this.element,'token'+('class' in b?' '+b['class']:''));this.element.href='#';this.element.tabIndex=-1;this.element.onclick=function(event){return this._onclick(event?event:window.event);}.bind(this);this.element.onmousedown=function(event){(event?event:window.event).cancelBubble=true;return false;};this.render_obj(b);this.obj=b;this.element.token=this;this.tokenizer.hide_inline_placeholder();a?this.tokenizer.obj.insertBefore(this.element,a):this.tokenizer.obj.appendChild(this.element);}token.prototype.render_obj=function(f){var e='';if(f.np){var b='';}else var b='fb_protected="true" ';var a='class="fb_token_hidden_input" ';if(f.e){e=['<input type="hidden" ',a,b,'name="emails[]" value="',f.e,'" />'].join('');}else if(f.i||f.i===0){e=['<input type="hidden" ',a,b,'name="',this.tokenizer.obj.name,'[]" value="',f.i,'" />'].join('');}else if(f.is){for(var c=0,d=f.is.length;c<d;c++)e+=['<input type="hidden" ',a,b,'name="',this.tokenizer.obj.name,'[]" value="',f.is[c],'" />'].join('');this.explodable=true;this.n=f.n;}this.text=f.t;this.element.innerHTML=['<span><span><span><span>',e,htmlspecialchars(f.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=f;};token.prototype._onclick=function(event){var e=(new Date()).getTime();if(this.explodable&&this.tokenizer.last_select_time&&(e-this.tokenizer.last_select_time<1400)){var f=this.n;this.remove();var d=this.tokenizer.obj.getElementsByTagName('input');var a={};for(var b=0;b<d.length;++b)if(d[b].name==this.tokenizer.obj.id+'[]')a[d[b].value]=true;for(var c in f)if(!a[c])new token({t:f[c],i:c},this.tokenizer);}else this.select();this.tokenizer.last_select_time=e;event.cancelBubble=true;return false;};token.prototype.select=function(a){if(this.tokenizer.selected_token&&!a)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(a!==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(a){this.element.parentNode.removeChild(this.element);this.element.token=null;this.tokenizer.selected_token=null;if(a)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(c,a){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=c;c.tokenizer_input=this;this.obj=document.createElement('input');this.obj.input=this;this.obj.size=1;this.obj.onmousedown=function(event){(event?event: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 b=(tokenizer_input.should_use_shadow_hack?DOM.getRootElement():this.element.firstChild);b.appendChild(this.shadow);a?c.obj.insertBefore(this.element,a):c.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,c.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 a=this.obj.value;}catch(e){return;}if(this.shadow_input!=a){this.shadow.innerHTML=htmlspecialchars((this.shadow_input=a)+'^_^');if(tokenizer_input.should_use_shadow_hack){this.obj.style.width=this.shadow.offsetWidth+'px';this.obj.value=a;}}};tokenizer_input.prototype._onblur=function(a){if(this.parent._onblur(a)===false)return false;this.tokenizer._onblur(a);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);var b=this.element.nextSibling;if(b==null)return;var c=this.element.previousSibling;if(c.className!="tab_stop"||b.token){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(event){switch(event.keyCode){case 13:break;case 37:case 8:if(this.get_selection_start()!=0||this.obj.value!='')break;var b=this.element.previousSibling;if(b&&b.token)setTimeout(b.token.select.bind(b.token),0);break;case 39:case 46:if(this.get_selection_start()!=this.obj.value.length)break;var a=this.element.nextSibling;if(a&&a.token)setTimeout(a.token.select.bind(a.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(!event.shiftKey){this.advance_focus();this.parent._onkeydown(event);return false;}break;}return this.parent._onkeydown(event);};tokenizer_input.prototype._onkeypress=function(event){switch(event.keyCode){case 9:return false;}setTimeout(this.update_shadow,0);return this.parent._onkeypress(event);};tokenizer_input.prototype.select_suggestion=function(c){if(this.suggestions&&c>=0&&this.suggestions.length>c){var d=this.tokenizer.obj.getElementsByTagName('input');var b=this.suggestions[c].i;for(var a=0;a<d.length;a++)if(d[a].name==this.tokenizer.obj.id+'[]'&&d[a].value==b)return false;}return this.parent.select_suggestion(c);};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(c){if(this.get_value()==''&&this.last_key==13){return this.tokenizer.onsubmit();}else if(c){var b=this.tokenizer.obj.getElementsByTagName('input');for(var a=0;a<b.length;a++)if(b[a].name==this.tokenizer.obj.id+'[]'&&b[a].value==c.i)return false;new token(c,this.tokenizer,this.element);this.clear();if(this.tokenizer.max_selections<=this.tokenizer.count_names())this.destroy.bind(this).defer();this.tokenizer._ontokenadded(c);}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 a=this.tokenizer.inputs.indexOf(this);if(a!=-1)this.tokenizer.inputs.splice(a,1);}this.tokenizer=this.element=this.shadow=null;return null;};
function tokenizer(c,e,b,a,d){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=c;this.obj.tokenizer=this;this.obj.name=c.id;this.typeahead_source=e;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(event){return this._onmousedown(event?event:window.event);}.bind(this);if(this.tab_stop){this.tab_stop.onfocus=function(event){return this._onfocus(event?event:window.event);}.bind(this);this.tab_stop.onblur=function(event){return this.tab_stop_onblur(event?event:window.event);}.bind(this);this.tab_stop.onkeydown=function(event){return this.tab_stop_onkeydown(event?event:window.event);}.bind(this);}if(!b&&elementY(this.obj)>0&&this.obj.offsetWidth)this._onfocus();this.max_selections=a;copy_properties(this,d||{});this.properties=d;if(this.inline_placeholder_text)this.init_inline_placeholder();}tokenizer.prototype.onsubmit=bagofholding;tokenizer.prototype.setName=function(a){this.obj.name=a;};tokenizer.is_empty=function(a){if(CSS.hasClass(a,'tokenizer_locked')){return a.getElementsByTagName('input').length==0;}else return (!a.tokenizer||a.tokenizer.count_names()==0);};tokenizer.prototype.get_token_values=function(){var c=[];var b=this.obj.getElementsByTagName('input');for(var a=0;a<b.length;++a)if(b[a].name&&b[a].value)c.push(b[a].value);return c;};tokenizer.prototype.get_token_strings=function(){var b=[];var c=this.obj.getElementsByTagName('a');for(var a=0;a<c.length;++a)if(typeof c[a].token!='undefined')b.push(c[a].token.text);return b;};tokenizer.prototype.clear=function(){var b=this.obj.getElementsByTagName('a');for(var a=b.length-1;a>=0;--a)if(typeof b[a].token!='undefined')b[a].token.remove();};tokenizer.prototype.remove_token=function(b){var c=this.obj.getElementsByTagName('a');for(var a=c.length-1;a>=0;--a)if(typeof c[a].token!='undefined'&&(c[a].token.obj.i==b||c[a].token.obj.flid==b)){c[a].token.remove();break;}};tokenizer.prototype.clear_current_input=function(){this.tokenizer_input.clear();};tokenizer.prototype._onmousedown=function(event){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 b=this.obj.getElementsByTagName('a');for(var a=b.length-1;a>=0;a--)if(typeof b[a].token!='undefined'){b[a].token.select();break;}}}else this.inputs[0].focus();}.bind(this),0);event?event.cancelBubble=true:false;return false;};tokenizer.prototype._onfocus=function(event){if(this.tab_stop_ignore_focus){this.tab_stop_ignore_focus=false;return;}this._onmousedown();};tokenizer.prototype._onblur=function(event){if(this.onblur)this.onblur();this.show_inline_placeholder();};tokenizer.prototype.tab_stop_onblur=function(event){this.selected_token?this.selected_token.deselect():false;};tokenizer.prototype.tab_stop_onkeydown=function(event){if(!event.keyCode||!this.selected_token)return;switch(event.keyCode){case 8:case 46:var d=this.selected_token;var c=d.element.previousSibling;if(c&&c.input){c.input.element.focus();}else this.tokenizer_inputs.push(new tokenizer_input(this,d.element));d.remove();return false;case 37:if(!tokenizer.valid_arrow_event())break;var d=this.selected_token;var c=d.element.previousSibling;if(c&&c.input){c.input.element.focus();}else if(this.max_selections>this.count_names()){this.tokenizer_inputs.push(new tokenizer_input(this,d.element));}else return false;d.deselect();return false;case 39:if(!tokenizer.valid_arrow_event())break;var d=this.selected_token;var b=d.element.nextSibling;if(b&&b.input){b.input.focus();}else if(this.max_selections>this.count_names()){var a=new tokenizer_input(this,d.element.nextSibling);this.tokenizer_inputs.push(a);}else return false;d.deselect();return false;}};tokenizer.prototype.count_names=function(e){var c=this.obj.getElementsByTagName('input');var f={};var a=0;for(var b=0;b<c.length;b++)if(c[b].type=='hidden'&&!f[c[b].value]){f[c[b].value]=true;++a;}if(e)for(var d=0;d<e.length;d++)if(!f[e[d]]){f[e[d]]=true;++a;}return a;};tokenizer.prototype.disable=function(){this.tab_stop.parentNode.removeChild(this.tab_stop);this.obj.className+=' tokenizer_locked';};tokenizer.prototype._ontokenadded=function(a){if(this.ontokenadded)this.ontokenadded.call(this,a);};tokenizer.prototype._ontokenremoved=function(a){if(this.ontokenremoved)this.ontokenremoved.call(this,a);};tokenizer.prototype._ontokennotfound=function(a){if(this.ontokennotfound)this.ontokennotfound.call(this,a);};tokenizer.prototype.init_inline_placeholder=function(){if(this.inline_placeholder)return;var a=$N('span',{className:'inline_placeholder'},this.inline_placeholder_text);if(!tokenizer.is_empty(this.obj))a.setStyle('display','none');this.obj.appendChild(a);this.inline_placeholder=a;};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(b){this.typeahead_source=b;if(this.tokenizer_inputs.length)for(var a=0;a<this.tokenizer_inputs.length;a++)this.tokenizer_inputs[a].set_source(b);if(this.tokenizer_input)this.tokenizer_input.set_source(b);};
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("Cargando...")+'</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("Guardar"),handler:c.bind(this)});a.push({name:'dont_save',label:_tx("No guardar"),className:'inputaux',handler:this.closeEditor.bind(this,true)});a.push(Dialog.CANCEL);new Dialog().setTitle(_tx("Cambios sin guardar")).setBody(_tx("Algunos de tus cambios no han sido guardados. \u00bfTe gustar\u00eda guardarlos ahora?")).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(e,a){this.parent.construct(this,e,a);var b=[this.edit_id,this.edit_jaws_id];for(var c in b){var d=ge(b[c]);if(d)d.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("Mover a la pesta\u00f1a {tab_name} ",{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("Esta caja no puede agregarse a la pesta\u00f1a Muro"));m.appendChild(q);}if(!ProfileBoxesEdit.NON_REMOVEABLE[a]){var r=document.createElement('a');r.href='#';r.innerHTML=_tx("Eliminar cuadro");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("Editar cuadro"),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("Editar");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("Guardar");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');}
function motion_show_embed_video_dialog(b){var a=new AsyncRequest().setURI('/ajax/video/embed.php').setData({v:b});new Dialog().setClassName('video_embed_dialog').setAsync(a).show();}

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