define(["core"],function(a){return a.create_module("detailsSpecialEventInfo",function(g){var e,c,f,d,b=0; return{el:{btnPrevious:g.find(".prev")[0],btnNext:g.find(".next")[0],btnClose:g.find(".btn_close"),sectionLinks:g.find(".navigation a"),sectionContents:g.find(".subtab")},init:function(){e=this; c=g.getContainer();g.addEvent(e.el.btnPrevious,"click",e.previousBtnClick);g.addEvent(e.el.btnNext,"click",e.nextBtnClick); g.addEvent(e.el.btnClose,"click",e.closeBtnClick);g.addEvent(e.el.sectionLinks,"click",e.sectionLinkClick); g.listen({"open-tab":e.openTab,"close-tab":e.closeTab,subtabDefault:e.defaultState,deactivate_Submenu:e.removeActiveClass,"view-resized":e.viewResized}); g.library({name:"moveModule"},g);this.library.moveModule.init();this.viewResized(); },destroy:function(){e=null;g.ignore(["open-tab","close-tab"]);},sectionLinkClick:function(h){b=h.currentTarget.getAttribute(g.DATA_ATTR+"tab").split("-")[1]; e.changeTab(h);},nextBtnClick:function(h){if(g.hasClass(h.currentTarget.parentNode,"disabled")){h.preventDefault(); return false;}b=h.currentTarget.getAttribute(g.DATA_ATTR+"next").split("-")[1];e.changeTab(h); },previousBtnClick:function(h){if(g.hasClass(h.currentTarget.parentNode,"disabled")){h.preventDefault(); return false;}b=h.currentTarget.getAttribute(g.DATA_ATTR+"prev").split("-")[1];e.changeTab(h); },changeTab:function(i){var h=e.el.sectionContents[b];e.hideSections(e.el.sectionContents); e.removeDisabled();e.removeActiveClass();g.addClass(i.currentTarget,"active");g.show(h); e.initPrevNextLinks();g.addClass(e.el.sectionLinks[b],"active");i.preventDefault(); return false;},initPrevNextLinks:function(){var h=parseInt(b,10)-1,i=h+2;if(i=0){e.el.btnPrevious.setAttribute(g.DATA_ATTR+"prev","jst-"+h); }else{g.addClass(g.parent(e.el.btnPrevious),"disabled");}},hideSections:function(h){g.foreach(h,function(){this.style.display="none"; });},removeActiveClass:function(){g.foreach(e.el.sectionLinks,function(){g.removeClass(this,"active"); });},closeBtnClick:function(){var h=c.getAttribute("id");e.removeActiveClass();e.defaultState(); e.closeTab(h);g.notify({type:"deactivate_menu"});},defaultState:function(){g.foreach(e.el.sectionContents,function(){this.style.display="none"; });e.el.sectionContents[b].style.display="block";g.addClass(e.el.sectionLinks[b],"active"); e.el.btnNext.setAttribute(g.DATA_ATTR+"next","jst-2");e.el.btnPrevious.setAttribute(g.DATA_ATTR+"prev","jst-0"); },removeDisabled:function(){g.removeClass(g.parent(e.el.btnPrevious),"disabled"); g.removeClass(g.parent(e.el.btnNext),"disabled");},openTab:function(h){if(h===c.getAttribute("id")){e.shouldShow(true); e.initPrevNextLinks();}else{e.shouldShow(false);}},closeTab:function(h){if(h){if(h==c.getAttribute("id")){e.shouldShow(false); }}else{e.shouldShow(false);}},shouldShow:function(h){if(h){g.removeClass(c,"hide"); }else{g.addClass(c,"hide");}},viewResized:function(h){var i;if(typeof h==="undefined"){i=g.checkMatchMedia("lessThanDesktop")?"notDesktop":"desktop"; }else{i=h.currentView;}if(i!=="desktop"){e.library.moveModule.to("#eventInfoTab"); }else{if(i=="desktop"){e.library.moveModule.to("#detailsTabs");}}}};});});