(function(Y,j){var U={init:function(){var m=this;m.isIE=m.IEVersion(!1);for(var g=Y(".module[data-type=carousel]"),p=0,c=g.length;p-1&&g.indexOf("MSIE")>-1,c=g.indexOf("Edge")>-1&&!p,o=g.indexOf("Trident")>-1&&g.indexOf("rv:11.0")>-1;return p||c||o?!0:m},richCarouselEvent:function(m,g){m.html(""),m.append('
');var p=this,c=m,o=c.attr("data-canousel")?Y.parseJSON(c.attr("data-canousel")):!1,k=c.find(".screenBox"),X=c.find(".img_ul"),u=c.width(),_=c.height(),J=Y(window),E,Q;if(!o)return!1;var T=o.checkedList,O=T.length<1?["fadeIn"]:T,B=O.length;E={init:function(){this.d=o.list,this.s=o.playTime,this.t=o.changeTime,this.sh=!1,this.renders(),this.nav(),this.timing(),this.canouselEvent()},renders:function(){var a=this,r=this.d,e=this.sh;this.imgLi=c.find(".img_li"),this.imgLi.hide(),this.imgLi.eq(0).show(),this.imgTitle=c.find(".img_title"),k.append('
'),this.index=0,a.navHref(),this.index=r.length<2?0:1,this.preIndex=this.index<1?a.d.length-1:this.index-1,this.cBox=k.find(".canvasBox"),this.changes()},changes:function(a){var r=this,e="fadeIn";if(B>0){var s=parseInt(B*Math.random());e=O[s]}p.isIE&&e=="3DEffect"&&(e="fadeIn"),this.renderFrames(e,a)},renderFrames:function(a,r){var e=this,s="",h=e.d[e.preIndex],l=e.d[e.index],b=this.t,n={duration:function(t){var i="transition-duration:"+t+"s; -moz-transition-duration: "+t+"s; -webkit-transition-duration:"+t+"s;-o-transition-duration:"+t+"s;";return i},delays:function(t){var i="transition-delay:"+t+"s; -moz-transition-delay: "+t+"s; -webkit-transition-delay:"+t+"s;-o-transition-delay:"+t+"s;";return i},rotateX:function(t){var i="transform:rotateX("+t+"deg);-ms-transform:rotateX("+t+"deg);-webkit-transform:rotateX("+t+"deg);";return i},rotateY:function(t){var i="transform:rotateY("+t+"deg);-ms-transform:rotateY("+t+"deg);-webkit-transform:rotateY("+t+"deg);";return i},rotateXYZ:function(t,i,d){var W="transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);-ms-transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);-webkit-transform:rotateX("+t+"deg) rotateY("+i+"deg) translateZ("+d+"px);";return W},translateY:function(t){var i="transform:translateY("+t+");-ms-transform:translateY("+t+");-webkit-transform:translateY("+t+");";return i},translate:function(t,i){var d="transform:translate("+t+","+i+");-ms-transform:translate("+t+","+i+");-webkit-transform:translate("+t+","+i+");";return d},shadesBgImage:function(t,i){var d;return o.adapt=="pp"?d="background:url("+l.src+") -"+i*t+"px 0;":o.adapt=="ls"?d="background-image:url("+l.src+"); background-position: -"+i*t+"px center;background-size:"+u+"px "+_+"px;":d="background-image:url("+l.src+"); background-position: -"+i*t+"px center;background-size:"+u+"px auto;",d},href:function(t){var i="";if(t.href){var d=t.href;d.indexOf("/aroom/#")>-1||d.indexOf("/myroom/#")>-1||d.indexOf("/pay/#")>-1?i='clickUrl="'+h.href+'"':i='href="'+d+'" target="'+t.target+'"'}return i}},L=b/40,P=b/2,y=parseInt(u/20),q=u-y*19,C="";switch(a){case"fadeIn":for(var v=0,A=e.d.length;v':s+='
'}e.coverType=="fadeIn"&&(s=""),e.coverType="fadeIn";break;case"shades":e.coverType="fadeIn",this.cBox.css("overflow","hidden");var N=Math.random()>.5,M=N?function(t,i){return t}:function(t,i){var d=i-1;return d-t},S=parseInt(4*Math.random());switch(S){case 0:mode=N?n.rotateY("-90"):n.rotateY("90");break;case 1:mode=function(t){return t%2==0?n.translateY("-100%"):n.translateY("100%")};break;case 2:mode=n.translateY("-100%");break;case 3:mode=n.translateY("100%");break}for(var v=0;v<20;v++){var z=L*M(v,20),I="";v==19?I=q:I=y,C+='
'}s+='
'+C+"
";break;case"3DEffect":e.coverType="3DEffect",this.cBox.css("overflow","visible");var F=e.cBox.height(),f=F/2,V=parseInt(8*Math.random()),x="",w="";switch(V){case 0:x=n.rotateX(90),w=n.rotateXYZ(-90,0,f);break;case 1:x=n.rotateX(-90),w=n.rotateXYZ(90,0,f);break;case 2:x=n.rotateY(90),f=u/2,w=n.rotateXYZ(0,-90,f);break;case 3:x=n.rotateY(-90),f=u/2,w=n.rotateXYZ(0,90,f);break;case 4:x=n.rotateX(180),f=0,w=n.rotateXYZ(-180,0,f);break;case 5:x=n.rotateX(-180),f=0,w=n.rotateXYZ(180,0,f);break;case 6:x=n.rotateY(180),f=0,w=n.rotateXYZ(0,-180,f);break;case 7:x=n.rotateY(-180),f=0,w=n.rotateXYZ(0,180,f);break}s+='
';break}s&&e.cBox.html(s),this.animates(a,r)},animates:function(a,r){var e=this,s=r?0:e.s,h=r?0:e.t;setTimeout(function(){switch(a){case"fadeIn":var l=e.cBox.find(".img_li");e.imgTitle.hide(),l.eq(e.preIndex).css("opacity","0"),l.eq(e.index).css("opacity","1");break;case"shades":c.find(".shades-box").css({transform:"rotateY(0deg) translateY(0)","-ms-transform":"rotateY(0deg) translateY(0)","-webkit-transform":"rotateY(0deg) translateY(0)",opacity:"1"});break;case"3DEffect":X.css("opacity","0"),k.css("overflow","visible"),c.find(".canvasBox").find(".img_li").css({transform:"rotateX(0deg) rotateY(0deg)","-ms-transform":"rotateX(0deg) rotateY(0deg)","-webkit-transform":"rotateX(0deg) rotateY(0deg)",opacity:"1"});break}e.navHref(),e.navChange()},(s-h)*1e3)},reductions:function(){var a=this,r=a.index+1;r>=a.d.length&&(r=0),a.setTime=setTimeout(function(){a.imgTitle.show(),X.css("opacity","1"),k.css("overflow","hidden"),a.imgLi.hide(),a.imgLi.eq(r).show()},a.t*1e3)},timing:function(){var a=this;if(!o.play&&o.nav)return!1;a.setInterval=setInterval(function(){a.index++,a.index>=a.d.length&&(a.index=0);var r=a.index;a.preIndex=r<1?a.d.length-1:r-1,a.changes()},a.s*1e3)},nav:function(){if(o.nav){for(var a=this,r="",e=o.list.length,s=0;s':r+="
  • ";var h='
      '+r+"
    ";k.append(h),a.carouselNav=k.find(".carouselNav"),a.navEvent()}},navHref:function(){var a=this,r=a.d[a.index],e=c.find(".canvasHref"),s=r.href;s&&(s.indexOf("/aroom/#")>-1||s.indexOf("/myroom/#")>-1||s.indexOf("/pay/#")>-1?(e.attr("clickUrl",s),e.removeAttr("href")):(e.attr("href",s),e.removeAttr("clickUrl")),r.target&&e.attr("target",r.target))},navChange:function(){var a=this;if(a.carouselNav){var r=a.carouselNav.find("li");r.removeClass("on"),r.eq(a.index).addClass("on")}},navEvent:function(){var a=this;if(a.carouselNav){a.carouselNav.hover(function(){clearInterval(a.setInterval)},function(){a.timing()});var r=a.carouselNav.find("li");r.on("click",function(){a.preIndex=a.index,a.index=Y(this).index(),a.changes(!0)})}},canouselEvent:function(){c.on("click","a[clickUrl]",function(a){a.stopPropagation();var r=window.user,e=Y(this).attr("clickUrl"),s=function(l){l=="STUDENT"?e.indexOf("/pay/#")>-1?window.location.href=e.indexOf("/pay/#/")>-1?e:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=e.indexOf("/myroom/#/")>-1?e:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=e.indexOf("/aroom/#/")>-1?e:window.basePath?"/"+window.basePath+"#/":"/#/"},h=function(){r.loginLayer(function(l){l.success&&r.isLogin(function(b){b.success&&s(b.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?r.isLogin(function(l){l.success?s(l.data.userTypeExact):h()}):h()})}},E.init()}};U.init()})(jQuery,window);