vjo.ctype("vjo.darwin.domain.finding.filmstrip.FilmStripPager").needs(["vjo.darwin.transitional.ajax.AjaxUtils","vjo.darwin.domain.finding.common.image.ImageButton"]).protos({AjaxUtils:vjo.darwin.transitional.ajax.AjaxUtils,ImageButton:vjo.darwin.domain.finding.common.image.ImageButton,constructs:function(id,_2){var _3=this;this.model=_2;this.state=_2.pagination.state;this.element=this.AjaxUtils.registerObject(this,id);this.paging=this.AjaxUtils.getTag(this.element,"td","paging");this.buttons=this.element.getElementsByTagName("img");
this.prevButton=new this.ImageButton(this.buttons[0],function(_4){return _3.onPrevPage(_4)},this.model.prevPageEnabled,this.model.prevPageDisabled);this.nextButton=new this.ImageButton(this.buttons[1],function(_5){return _3.onNextPage(_5)},this.model.nextPageEnabled,this.model.nextPageDisabled);this.pageChange=this.state.concat(".PageChange.",_2.htmlId);this.pageRequest=this.state.concat(".PageRequest.",_2.htmlId);this.AjaxUtils.addResponseHandler(this,this.onPageChange,this.pageChange)},onPageChange:function(_6){this.pagination=
_6.pagination;var _7=this.pagination.currentPage;if(_7==null)return false;this.totalPages=this.pagination.totalPages;this.currentPage=this.pagination.currentPage;this.prevButton.setEnabled(this.currentPage>1);this.nextButton.setEnabled(this.currentPage<this.totalPages);this.paging.innerHTML=this.model.paging.replace("$Current$",this.currentPage).replace("$Total$",this.totalPages)},onPrevPage:function(_8){return this.requestPage(this.currentPage-1)},onNextPage:function(_9){return this.requestPage(this.currentPage+
1)},requestPage:function(_a){var _b=new vjo.dsf.Message(this.pageRequest);_b.page=_a;vjo.dsf.ServiceEngine.handleRequest(_b);return false}}).endType();
vjo.ctype("vjo.darwin.domain.finding.visualpreview.VisualPreview").needs("vjo.darwin.transitional.ajax.AjaxUtils").needs("vjo.darwin.core.overlaypanel3.OverlayPanel","OP").needs("vjo.darwin.core.overlaypanel3.OverlayPanelModel","OPM").protos({AjaxUtils:vjo.darwin.transitional.ajax.AjaxUtils,constructs:function(_1){this.model=_1;this.element=this.AjaxUtils.registerObject(this,_1.htmlId);this.overlay=document.getElementById(_1.overlayId);this.show=vjo.Registry.get(_1.showId);this.slides=this.AjaxUtils.getTag(this.element,
"div","slides");this.detail=this.AjaxUtils.getTag(this.element,"div","detail");vjo.darwin.domain.finding.visualpreview.VisualPreview=this},open:function(_2,_3,_4,_5,_6,_7,_8,_9,_a,_b){this.show.stopShow();this.slides.style.display=_2.length>0?"block":"none";if(_2.length>0)this.show.startShow(_2,_3,_b);var _c=this.detail.firstChild;if(_c)this.detail.removeChild(_c);if(_4)this.detail.appendChild(_4);this.detail.style.display=_4?"block":"none";var _d=this.AjaxUtils.getTag(this.detail,"div","oriprice");
var _e=this.AjaxUtils.getTag(this.detail,"div","disct");if(_d&&_e){this.slideShow=this.AjaxUtils.getTag(this.element,"div","slideShow");this.slide=this.AjaxUtils.getTag(this.slideShow,"div","slide");var _f=document.createElement("img");_f.src=this.model.saleIconSrc;_f.className="saleIcon";this.slide.appendChild(_f);this.slide.style.marginTop="5px"}var _10=this.model.openOverlayId;if(_10)this.openOverlay(_5,_6,_7,_a);if(_9)this.track(_9,_8)},track:function(_11,_12){var _13=this.AjaxUtils.getUriBuilder(this.model.trackingHostUrl);
_13.appendParam("sp",_11);if(_12)_13.appendParam("itm",_12);_13.appendParam("time",(new Date).getTime());var _14=document.createElement("img");_14.src=_13.getUri()},close:function(){var _15=this.model.closeOverlayId;if(_15)this.closeOverlay()},getOverlay:function(){return this.overlay},getGalleryHost:function(){return this.model.galleryHostUrl},openOverlay:function(top,_17,_18,_19){var t=this;var op=t.vj$.OP;var opm=t.vj$.OPM;var m=new opm;m.VOF=top;m.HOF=_17;op.olpMsg(t.model.openOverlayId,_19,"",
m)},closeOverlay:function(){var t=this;var op=t.vj$.OP;op.olpMsg(t.model.closeOverlayId)}}).endType();
vjo.ctype("vjo.darwin.domain.finding.visualpreview.VisualPreviewSummary").protos({constructs:function(_1,_2){var t=this;var d=document;t.model=_1;t.container=d.createElement("div");t.element=_2?_2:d.getElementById(_1.htmlId);t.addClass(t.element,"vps");t.element.appendChild(t.buildTable())},addClass:function(_4,_5){var _6=_4.className;_4.className=_6?_4.className.concat(" ",_5):_5},appendContent:function(_7,_8){var t=this;if(_8){t.container.innerHTML=_8;var _a=t.container.childNodes.length;for(var _b=
0;_b<_a;_b++)_7.appendChild(t.container.childNodes[_b].cloneNode(true))}},buildTable:function(){var t=this;var d=document;var table=d.createElement("table");table.style.width="100%";var _d=table.appendChild(d.createElement("tbody"));var _e=_d.appendChild(d.createElement("tr"));_e.appendChild(t.buildTitles());_e.appendChild(t.buildBasics());return table},buildTitles:function(){var t=this;var m=t.model;var titles=document.createElement("td");t.addClass(titles,"t");t.appendContent(titles,m.title);t.appendContent(titles,
m.fitmentSection);t.appendContent(titles,m.subtitle);if(!m.motors)t.appendContent(titles,m.badges);t.appendContent(titles,m.dynamicAttributes);t.appendContent(titles,m.mskuLink);if(m.motors)t.appendContent(titles,m.badges);return titles},buildBasics:function(){var t=this;var basics=document.createElement("td");t.addClass(basics,"b");t.appendContent(basics,t.model.rightColumn);return basics}}).endType();
vjo.ctype("vjo.darwin.domain.finding.itemfilmstrip.ItemCellThumbnail").needs(["vjo.darwin.transitional.ajax.AjaxUtils","vjo.darwin.domain.finding.common.image.ImageLoader","vjo.darwin.domain.finding.visualpreview.VisualPreview","vjo.darwin.domain.finding.visualpreview.VisualPreviewSummary"]).protos({vE:vjo.dsf.Element,vED:vjo.dsf.EventDispatcher,vWU:vjo.dsf.window.utils.VjWindowUtils,vAU:vjo.darwin.transitional.ajax.AjaxUtils,constructs:function(_1,_2,_3){var t=this;t.idx=_3;t.model=_2;t.manager=
_1;t.preview=vjo.darwin.domain.finding.visualpreview.VisualPreview;t.isAdultHide=_2.adultHide;t.container=document.createElement("div")},getId:function(){return this.model.itemId},getIdx:function(){return this.idx},getImage:function(){return this.image},getImageUrl:function(){return this.model.imageUrl},setImageUrl:function(_5){this.model.imageUrl=_5},setImageSrc:function(){this.image.src=this.getImageUrl()},getElement:function(_6){return this.element==null?this.loadElement(_6):this.element},loadElement:function(_7){var t=
this;var d=document;t.element=d.createElement("div");t.element.className="ICT";t.element.id=t.model.htmlId;this.table=t.element.appendChild(d.createElement("table"));var _9=this.table.appendChild(d.createElement("tbody"));this.table.cellSpacing=0;this.table.cellPadding=0;var _a=_9.appendChild(d.createElement("tr"));var _b=_a.appendChild(d.createElement("td"));_b.className="ICT";_b.style.width=t.vWU.toPixels(t.filmstrip.getCellWidth());_b.style.height=t.vWU.toPixels(t.filmstrip.getCellHeight());t.thumbnailCell=
_b;t.anchor=_b.appendChild(d.createElement("a"));t.anchor.setAttribute("href",t.model.itemUrl);var _c=t.model.listRank;if(_c)t.anchor.setAttribute("r",_c);var _d=t.model.trackInfo;if(_d)t.anchor.setAttribute("_sp",_d);t.image=t.anchor.appendChild(d.createElement("img"));if(_7)t.image.src=t.getImageUrl();t.vAU.addEventHandler(t,t.element,"mouseover",t.onMouseOver);if(t.filmstrip.model.moreBottomSpace>0){var _e=_9.appendChild(d.createElement("tr"));var _f=_e.appendChild(d.createElement("td"));_f.appendChild(t.buildMoreInfo())}return t.element},
buildMoreInfo:function(){var t=this;var tmodel=t.model;var type=t.model.saleType;var _11=type==6||type==7||type==9||type==13;var _12=document.createElement("div");_12.className="basics";if(tmodel.auctionPrice)_12.appendChild(t.buildPrice(tmodel.auctionPrice,true));if(!_11&&tmodel.fixedPrice)_12.appendChild(t.buildPrice(tmodel.fixedPrice,tmodel.auctionPrice==null));t.appendContent(_12,tmodel.time);return _12},addClass:function(_13,_14){var _15=_13.className;_13.className=_15?_13.className.concat(" ",
_14):_14},appendContent:function(_16,_17){var t=this;if(_17){t.container.innerHTML=_17;var _19=t.container.childNodes.length;for(var idx=0;idx<_19;idx++)_16.appendChild(t.container.childNodes[idx].cloneNode(true))}},buildPrice:function(_1b,_1c){var _1d=document.createElement("span");if(_1c)this.addClass(_1d,"g-b");this.appendContent(_1d,_1b);return _1d},getGallery:function(){var t=this;if(t.isAdultHide)return"";else return t.gallery==null?t.loadGallery():t.gallery},loadGallery:function(){var t=this;
t.hrefs=new Array;t.gallery=new Array;t.trkInfos=[];var _20=this.preview.getGalleryHost();if(_20==null)return t.gallery;var _21=t.model.gallery;if(_21==null)return t.gallery;for(var idx=0;idx<Math.min(_21.images,1);idx++){var of=_21.offset?"_"+_21.offset:"";var _24=(new Array(_21.item,idx+1,_21.version,"1")).join("_").concat(of,".jpg");t.gallery.push((new Array(_20,_24)).join("/"));t.hrefs.push(t.model.itemUrl);t.trkInfos.push(t.model.trackInfo)}return t.gallery},getSummary:function(){return this.summary==
null?this.loadSummary():this.summary},loadSummary:function(){return this.summary=new vjo.darwin.domain.finding.visualpreview.VisualPreviewSummary(this.model,document.createElement("div"))},getFilmStrip:function(){return this.filmstrip},setFilmStrip:function(_25){this.filmstrip=_25;this.delay=_25.getCellDelay()},setTimeout:function(_26,_27){window.clearTimeout(this.timer);this.timer=window.setTimeout(_26,_27)},getSelected:function(){return this.selected},setSelected:function(_28){var t=this;window.clearTimeout(t.timer);
if(t.loader)t.loader.cancel();t.loader=null;t.selected=_28;if(t.selected)t.vAU.addEventHandler(t,document.body,"mousemove",t.onMouseMove);else t.vAU.removeEventHandlers(t,document.body)},onMouseOver:function(_2a){var t=this;if(t.selected)return false;var _2c=t.vED.relatedTarget(_2a);if(_2c&&t.vE.containsElement(t.element,_2c))return false;t.setSelected(true);t.filmstrip.setSelected(t,t.selected);var _2d=t.filmstrip.getCellDelay();t.setTimeout(function(){t.startPreview()},_2d);return false},onMouseMove:function(_2e){var t=
this;var _30=t.vWU.offsetTop(t.element);var _31=t.vWU.offsetLeft(t.element);var _32=t.vWU.eventTop(_2e)-_30;var _33=t.vWU.eventLeft(_2e)-_31;if(_33<=0||_33>t.element.offsetWidth)return t.closePreview();else if(_32<=0||_32>t.element.offsetHeight)return t.closePreview();return false},startPreview:function(){var t=this;var gallery=t.getGallery();t.loader=gallery.length==1?new vjo.darwin.domain.finding.common.image.ImageLoader(document.createElement("img")):null;if(t.loader)t.loader.load(gallery[0],function(){t.checkPreview()},
4*t.delay);else t.setTimeout(function(){t.openPreview()},0)},checkPreview:function(){var t=this;if(t.loader.error)t.gallery.length=0;var _36=Math.max(t.delay-t.loader.elapsed,0);t.setTimeout(function(){t.openPreview()},_36)},openPreview:function(){var t=this;var _38=document.getElementById(t.element.id);if(_38==null)return;var _39=t.getGallery();var _3a=t.getSummary().element;var _3b=t.filmstrip.getNumRows();var _3c=t.filmstrip.getNumCols();var _3d=t.vWU.offsetTop(t.thumbnailCell);var _3e=t.vWU.offsetLeft(t.thumbnailCell);
var _3f=t.thumbnailCell.offsetWidth;var _40=t.thumbnailCell.offsetHeight;var idx=t.idx%(_3b*_3c);var _42=idx%_3c<_3c/2?1:0;var top=Math.floor(_40/4);var _44=Math.floor(_3f/4);var _45=this.filmstrip.getTrackingId();this.preview.anchorId=t.element.id;this.preview.open(_39,this.hrefs,_3a,-top,-_44,_42,this.model.itemId,_45,t.element.id,this.trkInfos)},closePreview:function(){var t=this;t.setSelected(false);t.filmstrip.setSelected(t,t.selected);this.preview.close();return false}}).endType();
vjo.ctype("vjo.darwin.domain.finding.slideshow.SlideShow").needs(["vjo.dsf.EventDispatcher","vjo.dsf.Element","vjo.dsf.window.utils.VjWindowUtils","vjo.darwin.domain.finding.common.image.ImageButton","vjo.darwin.domain.finding.common.image.ImageLoader","vjo.darwin.domain.finding.common.filter.AlphaFilter"]).protos({vE:vjo.dsf.Element,vHD:vjo.dsf.utils.Handlers,vWU:vjo.dsf.window.utils.VjWindowUtils,constructs:function(_1){var t=this;t.model=_1;t.element=t.vE.get(_1.htmlId);t.buildControls();t.buildLoading();
t.buildError();t.ticker=null;t.playing=false;t.repeat=_1.repeat;t.slideLoaders=new Array;t.slideFilters=new Array;t.vHD.attachEvt(window,"unload",t.onUnload,t);var _3=_1.slideUrls;if(_3)t.startShow(_3,_1.slideHrefs)},onUnload:function(_4){var t=this;t.element=t.slide=t.controls=t.pager=null;t.loading=t.error=null},buildControls:function(){var t=this;t.slide=t.vE.getElementByTagClass(t.element,"div","slide");t.controls=t.vE.getElementByTagClass(t.element,"div","controls");t.pager=t.vE.getElementByTagClass(t.element,
"div","pager");t.format=t.pager.innerHTML;t.pager.innerHTML="";t.buildButtons()},buildButtons:function(){var t=this;var m=t.model;var _8=t.controls.getElementsByTagName("img");var _9=vjo.darwin.domain.finding.common.image.ImageButton;t.prevButton=new _9(_8[0],function(_a){return t.showPrev(_a)},m.prevEnabledSrc,m.prevDisabledSrc);t.stopButton=new _9(_8[1],function(_b){return t.showStop(_b)},m.stopEnabledSrc,m.stopDisabledSrc);t.playButton=new _9(_8[2],function(_c){return t.showPlay(_c)},m.playEnabledSrc,
m.playDisabledSrc);t.nextButton=new _9(_8[3],function(_d){return t.showNext(_d)},m.nextEnabledSrc,m.nextDisabledSrc)},buildLoading:function(){var t=this;t.loading=t.slide.appendChild(document.createElement("div"));t.loading.appendChild(document.createElement("img"));t.loading.className="loading";t.loading.firstChild.src=t.model.loading},buildError:function(){var t=this;t.error=t.slide.appendChild(document.createElement("div"));t.error.innerHTML=t.model.error;t.error.className="error"},showPaging:function(){var t=
this;t.pager.innerHTML=t.format.replace("$Current$",t.currentSlide).replace("$Total$",t.totalSlides)},startShow:function(_11,_12,_13){var t=this;t.stopShow();t.slide.removeChild(t.error);t.slide.removeChild(t.loading);t.slide.innerHTML="";t.slide.appendChild(t.error);t.error.style.display="none";t.slide.appendChild(t.loading);t.loading.style.display="block";t.totalSlides=_11?_11.length:0;t.element.style.display="block";t.controls.style.display=t.totalSlides>1?"block":"none";t.slideUrls=_11;t.slideHrefs=
_12;t.slideTrkInfos=_13;t.slideLoaders=new Array(t.totalSlides);t.slideFilters=new Array(t.totalSlides);t.playing=false;t.stopButton.setEnabled(false);t.playButton.setEnabled(true);t.currentSlide=1;t.prevButton.setEnabled(t.repeat||t.currentSlide>1);t.nextButton.setEnabled(t.repeat||t.currentSlide<t.totalSlides);t.showPaging();for(var sdx=0;sdx<this.slideLoaders.length;sdx++){t.slideLoaders[sdx]=new vjo.darwin.domain.finding.common.image.ImageLoader(document.createElement("img"));t.slideFilters[sdx]=
new vjo.darwin.domain.finding.common.filter.AlphaFilter(t.slideLoaders[sdx].image,0)}if(t.totalSlides>0)t.loadSlide(0)},stopShow:function(){var t=this;window.clearInterval(t.ticker);var _17=t.slideLoaders.length;for(var sdx=0;sdx<_17;sdx++)t.slideLoaders[sdx].cancel();_17=t.slideFilters.length;for(sdx=0;sdx<_17;sdx++)t.slideFilters[sdx].cancel()},loadSlide:function(sdx){var t=this;var _1b=t.slideLoaders[sdx];if(_1b==null||_1b.loaded)return;else _1b.sdx=sdx;_1b.load(t.slideUrls[sdx],function(){t.onLoadSlide(_1b)},
t.model.slideTimeout)},onLoadSlide:function(_1c){var t=this;if(_1c.loaded)t.resizeSlide(_1c.sdx);if(_1c.sdx==t.currentSlide-1)t.showSlide(_1c.sdx);if(_1c.sdx<t.totalSlides-1)window.setTimeout(function(){t.loadSlide(_1c.sdx+1)},0)},resizeSlide:function(sdx){var t=this;var scale=1;var _20=t.slide.appendChild(document.createElement("a"));if(t.slideHrefs)_20.setAttribute("href",t.slideHrefs[sdx]);if(t.slideTrkInfos)_20.setAttribute("_sp",t.slideTrkInfos[sdx]);var _21=_20.appendChild(t.slideLoaders[sdx].image);
if(_21.width>t.model.slideWidth&&_21.width>=_21.height)scale=t.model.slideWidth/_21.width;else if(_21.height>t.model.slideHeight&&_21.height>=_21.width)scale=t.model.slideHeight/_21.height;var _22=scale*_21.width;var _23=scale*_21.height;_21.width=_22;_21.height=_23;_21.style.top=t.vWU.toPixels(Math.floor((t.model.slideHeight-_21.height)/2));_21.style.left=t.vWU.toPixels(Math.floor((t.model.slideWidth-_21.width)/2))},showSlide:function(sdx){var t=this;var loader=t.slideLoaders[sdx];t.error.style.display=
loader.error||loader.timeout?"block":"none";t.loading.style.display=!loader.error&&!loader.timeout&&!loader.loaded?"block":"none";t.fadeImage(sdx,100);if(sdx<t.currentSlide-1)t.fadeImage(t.currentSlide-1,0);else if(sdx>t.currentSlide-1)t.fadeImage(t.currentSlide-1,0);this.currentSlide=sdx+1;t.prevButton.setEnabled(!t.playing&&(t.repeat||t.currentSlide>1));t.nextButton.setEnabled(!t.playing&&(t.repeat||t.currentSlide<t.totalSlides));t.showPaging()},fadeImage:function(sdx,_27){var t=this;var loaded=
t.slideLoaders[sdx].loaded;if(loaded)t.slideFilters[sdx].fade(_27,t.model.fadeDelta,t.model.fadeTick)},showPrev:function(_29){var t=this;var sdx=t.currentSlide-1;t.showSlide((sdx+(t.totalSlides-1))%t.totalSlides)},showNext:function(_2b){var t=this;var sdx=t.currentSlide-1;t.showSlide((sdx+1)%t.totalSlides)},showStop:function(_2d){var t=this;t.playing=false;t.stopButton.setEnabled(false);t.playButton.setEnabled(true);t.prevButton.setEnabled(true);t.nextButton.setEnabled(true);window.clearInterval(t.ticker)},
showPlay:function(_2f){var t=this;t.playing=true;t.stopButton.setEnabled(true);t.playButton.setEnabled(false);t.prevButton.setEnabled(false);t.nextButton.setEnabled(false);var sdx=t.currentSlide-1;t.showSlide((sdx+1)%t.totalSlides);t.ticker=window.setInterval(function(){t.showNext()},t.model.slideTick);return false}}).endType();
vjo.ctype("vjo.darwin.domain.finding.filmstrip.FilmStripLoader").needs("vjo.darwin.domain.finding.common.image.ImageLoader").protos({ImageLoader:vjo.darwin.domain.finding.common.image.ImageLoader,constructs:function(_1,_2){var _3=this;this.model=_2;this.filmstrip=_1;this.element=_1.element;this.interval=_1.getCellDelay();this.objects=new Array;this.loaders=new Array;this.slots=_2.numRows+_2.numCols-1;this.ontick=function(){return _3.onTick()}},start:function(_4){this.page=_4;this.slot=this.model.loadLeftRight?
0:this.model.numCols-1;this.ontick()},cancel:function(){window.clearTimeout(this.timer);var _5=this.loaders.length;for(var _6=0;_6<_5;_6++)this.loaders[_6].cancel()},onTick:function(){var _7;this.started=this.time();this.objects=new Array;this.loaders=new Array;var _8=this.model.numRows;var _9=this.model.numCols;var _a=(this.page-1)*this.model.numRows*this.model.numCols;var _b=this.interval==0?true:false;var _c=document.getElementById(this.element.id);if(_c==null)return this.cancel();for(var _d=0;_d<=
Math.min(this.slot,_8-1);_d++){var _e=this.slot-_d;if(_e>=_9)continue;var _f=_a+_9*_d+_e;var _10=this.filmstrip.getFilmCell(_f);if(_10)_10.setFilmStrip(this.filmstrip);var _11=this.element.rows[_d].cells[_e].firstChild;_11.appendChild(_10?_10.getElement(_b):document.createTextNode(" "));if(_10==null)continue;if(_b)this.onLoadObject();else{this.loaders.push(_7=new this.ImageLoader(_10.getImage()));this.objects.push(_7.object=_10)}}for(var idx=0;idx<this.loaders.length;idx++)this.loadObject(this.loaders[idx])},
loadObject:function(_13){var _14=this;var _15=_13.object;_13.load(_15.getImageUrl(),function(){_14.onLoadObject(_13)},3E3)},onLoadObject:function(_16){if(_16){var _17=_16.object;if(_16.loaded&&_16.image.width<=1)this.replaceObject(_17);this.objects.pop();if(this.objects.length>0)return}var _18=this.time()-this.started;var _19=Math.max(this.interval-_18,0);if(this.model.loadLeftRight)this.slot++;else this.slot--;if(this.slot>=this.slots)return;else this.timer=window.setTimeout(this.ontick,_19)},replaceObject:function(_1a){_1a.image.src=
"http://pics.ebaystatic.com/aw/pics/icon/iconPic_20x20.gif";_1a.setImageUrl(_1a.image.src)},time:function(){return(new Date).getTime()}}).endType();
vjo.ctype("vjo.darwin.domain.finding.filmstrip.FilmStrip").needs(["vjo.darwin.transitional.ajax.AjaxUtils","vjo.darwin.domain.finding.filmstrip.FilmStripLoader","vjo.darwin.domain.finding.itemfilmstrip.ItemCellThumbnail","vjo.darwin.domain.finding.visualpreview.VisualPreview"]).protos({WindUtils:vjo.dsf.window.utils.VjWindowUtils,AjaxUtils:vjo.darwin.transitional.ajax.AjaxUtils,FilmStripLoader:vjo.darwin.domain.finding.filmstrip.FilmStripLoader,ItemCellThumbnail:vjo.darwin.domain.finding.itemfilmstrip.ItemCellThumbnail,
constructs:function(id,_2){this.model=_2;this.state=_2.pagination.state;this.element=this.AjaxUtils.registerObject(this,id);for(var _3=0;_3<_2.numRows;_3++)for(var _4=0;_4<_2.numCols;_4++)for(var _5=this.element.rows[_3].cells[_4];_5.firstChild.nodeType==3;)_5.removeChild(_5.firstChild);this.loader=new this.FilmStripLoader(this,_2);this.element.parentNode.style.width=this.WindUtils.toPixels(this.element.offsetWidth);this.binding=this.state.concat(".PageChange.",_2.htmlId);this.AjaxUtils.addResponseHandler(this,
this.onPageChange,this.binding)},destroy:function(){this.loader.cancel()},onPageChange:function(_6){this.filmCells=new Array;this.pagination=_6.pagination;this.itemlist=_6.itemlist?_6.itemlist:this.model.itemlist;this.showPage(this.pagination.currentPage)},getNumRows:function(){return this.model.numRows},getNumCols:function(){return this.model.numCols},getCellDelay:function(){return this.model.cellDelay},getCellWidth:function(){return this.model.cellWidth},getCellHeight:function(){return this.model.cellHeight},
getTrackingId:function(){return this.model.trackingId},showPage:function(_7){var _8;var _9;var _a;this.loader.cancel();this.clearSelected();this.closePreview();var _b=this.model.numRows;var _c=this.model.numCols;var _d=(_7-1)*this.model.numRows*this.model.numCols;for(var _e=this.model.numRows;_e>0;_e--){_9=this.getFilmCell(_d+_c*(_e-1));this.element.rows[_e-1].style.display=_9?"":"none";for(var _f=this.model.numCols;_f>0;_f--){_8=this.element.rows[_e-1].cells[_f-1];_a=_8.firstChild;if(_a.firstChild)_a.removeChild(_a.firstChild);
_9=this.getFilmCell(_d+_c*(_e-1)+(_f-1));_8.style.visibility=_9?"visible":"hidden"}}this.loader.start(_7)},getFilmCell:function(idx){var _11=this.filmCells[idx];if(_11!=null)return _11;var _12=this.model.numRows*this.model.numCols;var ndx=idx-_12*(this.pagination.firstPage-1);if(this.itemlist[ndx]==null)return null;return this.filmCells[idx]=new this.ItemCellThumbnail(this,this.itemlist[ndx],idx)},closePreview:function(){var _14=vjo.darwin.domain.finding.visualpreview.VisualPreview;if(_14!=null)_14.close()},
setSelected:function(_15,_16){this.showSelected(_15,_16);this.selected=_16?_15:null},showSelected:function(_17,_18){var idx=_17.getIdx()%(this.model.numRows*this.model.numCols);var rdx=Math.floor(idx/this.model.numCols);var cdx=idx%this.model.numCols;this.element.rows[rdx].cells[cdx].className=_18?"cell selected":"cell"},clearSelected:function(){if(this.selected==null)return;this.showSelected(this.selected,false);this.selected=null}}).endType();
vjo.ctype("vjo.darwin.domain.finding.navigation.aspects.color.ColorAspectController").inherits("vjo.darwin.domain.finding.navigation.NavigationObject").protos({constructs:function(_1,_2){this.base(_1);this.element=_2;this.slider=_1.element;this.addEventHandler(this,this.element,"mousedown",this.onDragStart)},onDragStart:function(_3){this.draggingLeft=_3.clientX-this.element.offsetLeft;this.removeEventHandlers(this,document.body);this.addEventHandler(this,document.body,"mouseup",this.onDragStop);this.addEventHandler(this,
document.body,"mousemove",this.onDragMove);this.addEventHandler(this,document.body,"selectstart",this.onDragSelect);return false},onDragMove:function(_4){var _5=_4.clientX-this.draggingLeft;var _6=this.slider.offsetWidth-this.element.offsetWidth;_5=Math.min(Math.max(_5,-4),_6+4);this.element.style.left=this.WindUtils.toPixels(_5);this.parent.onDragMove(_5+4);return false},onDragStop:function(_7){var _8=_7.clientX-this.draggingLeft;var _9=this.slider.offsetWidth-this.element.offsetWidth;_8=Math.min(Math.max(_8,
-4),_9+4);this.element.style.left=this.WindUtils.toPixels(_8);this.parent.onDragStop(_8+4);this.removeEventHandlers(this,document.body);return false},onDragSelect:function(_a){return false}}).endType();
vjo.ctype("vjo.darwin.domain.finding.navigation.aspects.color.ColorAspectSlider").needs(["vjo.darwin.domain.finding.util.NumberFormatter","vjo.darwin.domain.finding.navigation.aspects.color.ColorAspectController"]).inherits("vjo.darwin.domain.finding.navigation.aspects.color.ColorAspect").protos({ColorAspectController:vjo.darwin.domain.finding.navigation.aspects.color.ColorAspectController,constructs:function(_1,_2){this.base(_1,_2)},buildContent:function(){this.element=this.AjaxUtils.getTag(this.root.content,
"div","casr-s");this.strip=this.AjaxUtils.getTag(this.element,"div","strip");this.images=this.strip.getElementsByTagName("img");this.imagePaths=new Array;var _3=this.images.length;for(var _4=0;_4<_3;_4++)this.imagePaths.push(this.images[_4].src);this.addEventHandler(this,this.strip,"click",this.onClick);this.buildSliderColors(this.model)},buildSliderColors:function(_5){this.colors=_5.values;this.selected=new Array;this.all=0;this.multi=this.colors.length-1;this.imageWidth=this.images[0].offsetWidth;
var _6=this.colors.length;for(var _7=0;_7<_6;_7++){var _8=this.colors[_7];if(_8.selected)this.selected.push(_7);_8.disabled=_8.disabled||_8.count<=0;this.images[_7].src=_8.disabled?this.imagePaths[0]:this.imagePaths[_7];this.images[_7].className=_8.disabled?"disabled":"enabled"}this.indicator=this.AjaxUtils.getTag(this.element,"div","indicator");this.controller=this.AjaxUtils.getTag(this.element,"div","controller");this.controller=new this.ColorAspectController(this,this.controller);this.initColors(this.selected)},
initColors:function(_9){var _a=this.colors[this.multi].selected;var _b=_9.length==2&&Math.abs(_9[1]-_9[0])>1;if(_9.length>2||_a||_b||this.notSpecifiedWithOthers(_9)){_9=[this.multi];this.colors[this.multi].disabled=false;this.images[this.multi].src=this.imagePaths[this.multi];this.images[this.multi].className="enabled"}this.lastSelectedColors=_9;this.showColorSlider(_9);this.showColorIndicator(_9)},notSpecifiedWithOthers:function(_c){for(var _d=0;_d<_c.length&&_c[_d].value!="NS";_d++);return _c.length>
1&&_d<_c.length},onDragMove:function(_e){this.showSelectedColors(this.getNearestColors(_e))},onDragStop:function(_f){this.selectedColors=this.getNearestColors(_f);this.showSelectedColors(this.selectedColors);this.onChange(this.selectedColors)},onClick:function(_10){var _11=this.WindUtils.eventLeft(_10)-this.WindUtils.offsetLeft(this.strip);var _12=this.strip.offsetWidth-this.controller.element.offsetWidth;_11=Math.min(Math.max(_11-6,-4),_12+4);var _13=this.getClickedColor(_11);if(this.colors[_13].disabled)return;
this.showSelectedColors([_13]);this.onChange([_13])},getClickedColor:function(_14){var _15=Math.round((_14+4)/(this.imageWidth/2));var _16=Math.floor(_15/2);return _16},getSelectedColors:function(_17){var _18=Math.round(_17/(this.imageWidth/2));var _19=Math.floor(_18/2);var right=Math.floor((_18+1)/2);if(this.colors[_19].value=="ALL")return[_19];else if(this.colors[right].value=="MULTI")return[right];else return _19!=right?[_19,right]:[_19]},getNearestColors:function(_1a){var _1b=this.getSelectedColors(_1a);
var _1c=this.colors;var length=_1c.length;var _1d=_1b[0];var right=_1b[1]?_1b[1]:_1d;for(var ldx=_1d;ldx>=0&&_1c[ldx].disabled;ldx--);for(var rdx=right;rdx<length&&_1c[rdx].disabled;rdx++);var lok=ldx>=0&&!_1c[ldx].disabled;var rok=rdx<length&&!_1c[ldx].disabled;if(rok&&rdx-right<_1d-ldx)return[rdx];else if(lok&&ldx<_1d)return[ldx];else if(_1c[_1d].disabled)return[right];else if(_1c[right].disabled)return[_1d];else return _1d!=right?[_1d,right]:[_1d]},showSelectedColors:function(_22){this.showColorSlider(_22);
this.showColorIndicator(_22)},showColorSlider:function(_23){var _24=_23[0];var right=_23[1]?_23[1]:_24;var _25=_24?Math.round((_24+right)/2*this.imageWidth):0;this.controller.element.style.left=this.WindUtils.toPixels(_25-4)},showColorIndicator:function(_26){var _27=_26[0]?_26[0]:0;var leftColor=this.colors[_27];var _28=_26[1]?_26[1]:_27;var rightColor=this.colors[_28];var _29=_28!=_27?leftColor.display.concat(",",rightColor.display):leftColor.display;var _2a=_28!=_27?leftColor.count+rightColor.count:
leftColor.count;this.indicator.innerHTML=_29.concat(" (",this.formatter.format(_2a),")");var _2b=Math.round((_27+_28)/2*this.imageWidth);_2b=Math.min(_2b,this.strip.offsetWidth-this.indicator.offsetWidth);this.indicator.style.left=this.WindUtils.toPixels(_2b)},onChange:function(_2c){this.selected=_2c;if(!this.isColorChanged(this.selected,this.lastSelectedColors))return false;var _2d=this.setParams(this.panel.getRequest(),_2c);return this.panel.sendRequest(_2d)},isColorChanged:function(_2e,_2f){if(_2e.length!=
_2f.length)return true;var _30=_2e.length;for(var i=0;i<_30;i++)if(_2e[i]!=_2f[i])return true;return false},setParams:function(_32,_33){delete _32.params["_pgn"];delete _32.params[this.model.name];if(_33.length<=0||_33[0]==0)return _32;var _34=_33.length;for(var idx=0;idx<_34;idx++)_32.appendParam(this.model.name,this.colors[_33[idx]].value);return _32}}).endType();vjo.darwin.domain.finding.navigation.aspects.AspectRollup.typedModels["ColorAspectRollupModel.slider"]=vjo.darwin.domain.finding.navigation.aspects.color.ColorAspectSlider;
vjo.ctype("vjo.darwin.domain.finding.navigation.aspects.price.PriceAspectController").inherits("vjo.darwin.domain.finding.navigation.NavigationObject").protos({constructs:function(_1,_2,_3,_4){this.base(_1);this.index=_4;this.slider=_1.element;this.element=this.AjaxUtils.getTags(this.slider,"div","controller")[this.index];this.indicator=this.AjaxUtils.getTags(this.slider,"div","indicator")[this.index];this.addEventHandler(this,this.element,"mousedown",this.onDragStart);this.minPrice=_2[0];this.maxPrice=
_2[1];this.setPrice(_3[this.index])},setPrice:function(_5){this.range=this.maxPrice-this.minPrice;this.scale=(Math.log(this.range)+1)/this.slider.offsetWidth;this.width=Math.round(this.element.offsetWidth/2);var _6=(Math.max(Math.log(_5),-1)+1)/this.scale;this.element.style.left=this.WindUtils.toPixels(Math.round(_6-this.width))},getPrice:function(_7){var _8=Math.round(Math.pow(10,Math.LOG10E*(this.scale*(_7+this.width)-1)));return Math.max(Math.min(_8,this.maxPrice),this.minPrice)},onDragStart:function(_9){this.other=
this.parent.controllers[(this.index+1)%2];this.draggingLeft=_9.clientX-this.element.offsetLeft;this.removeEventHandlers(this,document.body);this.addEventHandler(this,document.body,"mouseup",this.onDragStop);this.addEventHandler(this,document.body,"mousemove",this.onDragMove);this.addEventHandler(this,document.body,"selectstart",this.onDragSelect);return false},onDragMove:function(_a){var _b=this.other.element.offsetLeft;var _c=_a.clientX-this.draggingLeft;if(this.index==0)_c=Math.round(Math.min(Math.max(_c,
-this.width),_b));else if(this.index==1)_c=Math.round(Math.min(Math.max(_c,_b),this.slider.offsetWidth-this.width));this.parent.constraint[this.index]=_c>this.width?this.getPrice(_c):this.minPrice;this.element.style.left=this.WindUtils.toPixels(_c);this.parent.showColorbar();return false},onDragStop:function(_d){this.removeEventHandlers(this,document.body,"mouseup",this.onDragStop);this.removeEventHandlers(this,document.body,"mousemove",this.onDragMove);this.parent.sendRequest();return false},onDragSelect:function(_e){return false}}).endType();
vjo.ctype("vjo.darwin.domain.finding.navigation.aspects.price.PriceAspectSlider").needs("vjo.darwin.domain.finding.navigation.aspects.price.PriceAspectController").inherits("vjo.darwin.domain.finding.navigation.aspects.price.PriceAspect").protos({PriceAspectController:vjo.darwin.domain.finding.navigation.aspects.price.PriceAspectController,constructs:function(_1,_2){this.base(_1,_2)},buildContent:function(){var _3=this.model.ranges;if(_3.length<2)_3.push(this.AjaxUtils.cloneObject(_3[0]));this.element=
this.AjaxUtils.getTag(this.root.content,"div","asr-price-s");this.colorbar=this.AjaxUtils.getTag(this.element,"span","colorbar");this.controllers=new Array;this.range=this.getPriceRange(_3[0].value);this.constraint=this.getPriceRange(_3[1].value);if(this.constraint[0]==null)this.constraint[0]=this.range[0];if(this.constraint[1]==null)this.constraint[1]=this.range[1];this.constraint[1]=Math.min(this.constraint[1],this.range[1]);this.controllers.push(new this.PriceAspectController(this,this.range,this.constraint,
0));this.controllers.push(new this.PriceAspectController(this,this.range,this.constraint,1));this.indicators=new Array;this.indicators.push(this.controllers[0].indicator);this.indicators.push(this.controllers[1].indicator);this.showColorbar()},showColorbar:function(){this.width=Math.round(this.controllers[0].element.offsetWidth/2);var _4=this.controllers[0].element.offsetLeft+this.width;var _5=this.controllers[1].element.offsetLeft+this.width;this.colorbar.style.left=this.WindUtils.toPixels(Math.min(_4,
_5)-1);this.colorbar.style.width=this.WindUtils.toPixels(Math.abs(_5-_4));this.showIndicators()},showIndicators:function(){var _6=this.element.offsetWidth;this.indicators[0].innerHTML=this.formatPrice(this.constraint[0]);this.indicators[1].innerHTML=this.formatPrice(this.constraint[1]);var _7=this.indicators[0].offsetWidth;var _8=this.indicators[1].offsetWidth;var _9=this.controllers[0].element.offsetLeft;var _a=this.controllers[1].element.offsetLeft;var _b=Math.max(_9-_7/2+this.width,-this.width);
_b=Math.min(_b,_6-_7+this.width);var _c=Math.max(_a-_8/2+this.width,-this.width);_c=Math.min(_c,_6-_8+this.width);this.indicators[0].style.left=this.WindUtils.toPixels(_b);this.indicators[1].style.left=this.WindUtils.toPixels(_c);var _d=_b+_7+4>_c;if(_d==false)return;var _e=Math.round((_9+_a)/2+this.width);_e=Math.max(_e-_7-2,-this.width)+_7+2;_e=Math.min(_e+_8+2,_6+this.width)-_8-2;this.indicators[0].style.left=this.WindUtils.toPixels(_e-_7-2);this.indicators[1].style.left=this.WindUtils.toPixels(_e+
2);var _f=0;if(this.element.offsetWidth!==0)_f=Math.round(_e/this.element.offsetWidth);this.controllers[_f].element.style.zIndex=1;this.controllers[(_f+1)%2].element.style.zIndex=2},sendRequest:function(){var _10=this.panel.getRequest();_10.params["_mPrRngCbx"]=1;_10.params["_udlo"]=this.constraint[0];_10.params["_udhi"]=this.constraint[1];delete _10.params["_pgn"];delete _10.params["LH_Price"];return this.panel.sendRequest(_10)},getPriceRange:function(_11){var _12=_11.match(/(.*)?\.\.(.*)?/);return[_12[1]?
Math.round(_12[1]):null,_12[2]?Math.round(_12[2]):null]},formatPrice:function(_13){switch(this.model.currencyPattern){case "Nes":return this.formatter.format(_13).concat(" ",this.model.currencySymbol);case "Ns":return this.formatter.format(_13).concat(this.model.currencySymbol);case "Sen":return this.model.currencySymbol.concat(" ",this.formatter.format(_13));case "Sn":return this.model.currencySymbol.concat(this.formatter.format(_13));case "seN":return this.model.currencySymbol.concat(" ",this.formatter.format(_13));
case "sN":return this.model.currencySymbol.concat(this.formatter.format(_13));default:return this.formatter.format(_13).concat(" ",this.model.currencySymbol)}}}).endType();vjo.darwin.domain.finding.navigation.aspects.AspectRollup.typedModels["PriceAspectRollupModel.slider"]=vjo.darwin.domain.finding.navigation.aspects.price.PriceAspectSlider;

