var searchThread=function(n,t,i){function w(n){return n.search(/(《|》)/)>-1&&(n=n.replace(/(《|》)/ig,"")),n.search(/(\"|\')/)>-1&&(n=n.replace(/(\"|\')/ig,"")),n}var r,h,v,f;n=w(n),r={thread:5,taskPlan:"all",searchSites:[],onGetResult:function(){},onSiteStart:function(){},onSiteOver:function(){},onOver:function(){}};for(h in i)typeof r[h]!="undefined"&&(r[h]=i[h]);v=5,f=r.searchSites.length>0?r.searchSites:$e.getSearchTask(r.taskPlan,t).split(/\|\|/g),f=_.sortBy(f,function(n){return parseInt($e.getExtension(n,"sort"))});var u="",c=[],e=0,y=0,l=0,p=!1,o=!1,s="",a=!1;return r.thread=f.length<r.thread?f.length:r.thread,this.stop=function(){o=!0;for(var n=u.length;n--;)u[n]>0&&$e.stop(u[n])},this.start=function(){var i=function(){if(r.onGetResult&&e>0){var n=c,t=e;c=[],e=0;r.onGetResult(t,n)}};u=$e.search(n,t,r.thread,{_gettask:function(){if(o)return null;if(s&&r.onSiteOver)r.onSiteOver(s,l);if(l=0,s=f.shift(),r.onSiteStart)r.onSiteStart(s);return s},_getresult:function(n,t,r){if(!o){for(var u=t;u--;)c.push(r[u]),++l,++y,++e;e>=v&&(a||(a=!0,i(),a=!1))}},_runover:function(n){for(var f=0,t=u.length;t--;)n==u[t]?(u[t]=0,f++):u[t]==0&&f++;if(debugtime(u.join("|")),i(),r.thread==f&&r.onOver)r.onOver(y,o);p=!1,o=!1},_runecho:function(n,t){debugtime(t)}}).split(","),p=!0},this}