1function JCTitleSearch2(arParams){var _this=this;this.arParams={AJAX_PAGE:arParams.AJAX_PAGE,CONTAINER_ID:arParams.CONTAINER_ID,INPUT_ID:arParams.INPUT_ID,INPUT_ID_TMP:arParams.INPUT_ID_TMP,MIN_QUERY_LEN:parseInt(arParams.MIN_QUERY_LEN)},arParams.WAIT_IMAGE&&(this.arParams.WAIT_IMAGE=arParams.WAIT_IMAGE),arParams.MIN_QUERY_LEN<=0&&(arParams.MIN_QUERY_LEN=1),this.cache=[],this.cache_key=null,this.startText="",this.running=!1,this.needRunAgain=!1,this.currentRow=-1,this.RESULT=null,this.CONTAINER=null,this.INPUT=null,this.WAIT=null,this.ShowResult=function(result){BX.type.isString(result)&&(_this.RESULT.innerHTML=result),_this.RESULT.style.display=""!==_this.RESULT.innerHTML?"block":"none";var pos=_this.adjustResultNode(),res_pos,th,tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),fade;if(tbl&&(th=BX.findChild(tbl,{tag:"th"},!0)),th){var tbl_pos=BX.pos(tbl);tbl_pos.width=tbl_pos.right-tbl_pos.left;var th_pos=BX.pos(th);th_pos.width=th_pos.right-th_pos.left,th.style.width=th_pos.width+"px",_this.RESULT.style.width=pos.width+th_pos.width+"px",_this.RESULT.style.left=pos.left-th_pos.width-1+"px",tbl_pos.width-th_pos.width>pos.width&&(_this.RESULT.style.width=pos.width+th_pos.width-1+"px"),tbl_pos=BX.pos(tbl),(res_pos=BX.pos(_this.RESULT)).right>tbl_pos.right&&(_this.RESULT.style.width=tbl_pos.right-tbl_pos.left+"px")}tbl&&(fade=BX.findChild(_this.RESULT,{class:"title-search-fader"},!0)),fade&&th&&(res_pos=BX.pos(_this.RESULT),fade.style.left=res_pos.right-res_pos.left-18+"px",fade.style.width="18px",fade.style.top="0px",fade.style.height=res_pos.bottom-res_pos.top+"px",fade.style.display="block"),"function"==typeof InitScrollBar&&InitScrollBar()},this.onKeyPress=function(keyCode){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0),i;if(!tbl)return!1;var cnt=tbl.rows.length;switch(keyCode){case 27:return _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll(),!0;case 40:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var first=-1;for(i=0;i<cnt;i++)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==first&&(first=i),_this.currentRow<i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i==cnt&&_this.currentRow!=i&&(_this.currentRow=first),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 38:"none"==_this.RESULT.style.display&&(_this.RESULT.style.display="block");var last=-1;for(i=cnt-1;i>=0;i--)if(!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){if(-1==last&&(last=i),_this.currentRow>i){_this.currentRow=i;break}"title-search-selected"==tbl.rows[i].className&&(tbl.rows[i].className="")}return i<0&&_this.currentRow!=i&&(_this.currentRow=last),tbl.rows[_this.currentRow].className="title-search-selected",!0;case 13:if("block"==_this.RESULT.style.display)for(i=0;i<cnt;i++)if(_this.currentRow==i&&!BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)){var a=BX.findChild(tbl.rows[i],{tag:"a"},!0);if(a)return window.location=a.href,!0}return!1}return!1},this.onTimeout=function(){_this.onChange((function(){setTimeout(_this.onTimeout,500)}))},this.onChange=function(callback){if(_this.running)_this.needRunAgain=!0;else{if(_this.running=!0,_this.INPUT.value!=_this.oldValue&&_this.INPUT.value!=_this.startText)if(_this.oldValue=_this.INPUT.value,_this.INPUT.value.length>=_this.arParams.MIN_QUERY_LEN){if(_this.cache_key=_this.arParams.INPUT_ID+"|"+_this.INPUT.value,null==_this.cache[_this.cache_key]){if(_this.WAIT){var pos=BX.pos(_this.INPUT),height=pos.bottom-pos.top-2;_this.WAIT.style.top=pos.top+1+"px",_this.WAIT.style.height=height+"px",_this.WAIT.style.width=height+"px",_this.WAIT.style.left=pos.right-height+2+"px",_this.WAIT.style.display="block"}return void BX.ajax.post(_this.arParams.AJAX_PAGE,{ajax_call:"y",INPUT_ID:_this.arParams.INPUT_ID_TMP,q:_this.INPUT.value,l:_this.arParams.MIN_QUERY_LEN},(function(result){_this.cache[_this.cache_key]=result,_this.ShowResult(result),_this.currentRow=-1,_this.EnableMouseEvents(),_this.WAIT&&(_this.WAIT.style.display="none"),callback&&callback(),_this.running=!1,_this.needRunAgain&&(_this.needRunAgain=!1,_this.onChange(callback))}))}_this.ShowResult(_this.cache[_this.cache_key]),_this.currentRow=-1,_this.EnableMouseEvents()}else _this.RESULT.style.display="none",_this.currentRow=-1,_this.UnSelectAll();callback&&callback(),_this.running=!1}},this.UnSelectAll=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)tbl.rows[i].className=""},this.EnableMouseEvents=function(){var tbl=BX.findChild(_this.RESULT,{tag:"table",class:"title-search-result"},!0);if(tbl)for(var cnt=tbl.rows.length,i=0;i<cnt;i++)BX.findChild(tbl.rows[i],{class:"title-search-separator"},!0)||(tbl.rows[i].id="row_"+i,tbl.rows[i].onmouseover=function(e){_this.currentRow!=this.id.substr(4)&&(_this.UnSelectAll(),this.className="title-search-selected",_this.currentRow=this.id.substr(4))},tbl.rows[i].onmouseout=function(e){this.className="",_this.currentRow=-1})},this.onFocusLost=function(hide){setTimeout((function(){_this.RESULT.style.display="none"}),30)},this.onFocusGain=function(){_this.RESULT.innerHTML.length&&_this.ShowResult()},this.onKeyDown=function(e){if(e||(e=window.event),"block"==_this.RESULT.style.display&&_this.onKeyPress(e.keyCode))return BX.PreventDefault(e)}
1,this.adjustResultNode=function(){var pos,pos_input,fixedParent=BX.findParent(_this.CONTAINER,BX.is_fixed);return fixedParent?(_this.RESULT.style.position="fixed",_this.RESULT.style.zIndex=BX.style(fixedParent,"z-index")+2,pos=BX.pos(_this.CONTAINER,!0)):(_this.RESULT.style.position="absolute",pos=BX.pos(_this.CONTAINER)),pos_input=BX.pos(_this.INPUT),pos.width=pos.right-pos.left,_this.RESULT.style.top=pos.bottom+2+"px",_this.RESULT.style.left=pos_input.left+"px",$(_this.INPUT).closest(".inline-search-block.with-close").length?_this.RESULT.style.width=pos_input.width+"px":_this.RESULT.style.width=pos.width+"px",pos},this._onContainerLayoutChange=function(){"none"!==_this.RESULT.style.display&&""!==_this.RESULT.innerHTML&&_this.adjustResultNode()},this.Init=function(){this.CONTAINER=document.getElementById(this.arParams.CONTAINER_ID),BX.addCustomEvent(this.CONTAINER,"OnNodeLayoutChange",this._onContainerLayoutChange),this.RESULT=document.body.appendChild(document.createElement("DIV")),this.RESULT.className="title-search-result "+this.arParams.INPUT_ID,this.INPUT=document.getElementById(this.arParams.INPUT_ID),this.startText=this.oldValue=this.INPUT.value,BX.bind(this.INPUT,"focus",(function(e){_this.onFocusGain()})),BX.bind(this.INPUT,"blur",(function(e){$(e.relatedTarget).closest(".searche-result").length||_this.onFocusLost()})),BX.browser.IsSafari()||BX.browser.IsIE()?this.INPUT.onkeydown=this.onKeyDown:this.INPUT.onkeypress=this.onKeyDown,this.arParams.WAIT_IMAGE&&(this.WAIT=document.body.appendChild(document.createElement("DIV")),this.WAIT.style.backgroundImage="url('"+this.arParams.WAIT_IMAGE+"')",BX.browser.IsIE()||(this.WAIT.style.backgroundRepeat="none"),this.WAIT.style.display="none",this.WAIT.style.position="absolute",this.WAIT.style.zIndex="1100"),BX.bind(this.INPUT,"bxchange",(function(e){_this.onChange()}))},BX.ready((function(){_this.Init(arParams)}))}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.