/*    HTTP Host:  static.ak.fbcdn.net                                          */
/*    Generated:  February 9th 2010 2:23:22 PM PST                             */
/*      Machine:  10.16.140.103                                                */
/*       Source:  Backing Store                                                */
/*     Location:  js/8d43mv5ljtogwo0o.pkg.js h:3ysl49dj                        */
/*       Locale:  nu_ll                                                        */
/*         Path:  js/8d43mv5ljtogwo0o.pkg.js                                   */

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

function ads_refresh(l,h,g,f,i,m,k){if(window.ads_refreshing)return;if(m===undefined)m=0;var j=['sidebar_ads','home_sponsor_nile','ego'];var e=[];for(var d=0;d<j.length;d++)if(ge(j[d]))e.push(j[d]);if(e.length==0)return;var c={page:h,tab:l,locations:e,photo_refresh:(i?'yes':'no'),cache:m};var b=function(r,q){window.ads_refreshing=false;if(!r){var n=q.getPayload();for(var p in n){var o=ge(p);if(o&&n[p].length>0)if(ua.ie()<7){o.outerHTML=n[p];}else DOM.replace(o,HTML(n[p]));}}if(g)g(q);}.curry(k);var a=function(n){window.ads_refreshing=false;if(f)f(n);};new AsyncRequest().setURI('/ajax/location_refresh.php').setData(c).setOption('bundle',true).setHandler(b).setErrorHandler(a).send();window.ads_refreshing=true;}function social_ads_pagecache_log_imps(){var a=DOM.scry(document,'div.pagecache_social_ad');for(var c=0;c<a.length;c++){var b={meta:DataStore.get(a[c],'link_data')};new AsyncRequest().setURI('/ajax/social_ad_impression.php').setOption('bundle',true).setData(b).send();}}
function toggle_app_data(g,h){var d=ge(g);if(!d)return;var e=ge(h);if(!e)return;var c=$('dev_app_list').childNodes[0];if(!c)return;var b=ge('dev_app_infos');if(!b)return;var a=c.childNodes;for(var f=0;f<a.length;f++)if(CSS.hasClass(a[f],'flag_nav_item_selected')){CSS.removeClass(a[f],'flag_nav_item_selected');break;}var a=b.childNodes;for(var f=0;f<a.length;f++)if(CSS.hasClass(a[f],'app_show')){CSS.removeClass(a[f],'app_show');CSS.addClass(a[f],'app_hide');break;}CSS.addClass(d,'flag_nav_item_selected');CSS.removeClass(e,'app_hide');CSS.addClass(e,'app_show');}function app_source(b){var a=JSON.decode(b);if(a.searchable_apps){if(a.added_apps)this.added_apps=a.added_apps;a=a.searchable_apps;}this.parent.construct(this,a);}app_source.extend('custom_source');app_source.prototype.text_noinput='Enter an application name.';app_source.prototype.text_placeholder='Enter an application name.';app_source.prototype.gen_html=function(d,a){var c=d.it;var b=[];return ['<div class="app_option"><div class="icon" style="background-image: url(',c,')">&nbsp;</div>','<span>',typeahead_source.highlight_found(d.t,a),'</span></div>'].join('');};app_source.prototype.gen_nomatch=function(){if(!this.added_apps)return this.parent.gen_nomatch();var c=typeahead_source.tokenize(this.owner.get_value());var a=[];for(var b=0;b<this.added_apps.length;b++)if(typeahead_source.check_match(c,this.added_apps[b]))a.push(this.added_apps[b]);if(a.length==0){return _tx("No application found. Please note not all applications support tabs.");}else if(a.length==1){return _tx("No application found. Please note {app-name} has already been added, and not all applications support tabs.",{"app-name":a[0]});}else if(a.length==2){return _tx("No application found. Please note {app-name-1} and {app-name-2} have already been added, and not all applications support tabs.",{"app-name-1":a[0],"app-name-2":a[1]});}else return _tx("No application found. Please note applications including {app-name-1} and {app-name-2} have already been added, and not all applications support tabs.",{"app-name-1":a[0],"app-name-2":a[1]});};
function dropmenu(a){if(this==window){return new dropmenu(a);}else{this.className=null;this.menu=null;this.menuClickArea=null;this.showHandler=null;this.hideHandler=null;this.alignment=null;this.direction=null;this.isShown=false;this.canHide=false;this.show_hooks=[];this.hide_hooks=[];this.clickTarget=$(a);this.displayTarget=$(a);this.id=null;this.rtl=false;this._clickToHide=true;this._markupContentCallback=bagofholding;this.clickHandle=this.clickTarget.listen('click',this.toggle.bind(this));this.container=ge('dropmenu_container')||document.body;return this;}}dropmenu.ALIGN_RIGHT=1;dropmenu.ALIGN_LEFT=2;dropmenu.DIRECTION_UP=3;dropmenu.DIRECTION_DOWN=4;dropmenu.INSTANCES={};dropmenu.prototype.setPosition=function(a){this.alignment=a;return this;};dropmenu.prototype.setDirection=function(a){this.direction=a;return this;};dropmenu.prototype.setMenuClickArea=function(a){this.menuClickArea=$(a);return this;};dropmenu.prototype.setDisplayTarget=function(a){this.displayTarget=$(a);return this;};dropmenu.prototype.setClickToHide=function(a){this._clickToHide=a;return this;};dropmenu.prototype.setMarkupContent=function(b,a,c){this.menuContent=c;this.className=a;this.id=b;return this;};dropmenu.prototype.setMarkupContentCallback=function(a){this._markupContentCallback=a;return this;};dropmenu.prototype._getMarkupContent=function(){return this.menuContent||this._markupContentCallback();};dropmenu.prototype.registerHTMLMenu=function(a){this.registered_menu_id=a;return this;};dropmenu.prototype.addHook=function(b,a){this[b+'_hooks'].push(a);return this;};dropmenu.prototype.removeHook=function(c,a){for(var b=0;b<this[c+'_hooks'].length;b++)if(a==this[c+'_hooks'][b]){this[c+'_hooks'].splice(b,1);return true;}return this;};dropmenu.prototype.toggle=function(a){if(!this.isShown){this._show();this.canHide=false;}else this._hide();if(a)$E(a).prevent();};dropmenu.prototype.show=function(){this._show();};dropmenu.prototype.hide=function(){if(!this.menu)return;this._hide();};dropmenu.prototype.destroy=function(){if(this.menu&&this.menu.parentNode){this.menu.parentNode.removeChild(this.menu);this.menu=null;}};dropmenu.prototype._buildMenu=function(){if(intl_locale_is_rtl()&&!this.rtl){this.alignment=(this.alignment==dropmenu.ALIGN_RIGHT)?dropmenu.ALIGN_LEFT:dropmenu.ALIGN_RIGHT;this.rtl=true;}if(this.registered_menu_id){this.menu=$(this.registered_menu_id);if(this.alignment||this.direction)this.container.appendChild(this.menu);}else this._buildDynamicMenu();dropmenu.INSTANCES[this.id]=this;this.menuClickArea=this.menuClickArea||DOM.scry(this.menu,'div.menu_content');this.menuClickArea.onclick=chain(this.menuClickArea.onclick,Event.stop);var b=DOM.scry(this.menu,'a');for(var a=0;a<b.length;a++)addEventBase(b[a],'click',function(){if(this._clickToHide)this._hide();}.bind(this),this.menu_id+'_link_'+a);};dropmenu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');this.menu.className='dropdown_menu hidden_elem '+(this.className?' '+this.className:'');this.menu.id='dropdown_menu_'+this.id;var a=this._getMarkupContent();if(!is_scalar(a)){DOM.setContent(this.menu,a);}else set_inner_html(this.menu,a);this.container.appendChild(this.menu);};dropmenu.prototype._positionMenu=function(){if(this.alignment||this.direction||(!this.alignment&&!this.direction&&!this.registered_menu_id)){if(this.menu.parentNode!=this.container)this.container.appendChild(this.menu);var b=Vector2.getElementPosition(this.displayTarget,'document');var a=Vector2.getElementPosition(this.container,'document');var e=b.x-a.x;var f=b.y-a.y+this.displayTarget.offsetHeight;if(this.alignment==dropmenu.ALIGN_RIGHT||this.direction==dropmenu.DIRECTION_UP){CSS.removeClass(this.menu,'hidden_elem');this.menu.style.left='-9999px';this.menu.style.top='-9999px';if(this.alignment==dropmenu.ALIGN_RIGHT){var d=this.menu.offsetWidth;e=e+this.displayTarget.offsetWidth-d;}if(this.direction==dropmenu.DIRECTION_UP){var c=this.menu.offsetHeight;f=f-this.displayTarget.offsetHeight-c+1;}CSS.addClass(this.menu,'hidden_elem');}this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};dropmenu.prototype._onclick=function(event){this._hide();return false;};dropmenu.prototype._show=function(){if(!this.menu)this._buildMenu();this._positionMenu();CSS.removeClass(this.menu,'hidden_elem');var a=this._documentHideHandler.bind(this);this.click_event=addEventBase(document.body,'click',a,this.menu.id);onbeforeunloadRegister(a);this.isShown=true;for(var b=0;b<this.show_hooks.length;b++)this.show_hooks[b]();};dropmenu.prototype._documentHideHandler=function(a){if(!this.canHide){this.canHide=true;}else this._hide();};dropmenu.prototype._hide=function(){if(this.menu)CSS.addClass(this.menu,'hidden_elem');if(this.click_event)removeEventBase(document.body,'click',this.click_event,this.menu.id);this.click_event=null;this.isShown=false;for(var a=0;a<this.hide_hooks.length;a++)this.hide_hooks[a]();if(!this.registered_menu_id)this.destroy();};dropmenu.prototype._build_menu_shim=function(){this.shim=null;if(ua.ie()<7){this.shim=document.createElement('iframe');CSS.setClass(shim,'iframe_shim');this.container.appendChild(this.shim);}};dropmenu.getExistingInstance=function(a){return dropmenu.INSTANCES[a];};function flyout_menu(a){if(this==window){return new flyout_menu(a);}else{this.title='';this.parent.construct(this,a);}}flyout_menu.extend('dropmenu');flyout_menu.prototype.setMarkupContent=function(b,a,d,c){this.parent.setMarkupContent(b,a,c);this.title=d;return this;};flyout_menu.prototype.setIconPosition=function(a){this.iconElem=a;return this;};flyout_menu.prototype._buildDynamicMenu=function(){this.menu=document.createElement('div');CSS.addClass(this.menu,(this.className||'')+' flyout_menu hidden_elem');if(this.alignment==dropmenu.ALIGN_RIGHT)CSS.addClass(this.menu,'flyout_menu_left');this.menu.id='flyout_menu_'+this.id;var c='content_'+this.id;var a=[];a.push('<div class="flyout_menu_header_shadow">');a.push('<div class="flyout_menu_header clearfix">');a.push('<div class="flyout_menu_mask"></div>');a.push('<div class="flyout_menu_title">'+this.title+'</div>');a.push('</div></div>');a.push('<div class="flyout_menu_content_shadow">');a.push('<div class="menu_content" id="content_'+this.id+'">');a.push('</div></div>');set_inner_html(this.menu,a.join(''));this.container.appendChild(this.menu);var b=this._getMarkupContent();if(!is_scalar(b)){DOM.setContent($(c),b);}else set_inner_html($(c),b);this.menuClickArea=$(c);};flyout_menu.prototype._positionMenu=function(){if(this.alignment||(!this.alignment&&!this.registered_menu_id)){var e;var a=this.iconElem?this.iconElem:this.clickTarget;switch(this.alignment){case dropmenu.ALIGN_LEFT:case null:e=elementX(a)-elementX(this.container);break;case dropmenu.ALIGN_RIGHT:this.menu.style.left='-9999px';this.menu.style.top='-9999px';CSS.removeClass(this.menu,'hidden_elem');var b=Vector2.getElementDimensions(this.menu).x;var d=Rect.getElementBounds(a).r-elementX(this.container);var c=4;e=d-b+c*2;CSS.addClass(this.menu,'hidden_elem');break;}var f=elementY(a)-elementY(this.container);this.menu.style.left=e+'px';this.menu.style.top=f+'px';}};function hover_menu(a){if(this==window){return new hover_menu(a);}else{this.parent.construct(this,a);this.timeOut=0;this.clickHandle.remove();this.enterTimer=null;this.exitTimer=null;}}hover_menu.extend('dropmenu');hover_menu.prototype.setTimeoutInterval=function(a){this.timeOut=a;return this;};hover_menu.prototype._clickTarget_onmouseover=function(b,a){clearTimeout(this.exitTimer);if(!this.isShown)this.enterTimer=setTimeout(function(){this._show();}.bind(this),this.timeOut);};hover_menu.prototype._clickTarget_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown&&!DOM.contains(this.menu,b))this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype._menu_onmouseover=function(b,a){clearTimeout(this.exitTimer);};hover_menu.prototype._menu_onmouseout=function(c,a){a=a||window.event;var b=(a.relatedTarget)?a.relatedTarget:a.toElement;if(DOM.contains(c,b))return;clearTimeout(this.enterTimer);if(this.isShown)this.exitTimer=setTimeout(function(){this._hide();}.bind(this),this.timeOut);};hover_menu.prototype.initialize=function(){if(!this.menu)this._buildMenu();this.clickTarget.listen('mouseover',this._clickTarget_onmouseover.bind(this,this.clickTarget));this.clickTarget.listen('mouseout',this._clickTarget_onmouseout.bind(this,this.clickTarget));this.menu.listen('mouseout',this._menu_onmouseout.bind(this,this.menu));this.menu.listen('mouseover',this._menu_onmouseover.bind(this,this.menu));this._positionMenu();return this;};
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("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(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 friends");}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} others",{name1:d[0],name2:d[1],count:d.length-2});}else if(d.length){e=d.join(', ');}else e=_tx("0 friends");}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 email_source(a){a=a?a+'&include_emails=1':'';this.parent.construct(this,a);}email_source.extend('friend_and_email_source');email_source.prototype.text_noinput=email_source.prototype.text_placeholder=_tx("You can type an email address...");email_source.prototype.text_nomatch=_tx("You can type an email address...");email_source.prototype.bootstrap=function(a){this.values='';this.index=0;this.ready();};
function token(b,c,a){if(b.is&&(c.count_names(b.is)>c.max_selections)){new ContextualDialog().setContext(c.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=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\/8d43mv5ljtogwo0o.pkg.js"]); }