
function search_typeaheadpro(obj,source,properties){this.anchor_block=true;this.parent.construct(this,obj,source,properties);}
search_typeaheadpro.extend(typeaheadpro);search_typeaheadpro.prototype.auto_select=false;search_typeaheadpro.prototype.less_than_n_chars=false;search_typeaheadpro.prototype.show=function(){if(!this.less_than_n_chars){this.parent.show();this.dropdown.style.width='148px';}else{this.hide();}}
search_typeaheadpro.prototype.hide=function(){this.parent.hide();remove_css_class_name(ge('q'),'typeahead_border');}
search_typeaheadpro.prototype.found_suggestions=function(suggestions,text,fake_data){this.parent.found_suggestions(suggestions,text,fake_data);if(this.list.firstChild&&this.list.firstChild.firstChild){add_css_class_name(this.list.firstChild.firstChild,'blue_top_border');remove_css_class_name(this.list,'no_border_list');add_css_class_name(this.list.lastChild.lastChild,'blue_bottom_border');add_css_class_name(ge('q'),'typeahead_border');}else{remove_css_class_name(ge('q'),'typeahead_border');remove_css_class_name(ge('q'),'typeahead_border');add_css_class_name(this.list,'no_border_list');}}
function search_friend_source(get_param){this.parent.construct(this,get_param);new AsyncRequest().setMethod('GET').setReadOnly(true).setURI('/ajax/typeahead_search.php?'+get_param).setErrorHandler(function(){}).setHandler(function(response){this.values=response.getPayload().entries;this.build_index();}.bind(this)).send();}
search_friend_source.extend(static_source);search_friend_source.prototype.text_noinput=search_friend_source.prototype.text_placeholder=search_friend_source.prototype.text_nomatch='';search_friend_source.prototype.cache_results=true;search_friend_source.prototype.gen_html=function(friend,highlight){if(friend.it){return['<div class="icon" style="background-image: url(',friend.it,')">&nbsp;</div><div class="app_name">',typeahead_source.highlight_found(friend.t,highlight),'</div>'].join('');}else{return['<div>',typeahead_source.highlight_found(friend.t,highlight),'</div><div><small>',friend.n,'</small></div>'].join('');}}
search_friend_source.prototype.search_value=function(text){if(text.length>=2){this.owner.less_than_n_chars=false;return this.parent.search_value(text);}else if(this.is_ready){this.owner.less_than_n_chars=true;return[];}}
function search_typeahead_onsubmit(friend){if(friend){if(SEARCH_TYPEAHEAD_ONCLICK){if(!search_friend_source.already_logged){eval(SEARCH_TYPEAHEAD_ONCLICK);search_friend_source.already_logged=true;}}
if(friend.u.indexOf('?')!=-1){document.location=friend.u+'&ref=ts';}else{document.location=friend.u+'?ref=ts';}
return false;}}
search_friend_source.prototype._sort_text_obj=function(a,b){if(a.o!=b.o){return a.o-b.o;}else if(a.t==b.t){return 0;}
return a.t<b.t?-1:1}