/*    HTTP Host:  b.static.ak.fbcdn.net                                        */
/*    Generated:  March 9th 2010 2:07:58 PM PST                                */
/*      Machine:  10.16.140.102                                                */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/3qjara4kghyco8gg.pkg.js                                   */

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

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} m\u00e1s",{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 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 a\u00f1adir 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);};

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