var adsDsiplayVerify=function(){var b={},d={isLogin:false,servType:"",productNum:"",tradeType:"",ipRegion:""};this.isInit=false;this.init=function(a){b=YL.merge(d,a);this.isInit=true};this.verify=function(a){if(!this.isInit)return true;if(!YL.isObject(a))return true;for(var c in a){var e=b[c],f=a[c];switch(c){case "isLogin":if(f!==e)return false;break;case "ipRegion":if(f!=e&&!this.contain(e,f))return false}}return true};this.contain=function(a,c){var e=(","+c+",").replace("!","").replace(/,\s*,/g, ",");e=(new RegExp(","+a+",","ig")).test(e);var f=c.substr(0,1)=="!";return e!==f};this.checkTimeIn=function(a){var c;c=AE.bom.getCookie("aisn_home_firstIn");if(c==""){c=new Date;AE.bom.setCookie("aisn_home_firstIn",c,720);return true}else if(c=="expired")return false;else{var e=new Date;c=c;if((Date.parse(e)-Date.parse(c))/1E3<a*3600)return true;else{AE.bom.setCookie("aisn_home_firstIn","expired",720);return false}}}};AE.namespace("AE.widget.SimpleScroll"); AE.widget.SimpleScroll=new (function(){var b=YAHOO.util,d={delay:2,speed:20,startDelay:2,direction:"vertical",disableAutoPlay:false,distance:"auto",scrollItemCount:1};this.decorate=function(a,c){a=get(a);c=YL.merge(d,c||{});if(null!==a){var e=2;if(c.speed<20)e=5;if(c.lineHeight)c.distance=c.lineHeight;e=new b.CustomEvent("_onScroll",handle,false,b.CustomEvent.FLAT);e.subscribe(function(){var g=a.getElementsByTagName("li")[0];if(g){this.distance=c.distance=="auto"?g[isHorizontal?"offsetWidth":"offsetHeight"]: c.distance;with(a)this.scrollable=isHorizontal?scrollWidth-scrollLeft-offsetWidth>=this.distance:scrollHeight-scrollTop-offsetHeight>=this.distance}else this.scrollable=false});var f=function(){if(!handle.paused){handle._distance=0;scrollTimeId=setInterval(scroll,c.speed)}};YUE.on(a,"mouseover",function(){handle.suspend=true});YUE.on(a,"mouseout",function(){handle.suspend=false});handle=YL.merge(handle,{subscribeOnScroll:function(g,h){h===true&&onScrollEvent.subscribers.length>0&&onScrollEvent.unsubscribeAll(); onScrollEvent.subscribe(g)},pause:function(){this.paused=true;clearTimeout(startTimeId);startTimeId=null},play:function(){this.paused=false;startDelayTimeId&&clearTimeout(startDelayTimeId);startTimeId||(startTimeId=setTimeout(f,c.delay*1E3))}});handle.onScroll=handle.subscribeOnScroll;e.fire();c.disableAutoPlay||(startDelayTimeId=setTimeout(function(){handle.play()},c.startDelay*1E3));return handle}}});AE.namespace("AE.app"); AE.app.newcatdp=function(){this.config={rootTarget:get("newcatdp"),subTarget:get("newcatdp-subs"),afterLoadClass:"after-load-subs",itemCurrentClass:"current",afterShowSubClass:"after-show-sub",afterShowNextItemClass:"active-border-color",showDelayTime:50,hiddenDelayTime:50,excursion:[184,0]};this.temp={rootItems:[],subItems:{}};this.onAfterShow=new YAHOO.util.CustomEvent("onAfterShow",this);this.onAfterHide=new YAHOO.util.CustomEvent("onAfterHide",this);return this}; AE.app.newcatdp.prototype={afterShow:function(b,d,a){b=this.config;this.onAfterShow.fire(this);if(a.subItem.offsetHeight+YUD.getY(a.subItem)>YUD.getViewportHeight()+YUD.getDocumentScrollTop()&&a.subItem.offsetHeight+110<YUD.getY(a.subItem)+a.rootItem.offsetHeight){d=YUD.getY(a.subItem)+YUD.getViewportHeight()+YUD.getDocumentScrollTop()-(a.subItem.offsetHeight+YUD.getY(a.subItem));if(d+a.subItem.offsetHeight<YUD.getY(a.subItem)+a.rootItem.offsetHeight+3)d+=YUD.getY(a.subItem)+a.rootItem.offsetHeight+ 3-(d+a.subItem.offsetHeight);YUD.setY(a.subItem,d)}b.afterShowSubClass&&YUD.addClass(b.rootTarget,b.afterShowSubClass);YUD.addClass(a.nextItem,b.afterShowNextItemClass);YUD.addClass(a.rootItem.parentNode,b.itemCurrentClass)},afterHidden:function(b,d,a){b=this.config;this.onAfterHide.fire(this);b.afterShowSubClass&&YUD.removeClass(b.rootTarget,b.afterShowSubClass);YUD.removeClass(a.nextItem,b.afterShowNextItemClass);YUD.removeClass(a.rootItem.parentNode,b.itemCurrentClass)},init:function(b){b=this.config= YL.merge(this.config,b||{});for(var d=b.subTarget.getElementsByTagName("div"),a=0;a<d.length;a++){var c=d[a];this.temp.subItems[trim(c.getAttribute("rel")).toUpperCase()]=c}d=b.rootTarget.getElementsByTagName("a");for(a=0;a<d.length;a++){var e=d[a];c=trim(e.innerText?e.innerText:e.textContent).toUpperCase();if(this.temp.subItems[c]){var f=e.overShow=new AE.widget.overShow;c=this.temp.subItems[c];var g=d[a+1]?d[a+1]:null;f.afterShow.subscribe(this.afterShow,{rootItem:e,subItem:c,nextItem:g},this); f.afterHidden.subscribe(this.afterHidden,{rootItem:e,subItem:c,nextItem:g},this);f.init({targetId:e,contentId:c,showDelayTime:b.showDelayTime,hiddenDelayTime:b.hiddenDelayTime,excursion:b.excursion})}this.temp.rootItems.push(e)}YUD.addClass(b.rootTarget,b.afterLoadClass);AE.bom.isIE&&CollectGarbage();return this}};AE.namespace("AE.app.infiniteScroll"); AE.app.infiniteScroll=function(){this.scrolling=this.isInit=false;this.dItems=null;this.offsetNext=this.offsetPrev=this.inx=0;this.animBy=window.animBy;this.config={scrollBody:"",dataSource:"",direction:"horizontal",showNum:5,step:1,itemWidth:102,speed:34};this.init=function(b){b=this.config=YL.merge(this.config,b);var d=get(b.scrollBody),a=get(b.dataSource);if(!(this.isInit||null==d||null==a)){this.dItems=null;a=this.dItems=YUD.getChildren(a);d.innerHTML="";for(var c=0,e=a.length;c<e;c++)a[c].setAttribute("inx", c);this.updateCnt(this.updateInx(a.length-b.showNum<0?2*a.length-b.showNum:a.length-b.showNum));YUD.setStyle(d,b.direction=="horizontal"?"left":"top",-b.itemWidth*b.showNum+"px");YUD.setStyle(d,"width",3*b.itemWidth*(b.showNum+1)+"px");this.isInit=true;this.onInit.fire()}};this.onInit=new YAHOO.util.CustomEvent("onInit",this);this.onUpdate=new YAHOO.util.CustomEvent("onUpdate",this);this.onScroll=new YAHOO.util.CustomEvent("onScroll",this)}; AE.app.infiniteScroll.prototype=YL.merge(AE.app.infiniteScroll.prototype,{getInx:function(b){var d=this.config,a=this.inx,c=this.dItems.length;if(b=="next"){a+=d.step;if(a>=c)a-=c}else if(b=="prev"){a-=d.step;if(a<0)a+=c}return a},updateInx:function(b){return this.inx=b},getInxGroup:function(b){var d=[],a=YUD.getChildren(this.config.dataSource).length;if(a==0)return d;for(var c=0;c<3*this.config.showNum;c++){if(b>a-1)b=0;d.push(b);b++}return d},updateCnt:function(){var b=this.config,d=get(b.scrollBody); YUD.getChildren(d);var a=b.direction=="horizontal"?"left":"top";d=b.itemWidth*b.step;if(go=="next"){d=-d;this.offsetPrev-=b.step;this.offsetNext+=b.step}else{this.offsetPrev+=b.step;this.offsetNext-=b.step}this.scrolling=true;this.animBy(b.scrollBody,a,d,b.speed,function(){if(_self.offsetPrev==b.showNum||_self.offsetNext==b.showNum){_self.updateCnt(_self.updateInx(_self.getInx(go)));YUD.setStyle(b.scrollBody,a,-b.itemWidth*b.showNum+"px");_self.offsetPrev=_self.offsetNext=0}else _self.updateInx(_self.getInx(go)); _self.scrolling=false;_self.onScroll.fire(go)})},prev:function(){this.scroll("prev")},next:function(){this.scroll("next")}});
