function doAutoSearch(b,a){$(b).autocomplete({source:function(d,c){$.ajax({url:apiJsonUrl+"/"+a+"/search/"+$(b).val()+"/5?method=?",dataType:"jsonp",data:{featureClass:"P",style:"full",maxRows:5,name_startsWith:d.term},success:function(e){c($.map(e,function(f){return{name:f.Name,totalRaised:f.TotalRaisedFormatted,image:'<img src="/resources/thumb_'+f.PhotoPath+"\" width='50' />",profileUrl:f.ProfileUrl,itemType:f.ItemType,location:f.Location}}))}})},minLength:2,select:function(c,d){if(d.item!=null){if(d.item.itemType==1){document.location.href="/teams/"+d.item.profileUrl}else{document.location.href="/profiles/"+d.item.profileUrl}}else{document.location.href="/Leaderboards/default_s.aspx?f=0&p=3&keyword="+$(b).val()}return false},open:function(){$(this).removeClass("ui-corner-all").addClass("ui-corner-top")},close:function(){$(this).removeClass("ui-corner-top").addClass("ui-corner-all")}})};
