
vjo.ctype("vjo.darwin.domain.finding.pagesize.PageSizeChangeDetector").needs(["vjo.dsf.cookie.VjCookieJar","vjo.dsf.document.Positioning","vjo.dsf.utils.Handlers","vjo.dsf.client.Browser","vjo.darwin.domain.finding.ajax.AjaxUtils"]).protos({CookieJar:vjo.dsf.cookie.VjCookieJar,AjaxUtils:vjo.darwin.domain.finding.ajax.AjaxUtils,Handlers:vjo.dsf.utils.Handlers,constructs:function(_1){this.model=_1;this.explorer=(this.vj$.Browser.bIE&&(this.vj$.Browser.iVer<7));this.layout=_1.layouts[_1.currentLayout];this.curLayout=this.layout;this.container=document.getElementById(_1.pageContainer);this.centercontainer=document.getElementById(_1.centerContainer);this.rightWidth=0;this.AjaxUtils.registerObject(this,document.body);this.AjaxUtils.addEventHandler(this,window,"resize",this.onResize);this.Handlers.attachSvcReqt("ADD_RIGHT_COLUMN",this.onAddRightColumn,this);this.AjaxUtils.addRequestHandler(this,this.getLayout,"Page.Layout");this.onResize();},onResize:function(_2){with(this){var _3=vjo.dsf.document.Positioning.getClientWidth();if((_3<layout.minWidth)||(_3>layout.maxWidth)){setLayout(_3);}
if(container&&explorer){setWidth(curLayout,_3);}}},onAddRightColumn:function(_4){this.rightWidth=this.model.rightColumnWidth;this.onResize();},getLayout:function(_5){_5.layout=this.layout.key;},setLayout:function(_6){with(this.model){for(var _7=layouts.length-1;((_7>0)&&(_6<layouts[_7].minWidth));_7--){}
this.layout=(_7>=0)?layouts[_7]:layouts[defaultLayout];var _8=this.CookieJar.readCookie(cookieName,cookieletName).match(/(#)?([0-9a-f]*)/i);var _9="#".concat(_8[1]?_8[2]:parseInt(_8[2]?_8[2]:"0",10).toString(16));var _a=cookieBits.length;for(var _b=0,bits=this.layout.key;(_b<_a);_b++,bits>>=1){_9=this.CookieJar.setBitFlag(_9,cookieBits[_b],bits&1);}
this.CookieJar.writeCookielet(cookieName,cookieletName,_9);}},setWidth:function(_c,_d){with(this.model){var _e=(overrideMinWidth||(_c.minWidth==0))?minPxLayout:_c.minWidth;var _f=0;if(_d<_e){_f=_e;}else{if(_d>maxPxLayout){_f=maxPxLayout;}else{_f=(_d-30);}}
this.container.style.width=_f+"px";if(leftColumnWidth>0||this.rightWidth>0){this.centercontainer.style.width=(_f-leftColumnWidth-this.rightWidth-6)+"px";this.centercontainer.style.overflow="hidden";}}}}).endType();
vjo.ctype("vjo.darwin.domain.finding.page.PageRTMHandler").needs("vjo.dsf.ServiceEngine").props({style:"",elementId:"",rtmPlacementIds:[]}).protos({constructs:function(_1){var t=this;t.style=_1.style;t.elementId=_1.elementId;t.rtmPlacementIds=_1.rtmPlacementIds;vjo.dsf.ServiceEngine.registerSvcReqtHdl("RTM_COMPLETE",this);},handleRequest:function(_3){var t=this;var _5=_3.vjRTMObject.aContent;var _6=-1;var _7=t.rtmPlacementIds.length;for(i=0;i<_7;i++){var _8=_5.length;for(j=0;j<_8;j++){if(t.rtmPlacementIds[i]==parseInt(_5[j].id)&&_5[j].content!=""){_6=j;break;}}
if(_6>=0){break;}}
if(_6>=0){var _9=document.getElementById(t.elementId);if(_9!==null&&_9!="unknown"){_9.className+=" "+t.style;if(vjo.dsf.client.Browser.bIE){this.vj$.ServiceEngine.handleRequest(new vjo.dsf.Message("ADD_RIGHT_COLUMN"));}}}}}).endType();
vjo.ctype("vjo.darwin.domain.finding.findstore.FindStore").needs(["vjo.dsf.Element","vjo.dsf.EventDispatcher","vjo.dsf.window.utils.VjWindowUtils","vjo.dsf.client.Browser"]).protos({constructs:function(_1){this.model=_1;this.firstCall=true;this.vED=vjo.dsf.EventDispatcher;this.vWu=vjo.dsf.window.utils.VjWindowUtils;this.E=vjo.dsf.Element;this.vED.addEventListener(window,"load",this.init,this);},init:function(){this.trigger=this.E.get(this.model.catsTrigId);this.nameRadio=this.E.get(this.model.nameRadioId);this.itemRadio=this.E.get(this.model.itemRadioId);this.form=this.E.get(this.model.formId);var _2=this;if(this.model.catsList&&this.model.catsList.length>0){this.vED.addEventListener(this.trigger,"mouseover",this.showCatsMenu,this);this.vED.addEventListener(this.trigger,"mouseout",this.hideCatsMenu,this);}
this.vED.addEventListener(this.form,"submit",this.onSubmit,this);},onSubmit:function(_3){if(this.nameRadio.checked){this.form.action=this.model.nameSearchBaseUrl;}else{this.form.action=this.model.itemSearchBaseUrl;}
this.form.submit();},showCatsMenu:function(){if(this.firstCall){this.buildCats(this.model.catsList);document.body.appendChild(this.menuDiv);this.f1.style.width=(this.menuWrapper.offsetWidth-2)+"px";this.firstCall=false;}else{this.menuDiv.style.display="block";}
this.calPosition();for(var i=0;i<3;i++){this.ulList[i].style.width=this.ulList[i].offsetWidth+"px";}},hideCatsMenu:function(){this.menuDiv.style.display="none";},calPosition:function(){var _5=vjo.dsf.client.Browser.bFirefox?20:-15;var _6=vjo.dsf.client.Browser.bFirefox?0:-3;this.menuDiv.style.top=this.vWu.offsetTop(this.trigger)+_5+"px";this.menuDiv.style.left=this.vWu.offsetLeft(this.trigger)+_6+"px";},buildCats:function(_7){var _8=_7.length;var _9=Math.ceil(_8/3);this.ulList=[];var i=0;var _b;this.menuDiv=document.createElement("div");this.menuDiv.className="catsMu";this.menuWrapper=document.createElement("div");for(var _c=1;_c<=3;_c++){if(_c==3){_b=_7.slice(i,_8);}else{_b=_7.slice(i,_9*_c);}
i=_9*_c;var ul=this.buildUl(_b);this.menuWrapper.appendChild(ul);this.ulList.push(ul);}
var _e=document.createElement("div");_e.style.clear="both";this.menuWrapper.appendChild(_e);this.menuWrapper.className="catsMuDiv";this.menuDiv.appendChild(this.menuWrapper);this.vED.addEventListener(this.menuDiv,"mouseover",this.showCatsMenu,this);this.vED.addEventListener(this.menuDiv,"mouseout",this.hideCatsMenu,this);this.menuDiv.appendChild(this.buildFooter());return this.menuDiv;},buildUl:function(_f){var ul=document.createElement("ul");var _11=_f.length;for(var j=0;j<_11;j++){var li=document.createElement("li");var a=document.createElement("a");a.href=_f[j].url;a.appendChild(document.createTextNode(_f[j].title));li.appendChild(a);ul.appendChild(li);}
return ul;},buildFooter:function(){this.f1=document.createElement("div");var f2=document.createElement("div");var f3=document.createElement("div");this.f1.className="f1";f2.className="f2";f3.className="f3";f2.appendChild(f3);this.f1.appendChild(f2);return this.f1;}}).endType();
vjo.ctype("vjo.darwin.core.searchbox.EbaySearchBox").needs("vjo.dsf.Element").needs("vjo.dsf.utils.Timer").protos({textBoxId:null,buttonId:null,buttonInitiallyDisabled:false,constructs:function(_1,_2,_3){this.textBoxId=_1;this.buttonId=_2;this.buttonInitiallyDisabled=_3;if(this.buttonInitiallyDisabled){this.updateButton();}
return this;},clearTextBox:function(){var _4=vjo.dsf.Element.get(this.textBoxId);var _5=vjo.dsf.Element.get(this.buttonId);if(_4.defaultValue==_4.value){_4.value="";}},updateButton:function(){var _6=vjo.dsf.Element.get(this.buttonId);var _7=vjo.dsf.Element.get(this.textBoxId);if(_6!==null&&_7!==null){if(this.buttonInitiallyDisabled&&(_7.defaultValue==_7.value)){_6.disabled=true;}else{_6.disabled=(_7.value.replace(/\s/g,"").length<1);}}}}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFillEncoder").protos({aCharList:[[new RegExp("[%]","g"),"_"],[new RegExp("[.]","g"),"_2e"],[new RegExp("[+]","g"),"_2b"],[new RegExp("[']","g"),"_27"]],pseudoDiv:null,constructs:function(){this.pseudoDiv=document.createElement("div");},encode:function(_1){var _2=encodeURIComponent(_1),t=this;for(var j=0;j<t.aCharList.length;j++){var _4=t.aCharList[j];_2=_2.replace(_4[0],_4[1]);}
return _2;},decodeCookie:function(_5){var _6=_5||"";_6=_6.replace(new RegExp("[+]","g")," ");_6=decodeURIComponent(_6);return _6;},encodeHTML:function(_7){var e=this.pseudoDiv;if(typeof(e.textContent)!="undefined"){e.textContent=_7;}else{e.innerText=_7;}
return e.innerHTML;}}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFillConfig").needs("vjo.darwin.domain.finding.autofill.AutoFillEncoder").protos({oModel:{"rootDir":"autofill","listSize":7,"delayTime":200,"dirDepth":3,"noSugShowTime":1500,"svcIn":"SVC_GH_IN","svcOut":"SVC_GH_OUT"},defaultAlgo:"1",algoMap:{"1":"f","2":"a"},widthDef:{"unit":9,"min":{"px":233,"char":26},"max":{"px":400,"char":40}},oEncoder:null,constructs:function(_1){this.oEncoder=new vjo.darwin.domain.finding.autofill.AutoFillEncoder();this.loadConfig(_1);},loadConfig:function(_2){var t=this,tM=t.oModel;if(_2.version===null||_2.algorithm===null){tM.version=_2.algoVerMap[t.defaultAlgo];tM.algorithm=t.algoMap[t.defaultAlgo];}else{tM.version=_2.version;tM.algorithm=t.algoMap[_2.algorithm];}
tM.trkSuggest=_2.trkSuggest;tM.trkRS=_2.trkRS;tM.trkInput=_2.trkInput;tM.trkShow=_2.trkShow;tM.trkHide=_2.trkHide;tM.containerId=_2.containerId;tM.idList=_2.idList;tM.sugDivId=_2.sugDivId;tM.noSugDivId=_2.noSugDivId;tM.hideLnkList=_2.hideLnkList;tM.baseURL=_2.baseURL;tM.siteId=_2.siteId;tM.lastSearch=t.oEncoder.decodeCookie(_2.lastSearch);tM.svcIn=_2.svcIn;tM.svcOut=_2.svcOut;},updateWidthDef:function(_4){var t=this,inputWidth=parseInt(_4.offsetWidth,10);t.widthDef.max={"px":inputWidth,"char":Math.floor(inputWidth/t.widthDef.unit)-1};},getHideLnkList:function(){return this.oModel.hideLnkList;},getWidthUnit:function(){return this.widthDef.unit;},getWidthMin:function(){return this.widthDef.min;},getWidthMax:function(){return this.widthDef.max;},getRootDir:function(){return this.oModel.rootDir;},getListSize:function(){return this.oModel.listSize;},getDelayTime:function(){return this.oModel.delayTime;},getDirDepth:function(){return this.oModel.dirDepth;},getAlgorithm:function(){return this.oModel.algorithm;},getVersion:function(){return this.oModel.version;},getTrkSuggest:function(){return this.oModel.trkSuggest;},getTrkRS:function(){return this.oModel.trkRS;},getTrkInput:function(){return this.oModel.trkInput;},getTrkShow:function(){return this.oModel.trkShow;},getTrkHide:function(){return this.oModel.trkHide;},getContainerId:function(){return this.oModel.containerId;},getIdList:function(){return this.oModel.idList;},getKeyUpSvc:function(){return this.oModel.keyUpSvc;},getKeyDownSvc:function(){return this.oModel.keyDownSvc;},getInputOverSvc:function(){return this.oModel.inputOverSvc;},getUpdInputSvc:function(){return this.oModel.updInputSvc;},getFillContentSvc:function(){return this.oModel.fillContentSvc;},getInSvc:function(){return this.oModel.svcIn;},getOutSvc:function(){return this.oModel.svcOut;},getBaseURL:function(){return this.oModel.baseURL;},getSiteId:function(){return this.oModel.siteId;},getSugDivId:function(){return this.oModel.sugDivId;},getNoSugDivId:function(){return this.oModel.noSugDivId;},getNoSugShowTime:function(){return this.oModel.noSugShowTime;},getLastSearch:function(){return this.oModel.lastSearch;}}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFillCache").needs("vjo.darwin.domain.finding.autofill.AutoFillEncoder").protos({oCache:{},oIndex:{},oReference:{},oLeaf:{},oEncoder:null,UN:"undefined",TNU:"number",constructs:function(){this.oEncoder=new vjo.darwin.domain.finding.autofill.AutoFillEncoder();},add:function(_1){try{var t=this,kw=_1[0],kwList=_1[1],laList=_1[2],cacheItem=t.oCache[kw];if(_1.length>=3){t.addItem(kw,kw,"k",kwList);}else{try{if(typeof(kwList[0])=="string"){laList=null;t.addItem(kw,kw,"k",kwList);}else{if(typeof(kwList[0])=="object"&&(kwList[0]instanceof Array)){laList=_1[1];}}}
catch(err){laList=null;}}
if(laList!==null){for(var i=0;i<laList.length;i++){var _4=laList[i],lookAheadKw=kw+_4[0],lookAheadType=_4[1],lookAheadList=_4[2];if(typeof(lookAheadList)==t.UN||lookAheadList===null){lookAheadType="fd";lookAheadList=_4[0];}
t.addItem(lookAheadKw,kw,lookAheadType,lookAheadList);}}else{t.addItem(kw,kw,"null");}}
catch(e){}},addItem:function(_5,_6,_7,_8){var t=this;_5=_5.toLowerCase();_6=_6.toLowerCase();if(_7=="k"){t.oCache[_5]=t.buildItem("k",(typeof(_8)==t.TNU)?(""+_8):_8,_6);return t.oCache[_5];}else{if(_7=="f"){t.oIndex[_5]=t.buildItem("f",(typeof(_8)==t.TNU)?(""+_8):_8,_6);return t.oIndex[_5];}else{if(_7=="fd"){t.oReference[_5]=t.buildItem("fd",_8,_6);return t.oReference[_5];}else{if(_7=="null"){t.oLeaf[_5]=t.buildItem("null",null,_6);return t.oLeaf[_5];}}}}},buildItem:function(_a,_b,_c){var _d={"type":_a,"shortPrefix":_c};if(_b!==null){_d.keyword=_b;}
return _d;},get:function(_e,_f){_e=_e.toLowerCase();_f=_f.toLowerCase();var t=this,cacheItem=t.oCache[_e],indexItem=t.oIndex[_e],referenceItem=t.oReference[_e];if(typeof(cacheItem)!=t.UN&&typeof(cacheItem)!=t.TFU){return cacheItem;}
if(typeof(indexItem)!=t.UN&&typeof(indexItem)!=t.TFU){return indexItem;}
if(typeof(referenceItem)!=t.UN&&typeof(referenceItem)!=t.TFU){return referenceItem;}
if(_f){var _11=t.oLeaf[_f];if(typeof(_11)!=t.UN&&typeof(_11)!=t.TFU){return _11;}
var _12=[];for(var _13 in t.oIndex){var _14=t.oIndex[_13];if(_14.shortPrefix==_f){_12.push(_13);}}
_12.sort();if(_12.length===0){return null;}
var _15=_12.length-1;for(i=0;i<_12.length;i++){if(_e<_12[i]){_15=i-1;break;}}
if(_15<0){_15=0;}
return t.oIndex[_12[_15]];}
return null;}}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFillRequest").needs("vjo.dsf.XDomainRequest").needs("vjo.Registry").needs("vjo.dsf.utils.Object").needs("vjo.dsf.utils.Handlers").needs("vjo.dsf.utils.Timer").needs("vjo.dsf.Element").needs("vjo.darwin.domain.finding.autofill.AutoFillCache").needs("vjo.darwin.domain.finding.autofill.AutoFillEncoder").singleton().protos({aReqList:[],oCache:null,oConfig:{"baseURL":null,"dirDepth":null,"rootDir":null,"algorithm":null,"version":null,"siteId":null},oEncoder:null,sRespSvc:"autofill_response",iTimeout:1000,iProcessInterval:20,oProcessTimer:null,inProcess:false,bInit:false,vX:vjo.dsf.XDomainRequest,uN:"undefined",constructs:function(){},init:function(_1){var t=this;if(t.bInit){return;}
var tO=t.oConfig;tO.baseURL=_1.baseURL;tO.dirDepth=_1.dirDepth;tO.rootDir=_1.rootDir;tO.algorithm=_1.algorithm;tO.version=_1.version;tO.siteId=_1.siteId;t.oCache=new vjo.darwin.domain.finding.autofill.AutoFillCache();t.oEncoder=new vjo.darwin.domain.finding.autofill.AutoFillEncoder();t.oProcessTimer=new vjo.dsf.utils.Timer();t.oProcessTimer.setInterval(t.iProcessInterval);t.oProcessTimer.onTick=function(){if(t.inProcess){return;}
t.inProcess=true;try{t.processQue();t.cleanQue();}
catch(e){}
t.inProcess=false;};t.oProcessTimer.start();t.bInit=true;},processQue:function(){var t=this,queLength=t.aReqList.length;if(queLength===0){return;}
var _5=t.aReqList[0];if(_5&&(_5.state=="wait")){t.aReqList[0].state="process";var _6=t.vX.bUseIframe;try{t.vX.bUseIframe=false;var _7=t.vX.send(_5.url,false);t.aReqList[0].scriptId=_7;}
catch(e){}
t.vX.bUseIframe=_6;}},cleanQue:function(){var t=this,newList=[],i;for(i=0;i<t.aReqList.length;i++){var _9=t.aReqList[i];if(_9.state=="wait"){newList.push(_9);}else{if(_9.state=="process"){var _a=new Date(),time=_a.getTime()-_9.timestamp;if(time>=t.iTimeout){t.removeScriptTag(_9.scriptId);t.sendRespService(true,_9.requester,_9.prefix,null,null,_9.shortPrefix);}else{newList.push(_9);}}}}
t.aReqList=newList;},removeScriptTag:function(_b){var t=this;if(_b&&_b.length>0){var _d=vjo.dsf.Element.get(_b),scriptLoc=t.vX.getReqDiv();if(scriptLoc&&_d){scriptLoc.removeChild(_d);}}},getRespSvc:function(){return this.sRespSvc;},getShortPrefix:function(_e){var t=this,dirDepth=t.oConfig.dirDepth,shortPrefix=_e.substr(0,dirDepth+1);return shortPrefix;},buildPath:function(pKw,_11){var t=this,pd=_11?10000:t.oConfig.dirDepth,pathStr=pKw.length>pd?pKw.substr(0,pd):pKw.substr(0,pKw.length-1),fileStr=pKw.length>pd?pKw.substr(pd,1):pKw.substr(pKw.length-1,1),encodedPathStr="";var _13=pathStr.toLowerCase(),lowFileStr=fileStr.toLowerCase();for(var i=0;i<_13.length;i++){encodedPathStr+=t.encodeChar(_13.charAt(i))+"/";}
return[encodedPathStr,t.encodeChar(lowFileStr),pathStr+fileStr];},encodeChar:function(_15){return this.oEncoder.encode(_15);},buildURL:function(){var t=this,tO=t.oConfig,url=tO.baseURL;if(typeof(tO.version)==t.uN||tO.version===null){return null;}
if(url.lastIndexOf("/")<url.length-1){url+="/";}
url+=tO.rootDir+"/";url+=tO.algorithm+"/";url+=tO.siteId+"/";url+=tO.version+"/";return url;},addRequest:function(_17,_18,_19,_1a){var t=this,url=t.buildURL(),fileInfo=t.buildPath(_18,(_19=="fd"));if(url===null){return;}
if(url.lastIndexOf("/")<url.length-1){url+="/";}
url+=fileInfo[0]+fileInfo[1];if(_19=="f"&&typeof(_1a)!=t.uN&&_1a.length>0){url+=_1a;}
url+=".js";var _1c=new Date();t.aReqList.push({"requester":_17,"prefix":_18,"shortPrefix":t.getShortPrefix(_18),"url":url,"state":"wait","timestamp":_1c.getTime(),"type":_19});},send:function(_1d,_1e){var t=this;if(!t.bInit){return;}
var _20=t.getShortPrefix(_1e),cacheResp=t.oCache.get(_1e,_20);if(cacheResp===null){t.addRequest(_1d,_1e,"k");}else{if(cacheResp.type=="f"||cacheResp.type=="fd"){t.addRequest(_1d,_1e,cacheResp.type,cacheResp.keyword);}else{if(cacheResp.type=="null"){t.sendRespService(true,_1d,_1e,[],[],_20);}else{t.sendRespService(false,_1d,_1e,cacheResp.keyword,[],_20);}}}},sendRespService:function(_21,_22,_23,_24,_25,_26){var H=vjo.dsf.utils.Handlers,m=H.newMsg(this.sRespSvc);if(_21){m.clientContext={"timeout":true,"prefix":_23,"shortPrefix":_26,"requestId":_22};}else{m.clientContext={"timeout":false,"prefix":_23,"shortPrefix":_26,"requestId":_22,"kwList":_24,"laList":_25};}
H.handle(m);},handleResponse:function(_28){var t=this,kw=_28[0],kwList=_28[1],laList=_28[2],i;if(!t.bInit){return;}
t.oCache.add(_28);var _2a=[];for(i=0;i<t.aReqList.length;i++){var _2b=t.aReqList[i];if(_2b.state!="process"){continue;}
if(_2b.prefix.toLowerCase()==_2b.shortPrefix.toLowerCase()){if(_2b.prefix.toLowerCase()==kw.toLowerCase()){_2b.state="done";t.removeScriptTag(_2b.scriptId);t.sendRespService(false,_2b.requester,kw,kwList,laList,_2b.shortPrefix);}}else{if(_2b.shortPrefix.toLowerCase()==kw.toLowerCase()){var _2c=t.oCache.get(_2b.prefix,_2b.shortPrefix);_2b.state="done";t.removeScriptTag(_2b.scriptId);if(_2b.type=="f"&&_2c.type!="k"){t.sendRespService(true,_2b.requester,_2b.prefix,null,null,_2b.shortPrefix);}else{_2a.push(_2b);}}}}
for(i=0;i<_2a.length;i++){var _2d=_2a[i];t.send(_2d.requester,_2d.prefix);}}}).inits(function(){vjo.darwin.domain.finding.autofill.AutoFillRequest=new vjo.darwin.domain.finding.autofill.AutoFillRequest();}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFill").needs("vjo.dsf.ServiceEngine").needs("vjo.Registry").needs("vjo.dsf.Element").needs("vjo.dsf.Message").needs("vjo.dsf.document.Shim").needs("vjo.dsf.utils.Handlers").needs("vjo.dsf.cookie.VjCookieJar").needs("vjo.darwin.domain.finding.autofill.AutoFillRequest").needs("vjo.darwin.domain.finding.autofill.AutoFillEncoder").props({_do:function(_1){vjo.darwin.domain.finding.autofill.AutoFillRequest.handleResponse(_1);}}).protos({oConfig:null,oKeyTimer:null,sCurKw:"",sLastKw:"",iCurSel:-1,aCurKwList:[],bInSugDiv:false,sInputId:null,oIframeShim:null,oRequest:vjo.darwin.domain.finding.autofill.AutoFillRequest,sRequestId:"autofill",bLastQueryEmpty:false,oEncoder:new vjo.darwin.domain.finding.autofill.AutoFillEncoder(),VE:vjo.dsf.Element,VED:vjo.dsf.EventDispatcher,VS:vjo.dsf.ServiceEngine,constructs:function(_2,_3){var t=this,vEvt=t.VED,vS=t.VS;t.sRequestId=_3;t.oConfig=_2;vS.registerSvcHdl(t.oRequest.getRespSvc(),vjo.hitch(t,t.handleResp));vEvt.add(_2.getContainerId(),"mouseover",vjo.hitch(t,this.onMouseIn));vEvt.add(_2.getContainerId(),"mouseout",vjo.hitch(t,this.onMouseOut));vEvt.addEventListener(window,"resize",t.onWindowResize,t);var _5=_2.getIdList(),i,id;_5=_2.getHideLnkList();for(i=0;i<_5.length;i++){id=_5[i];vEvt.add(id,"click",vjo.hitch(t,this.onHideClick));}
vS.registerSvcHdl(_2.getOutSvc(),function(_6){var _7=_6.clientContext;t.setInputId(_7.srcId);switch(_7.type){case"kw_keyup":t.kw_keyup(_7);break;case"kw_blur":t.kw_blur(_7);break;case"kw_keydown":t.kw_keydown(_7);break;case"kw_mouseover":t.kw_mouseover(_7);break;case"show_click":t.show_click(_7);break;}});t.updTrk(_2.getTrkInput());t.setAutoComplete(t.isHideSuggestion());},handleResp:function(_8){var t=this,config=t.oConfig,context=_8.clientContext,i,kwList=context.kwList||[],laList=context.laList||[];if(t.sRequestId!=context.requestId||context.prefix.toLowerCase()!=t.getInputValue().toLowerCase()){return;}
var _a=t.getRecentSearch();if(_a&&_a.length>0){var _b=_a.toLowerCase(),index=_b.indexOf(t.sCurKw.toLowerCase()),bRecentMatch=false,sRecentPart=_b,preIndex=0;while(index>=0){if(t.isWordStart(_b,index+preIndex)){bRecentMatch=true;break;}
preIndex=index+1;sRecentPart=sRecentPart.substr(index+1);index=sRecentPart.indexOf(t.sCurKw.toLowerCase());}
if(bRecentMatch){var _c=[];_c.push(_a);for(i=0;i<kwList.length;i++){if(kwList[i].toLowerCase()!=_b){_c.push(kwList[i]);}}
if(_c.length>config.getListSize()){_c.pop();}
kwList=_c;}}
if(context.timeout&&(context.prefix==t.sCurKw)&&kwList.length<1){if(!t.bLastQueryEmpty){t.showNoSugMessage(true);t.showSugDiv(true,config.getWidthMin().px);}else{t.showSugDiv(false);}
t.bLastQueryEmpty=true;return;}
t.bLastQueryEmpty=false;t.showNoSugMessage(false);t.iCurSel=-1;t.aCurKwList=[];var _d=config.getIdList(),listLength=_d.length;if(listLength>config.getListSize()){listLength=config.getListSize();}
if(t.sInputId!==null){var _e=t.VE.get(t.sInputId);if(_e){config.updateWidthDef(_e);}}
var _f=t.getMaxKwLength(kwList,listLength),clipLength=config.getWidthMax()["char"],dispPx=_f*config.getWidthUnit();if(dispPx<config.getWidthMin().px){dispPx=config.getWidthMin().px;}else{if(dispPx>config.getWidthMax().px){dispPx=config.getWidthMax().px;}}
for(i=0;i<listLength;i++){var en=_d[i],e=t.VE.get(en);if(e===null){continue;}
e.className="unsel";if(i<kwList.length){e.innerHTML=t.genKwHTML(kwList[i],t.sCurKw,clipLength);t.VE.toggleHideShow(en,true);var trk=(kwList[i]==_a)?config.getTrkRS():config.getTrkSuggest();t.aCurKwList[i]={"divId":en,"sugKw":kwList[i],"trk":trk};}else{t.VE.toggleHideShow(en,false);}}
t.showSugDiv(true,dispPx);},getInputValue:function(){var t=this,e=t.VE.get(t.sInputId);return e?e.value:"";},isHideSuggestion:function(){var vC=vjo.dsf.cookie.VjCookieJar,pbf=vC.readCookie("dp1","pbf"),bit=vC.getBitFlag(pbf,29);return bit==1;},setHideSuggestion:function(_14){var vC=vjo.dsf.cookie.VjCookieJar,pbf=vC.readCookie("dp1","pbf");vC.writeCookielet("dp1","pbf",vC.setBitFlag(pbf,29,_14?1:0));},getRecentSearch:function(){var lss=this.oConfig.getLastSearch();if(lss!==null&&lss.length>0){lss=lss.substring(lss.indexOf(".")+1);return lss;}
return"";},getMaxKwLength:function(_17,_18){if(!_17){return 0;}
var max=0,length=_17.length;if(length>_18){length=_18;}
for(var i=0;i<_17.length;i++){var len=_17[i].length;if(len>max){max=len;}}
return max;},isWordStart:function(pKw,_1d){if(_1d<=0||_1d>pKw.length-1){return true;}
var _1e=pKw.substr(_1d-1,1),wordDelimiter=new RegExp("[\\s \\.,]");return _1e.search(wordDelimiter)>=0;},genKwHTML:function(pKw,_20,_21){var _22=_20.length,out=pKw,t=this,encoder=t.oEncoder,part,startIndex=-1;for(var i=0;i<pKw.length;i++){part=pKw.substr(i,_22);if(part.length!=_22){break;}
if(part.toLowerCase()==_20.toLowerCase()&&t.isWordStart(pKw,i)){startIndex=i;break;}}
var _24=pKw.substring(0,startIndex),afterPart=pKw.substr(startIndex+_22),keepLength;if(startIndex>=0){if(pKw.length>_21){if(_24.length>_21){out=encoder.encodeHTML(out.substr(0,_21));out+="...";}else{if((_24.length+part.length)>_21){keepLength=_21-_24.length;part="<span class='hl'>"+encoder.encodeHTML(part.substr(0,keepLength))+"...</span>";out=encoder.encodeHTML(_24)+part;}else{keepLength=_21-_24.length-part.length;out=encoder.encodeHTML(_24)+"<span class='hl'>"+encoder.encodeHTML(part)+"</span>"+encoder.encodeHTML(afterPart.substr(0,keepLength))+"...";}}}else{out=encoder.encodeHTML(_24)+"<span class='hl'>"+encoder.encodeHTML(part)+"</span>"+encoder.encodeHTML(afterPart);}}else{if(pKw.length>_21){out=encoder.encodeHTML(out.substr(0,_21));out+="...";}}
return out;},startKeyTimer:function(_25){var t=this;t.stopKeyTimer();var _27=function(){var _28=t.getInputValue();if(_25!=_28||_28.length<1){return;}
t.oRequest.send(t.sRequestId,_25);};t.oKeyTimer=window.setTimeout(_27,t.oConfig.getDelayTime());},stopKeyTimer:function(){var t=this;if(t.oKeyTimer!==null){window.clearTimeout(t.oKeyTimer);t.oKeyTimer=null;}},getKwSelect:function(){var t=this;if(t.iCurSel<0){return t.sCurKw;}
return t.aCurKwList[t.iCurSel].sugKw;},selectSug:function(_2b,_2c,_2d){var t=this,kw=t.sCurKw;if(t.iCurSel>=0){t.unselectSug(t.aCurKwList[t.iCurSel].divId);}
if(_2b!==null){var e=t.VE.get(_2b);for(var i=0;i<t.aCurKwList.length;i++){var _31=t.aCurKwList[i];if(_31.divId==_2b){t.iCurSel=i;kw=_31.sugKw;break;}}
if(e){e.className="sel";}}else{t.iCurSel=-1;}
if(!_2d){t.updateInput(kw);}
if(!_2c){t.focusInput();}},unselectSug:function(_32){var t=this,e=t.VE.get(_32);if(e){e.className="unsel";}},createTrackingImg:function(_34){var _35=new Date(),r=_35.getTime(),imgUrl=_34;if(imgUrl.indexOf("?")>0){imgUrl+="&"+r;}else{imgUrl+="?"+r;}
var img=new Image(),bodyLoc=document.getElementsByTagName("body")[0];bodyLoc.appendChild(img);img.setAttribute("src",imgUrl);img.setAttribute("width","1");img.setAttribute("height","1");img.setAttribute("border","0");},sendInSvc:function(_37){var H=vjo.dsf.utils.Handlers,m=H.newMsg(this.oConfig.getInSvc());m.clientContext=_37;H.handle(m);},isCtrlKey:function(_39){var _3a=[38,39,40,27];for(var i=0;i<_3a.length;i++){if(_3a[i]==_39){return true;}}
return false;},isIgnorKey:function(_3c){var _3d=[16,17,18];for(var i=0;i<_3d.length;i++){if(_3c==_3d[i]){return true;}}
return false;},isSugShown:function(){var t=this,sugDiv=t.VE.get(this.oConfig.getContainerId());disp=sugDiv.currentStyle?sugDiv.currentStyle.display:window.getComputedStyle(sugDiv,null).getPropertyValue("display");return(disp!="none");},isNoSugMsgShow:function(){var t=this,noSuggestionMessage=t.VE.get(this.oConfig.getNoSugDivId());disp=noSuggestionMessage.currentStyle?noSuggestionMessage.currentStyle.display:window.getComputedStyle(noSuggestionMessage,null).getPropertyValue("display");return(disp!="none");},showNoSugMessage:function(_41){var t=this;t.VE.toggleHideShow(t.oConfig.getSugDivId(),!_41);t.VE.toggleHideShow(t.oConfig.getNoSugDivId(),_41);if(_41){var _43=function(){if(t.isNoSugMsgShow()){t.showSugDiv(false);}};window.setTimeout(_43,t.oConfig.getNoSugShowTime());}},showSugDiv:function(_44,_45){var t=this;if(t.isHideSuggestion()&&_44){t.showIcon(true);return;}
var vS=vjo.dsf.document.Shim,containerId=t.oConfig.getContainerId(),oDiv=t.VE.get(containerId);if(_44){t.posLayer(_45);t.VE.toggleHideShow(containerId,true);if(t.oIframeShim){vS.remove(oDiv,t.oIframeShim);}
t.oIframeShim=vS.add(oDiv);var _48=function(){t.regOverEvent(true);};window.setTimeout(_48,100);}else{t.VE.toggleHideShow(containerId,false);if(t.oIframeShim!==null){vS.remove(oDiv,t.oIframeShim);t.oIframeShim=null;}
t.regOverEvent(false);}},regOverEvent:function(_49){var t=this,idList=t.oConfig.getIdList(),i,id;for(i=0;i<idList.length;i++){id=idList[i];t.VED.unregister(id,"mouseover");t.VED.unregister(id,"click");}
if(_49){for(i=0;i<idList.length;i++){id=idList[i];t.VED.add(id,"mouseover",vjo.hitch(t,this.onListMouseOver));t.VED.add(id,"click",vjo.hitch(t,this.onListClick));}}},posLayer:function(_4b){var t=this,inputPos=t.getAbsPos(t.sInputId);if(inputPos===null){return false;}
var e=t.VE.get(t.oConfig.getContainerId());if(e===null){return false;}
e.style.left=inputPos.left+"px";e.style.top=inputPos.top+inputPos.height+"px";if((typeof(_4b)!="undefined")&&(_4b!==null)){e.style.width=parseInt(_4b,10)+"px";}
return true;},getAbsPos:function(_4e,_4f){var t=this,obj=_4e;if(!_4e){return null;}
if(typeof(_4e)=="string"){obj=t.VE.get(_4e);if(obj===null){return null;}}
var top=obj.offsetTop,left=obj.offsetLeft,height=obj.offsetHeight,width=obj.offsetWidth;var pos="",of="";obj=obj.offsetParent;while(obj!==null){if(_4f){pos=obj.currentStyle?obj.currentStyle.position:window.getComputedStyle(obj,null).getPropertyValue("position");of=obj.currentStyle?obj.currentStyle.overflow:window.getComputedStyle(obj,null).getPropertyValue("overflow");if(pos=="absolute"||pos=="relative"||(of!=="visible"&&of!=="")){break;}}
top+=obj.offsetTop;left+=obj.offsetLeft;obj=obj.offsetParent;}
return{"left":parseInt(left,10),"top":parseInt(top,10),"height":parseInt(height,10),"width":parseInt(width,10)};},updateInput:function(pKw){var t=this;if(t.isSugShown()){t.sLastKw=pKw;var _55={"type":"kw_updvalue","value":pKw};t.sendInSvc(_55);}},updTrk:function(_56){var _57={"type":"search_updtrk","lnkStr":_56};this.sendInSvc(_57);},submitForm:function(){var t=this;if(t.iCurSel>=0){var trk=t.aCurKwList[t.iCurSel].trk;t.updTrk(trk);}
var _5a={"type":"search_submit"};this.sendInSvc(_5a);},showIcon:function(_5b){var _5c={"type":"sug_icon_show","bShow":_5b};this.sendInSvc(_5c);},focusInput:function(){var _5d={"type":"kw_focus"};this.sendInSvc(_5d);},setAutoComplete:function(bOn){var _5f={"type":"kw_autocomplete","bOn":bOn};this.sendInSvc(_5f);},setInputId:function(pId){var t=this;if(t.sInputId===null){t.sInputId=pId;}
var e=t.VE.get(pId);if(e){t.oConfig.updateWidthDef(e);}},show_click:function(_63){var t=this;t.showIcon(false);t.setHideSuggestion(false);t.bLastQueryEmpty=false;t.oRequest.send(t.sRequestId,t.getInputValue());var _65=function(){t.createTrackingImg(t.oConfig.getTrkShow());};window.setTimeout(_65,500);t.setAutoComplete(false);},kw_blur:function(_66){var t=this;if(t.isSugShown()&&!t.isNoSugMsgShow()){if(!t.bInSugDiv){t.selectSug(null,true);t.showSugDiv(false);}else{t.focusInput();}}},kw_mouseover:function(_68){var t=this;if(t.isSugShown()&&!t.isNoSugMsgShow()){t.selectSug(null);}},kw_keydown:function(_6a){var t=this,kc=_6a.keyCode;if(kc==13&&t.isSugShown()&&!t.isNoSugMsgShow()){if(t.iCurSel>=0){var trk=t.aCurKwList[t.iCurSel].trk;t.updTrk(trk);}
t.showSugDiv(false);}},kw_keyup:function(_6d){var t=this,kc=_6d.keyCode,cv=_6d.value;if(t.isIgnorKey(kc)){return;}
if(t.isSugShown()&&!t.isNoSugMsgShow()){if(t.isCtrlKey(kc)){var e,_70,_71;switch(kc){case 38:_70=t.iCurSel-1;if(_70<-1){_70=t.aCurKwList.length-1;}
_71=_70>=0?t.aCurKwList[_70].divId:null;t.selectSug(_71);t.iCurSel=_70;break;case 40:_70=t.iCurSel+1;if(_70>=t.aCurKwList.length){_70=-1;}
_71=_70>=0?t.aCurKwList[_70].divId:null;t.selectSug(_71);break;case 39:if(cv.length!==0){t.sCurKw=cv;t.startKeyTimer(cv);t.sLastKw=cv;}
break;case 27:t.selectSug(null);t.showSugDiv(false);break;}}else{if(cv.length!==0){if(t.sLastKw!=cv){t.sCurKw=cv;t.startKeyTimer(cv);t.sLastKw=cv;}}else{t.showSugDiv(false);t.showIcon(false);t.sCurKw=cv;t.sLastKw=cv;t.bLastQueryEmpty=false;}}}else{if(cv.length!==0){if(t.sLastKw!=cv){t.sCurKw=cv;t.startKeyTimer(cv);t.sLastKw=cv;}}else{t.sCurKw=cv;if(t.isHideSuggestion()){t.showIcon(false);}
t.sLastKw=cv;t.bLastQueryEmpty=false;}}},onListMouseOver:function(_72){this.bInSugDiv=true;var e=_72.src;this.selectSug(e.id,false,true);},onListClick:function(_74){var e=_74.src,t=this;t.selectSug(e.id);t.submitForm();t.showSugDiv(false);},onMouseIn:function(_76){this.bInSugDiv=true;},onMouseOut:function(_77){this.bInSugDiv=false;},onHideClick:function(_78){var t=this;t.setHideSuggestion(true);t.selectSug(null);t.showSugDiv(false);t.setAutoComplete(true);t.showIcon(true);var _7a=function(){t.createTrackingImg(t.oConfig.getTrkHide());};window.setTimeout(_7a,500);return false;},onWindowResize:function(_7b){if(this.isSugShown()){this.showSugDiv(true);}}}).endType();
vjo.ctype("vjo.darwin.domain.finding.autofill.AutoFillInit").needs("vjo.dsf.EventDispatcher").needs("vjo.dsf.ServiceEngine").needs("vjo.darwin.domain.finding.autofill.AutoFillConfig").needs("vjo.darwin.domain.finding.autofill.AutoFill").needs("vjo.darwin.domain.finding.autofill.AutoFillRequest").protos({constructs:function(_1){this.oModel=_1;var t=this;var _3=function(){var _4=new vjo.darwin.domain.finding.autofill.AutoFillConfig(t.oModel),requestConfig={"baseURL":_4.getBaseURL(),"dirDepth":_4.getDirDepth(),"rootDir":_4.getRootDir(),"algorithm":_4.getAlgorithm(),"version":_4.getVersion(),"siteId":_4.getSiteId()};vjo.darwin.domain.finding.autofill.AutoFillRequest.init(requestConfig);new vjo.darwin.domain.finding.autofill.AutoFill(_4,t.oModel.requestId);};vjo.dsf.EventDispatcher.add("body","load",_3);}}).endType();
vjo.ctype("vjo.darwin.domain.finding.store.storesearchbox.StoreSearchBox").needs("vjo.dsf.Element").protos({constructs:function(_1,_2,_3){t=this;t.E=vjo.dsf.Element;t.tb=t.E.get(_1);t.button=t.E.get(_2);t.dd=t.E.get(_3);t.dd.selectedIndex=0;vjo.dsf.EventDispatcher.addEventListener(t.button,"click",t.submitForm,this);return this;},submitForm:function(){var v=parseInt(t.dd[t.dd.selectedIndex].value);if(t.tb.defaultValue===t.tb.value||(t.tb.value===""&&v<0)){t.tb.value="";t.tb.focus();if(v==-6||v==-9){return false;}}}}).endType();
// de_CH/e659i/Finding_StoreCategory_e659i10789179_6_de_CH
// b=10789179
