var userInsight,submitState,cbtRecruitment,preregist;document.addEventListener("DOMContentLoaded",function(){function a(){l.classList.toggle("open");c.classList.toggle("open");g.classList.toggle("open");w.classList.toggle("open");setTimeout(function(){l.classList.contains("open")&&(b.classList.add("none"),k.classList.add("none"))},400);l.classList.contains("open")?nt=h:(w.classList.remove("open"),b.classList.remove("none"),k.classList.remove("none"),btnActive=!0)}var t,s,p,h,v,e,r,u,o,f;const y=window.innerHeight;t=navigator.userAgent;s=window.navigator.userAgent.toLowerCase();p=s.indexOf("ipad")>-1||s.indexOf("macintosh")>-1&&"ontouchend"in document;t.indexOf("iPhone")>0||t.indexOf("Android")>0&&t.indexOf("Mobile")>0?document.querySelector("body").classList.add("sp"):t.indexOf("iPad")>0||t.indexOf("Android")>0||1==p?document.querySelector("body").classList.add("tab"):document.querySelector("body").classList.add("pc");let n=document.querySelectorAll(".touch"),d=Array.prototype.slice.call(n,0);n&&d.forEach(function(t,i){n[i].addEventListener("touchstart",function(){n[i].classList.add("hover")});n[i].addEventListener("touchend",function(){n[i].classList.remove("hover")});n[i].addEventListener("mouseenter",function(){n[i].classList.add("hover")});n[i].addEventListener("mouseleave",function(){n[i].classList.remove("hover")})});new SmoothScroll('.btn-top a[href*="#"]',{speed:400,speedAsDuration:!0,easing:"easeInOutQuad",updateURL:!1});new SmoothScroll('.nav li a[href*="#"],.bottom a[href*="#"]',{speed:400,speedAsDuration:!0,easing:"easeInOutQuad",updateURL:!1,offset:function(){return document.querySelector("body").classList.contains("pc")?120:document.querySelector("body").classList.contains("tab")?0:100}});window.addEventListener("scroll",function(){h=document.documentElement.scrollTop||document.body.scrollTop});h=0;const c=document.querySelector(".nav-icon"),g=document.querySelector("body"),l=document.querySelector("header"),w=document.querySelector(".container"),b=document.querySelector(".main"),k=document.querySelector("footer");c.addEventListener("click",a);let nt=0;if(!document.querySelector("body").classList.contains("pc")){let n=document.querySelectorAll(".nav li");function t(){a();c.addEventListener("click",a)}Array.prototype.slice.call(n,0).forEach(function(n){n.addEventListener("click",t)})}if(!document.querySelector(".container").classList.contains("complete")){let pt=0,p=imagesLoaded("#container",{background:".load"});p.on("progress",function(){pt++;bt=Math.ceil(pt/ri*100)});const wt=["https://static.nexon.co.jp/retos/official/pc_swordsman_stand_tiny.png","https://static.nexon.co.jp/retos/official/pc_swordsman_attack_tiny.png","https://static.nexon.co.jp/retos/official/pc_cleric_stand_tiny.png","https://static.nexon.co.jp/retos/official/pc_cleric_attack_tiny.png","https://static.nexon.co.jp/retos/official/pc_wizard_stand_tiny.png","https://static.nexon.co.jp/retos/official/pc_wizard_attack_tiny.png","https://static.nexon.co.jp/retos/official/fellow_paladin_stand_tiny.png","https://static.nexon.co.jp/retos/official/fellow_paladin_attack_tiny.png","https://static.nexon.co.jp/retos/official/fellow_elementalist_stand_tiny.png","https://static.nexon.co.jp/retos/official/fellow_elementalist_attack_tiny.png","https://static.nexon.co.jp/retos/official/fellow_fencer_stand_tiny.png","https://static.nexon.co.jp/retos/official/fellow_fencer_attack_tiny.png","https://static.nexon.co.jp/retos/official/kupole_gabija_stand_tiny.png","https://static.nexon.co.jp/retos/official/kupole_gabija_skill_tiny.png","https://static.nexon.co.jp/retos/official/kupole_austeja_stand_tiny.png","https://static.nexon.co.jp/retos/official/kupole_austeja_skill_tiny.png","https://static.nexon.co.jp/retos/official/kupole_saule_stand_tiny.png","https://static.nexon.co.jp/retos/official/kupole_saule_skill_tiny.png","https://static.nexon.co.jp/retos/official/monster_simorph_stand_tiny.png","https://static.nexon.co.jp/retos/official/monster_simorph_dmg_tiny.png","https://static.nexon.co.jp/retos/official/monster_simorph_dead_tiny.png","https://static.nexon.co.jp/retos/official/monster_iltiswort_stand_tiny.png","https://static.nexon.co.jp/retos/official/monster_iltiswort_dmg_tiny.png","https://static.nexon.co.jp/retos/official/monster_iltiswort_dead_tiny.png","https://static.nexon.co.jp/retos/official/monster_spector_stand_tiny.png","https://static.nexon.co.jp/retos/official/monster_spector_dmg_tiny.png","https://static.nexon.co.jp/retos/official/monster_spector_dead_tiny.png"];!function(){for(i=0;i<wt.length;i++)document.createElement("img").src=wt[i]}();let ri=p.images.length,bt=0,nt=0,ui=setInterval(function(){nt>=100?(clearInterval(ui),setTimeout(function(){document.querySelector(".loader-screen").classList.add("is-load");document.querySelector(".loader").classList.add("is-load");document.querySelector(".loader-screen").addEventListener("animationend",function(n){n.target.parentNode.removeChild(n.target);document.querySelector(".loader").parentNode.removeChild(document.querySelector(".loader"))},!0);document.querySelector(".container").classList.remove("is-none");document.querySelector(".container").classList.add("is-complete");setTimeout(function(){document.querySelector(".bg-change .change-top").classList.add("on")},100);let n=location.href;-1!=n.lastIndexOf("#")&&setTimeout(function(){let t=n.substr(n.lastIndexOf("#"),n.length);var i=new SmoothScroll,r=document.querySelector(t);i.animateScroll(r,{speed:400,speedAsDuration:!0,easing:"easeInOutQuad",offset:function(){return document.querySelector("body").classList.contains("pc")?120:document.querySelector("body").classList.contains("tab")?0:100}})},1800);document.querySelector(".bg-change .change-top").classList.add("fm")},800)):nt<bt&&nt++},10);p.on("done",function(){for(var n=0,t=p.images.length;n<t;n++)p.images[n].isLoaded});const kt=document.querySelector(".modal"),fi=document.querySelectorAll(".m-close");let ei=Array.prototype.slice.call(fi,0);function dt(){sctop=document.documentElement.scrollTop||document.body.scrollTop;let n=document.querySelectorAll(".is-anime");Array.prototype.slice.call(n,0).forEach(function(t,i){let r=window.pageYOffset||document.documentElement.scrollTop,u=Math.floor(n[i].getBoundingClientRect().top+r);sctop>u-y+y/3.75&&n[i].classList.add("on")})}document.querySelector(".l-top .btn-mv a").addEventListener("click",function(n){n.preventDefault(),function(n){switch(kt.classList.add("modal-open"),n){case"line":document.querySelector(".modal .line").classList.add("block");break;case"twitter":document.querySelector(".modal .twitter").classList.add("block");break;case"mail":document.querySelector(".modal .mail").classList.add("block");break;case"caution":document.querySelector(".modal .caution").classList.add("block");break;case"movie":document.querySelector(".modal .movie").classList.add("block");break;case"winApp":document.querySelector(".modal .win-app").classList.add("block")}}("movie"),function(n){const t=document.querySelector(".modal .movie");if(document.querySelector(".modal .movie .video-player").innerHTML="",t.classList.contains("block")){let t=document.createElement("iframe");t.setAttribute("src","https://www.youtube.com/embed/"+n+"?rel=0&showinfo=0&hd=1&vq=hd1080&autoplay=0&version=3");t.setAttribute("frameborder","0");setTimeout(function(){document.querySelector(".modal .movie .video-player").appendChild(t)},400)}}("_kNdnDfmKeA")});document.querySelector("body").classList.contains("pc");ei.forEach(function(n){n.addEventListener("click",function(n){n.preventDefault(),function(){kt.classList.remove("modal-open");document.querySelector(".modal .movie .video-player").innerHTML="";const n=document.querySelectorAll(".modal .wrap > section,.modal .wrap > div");Array.prototype.slice.call(n,0).forEach(function(n){n.classList.remove("block")})}()})});window.addEventListener("scroll",dt);dt();navigator.userAgent.indexOf("Android")>0&&(v=screen.orientation||screen.mozOrientation||screen.msOrientation,"portrait-secondary"!==v.type&&"landscape-primary"!==v.type||!0);window.addEventListener("orientationchange",function(){document.querySelector(".landscape").style.display=0===window.orientation?"none":"block"});const w={name:"ソードマン",attack:20,def:35,attr:"thunder",num:3},ut={name:"ウィカン・セレスティック",attack:45,def:10,attr:"thunder",num:1},ft={name:"アウステヤ",attack:8,def:20,attr:"thunder",num:2};let n={};n.attack=100+w.attack;n.def=w.def;n.num=0;let b=!0,et=!0,a=0,d=0;const oi=document.querySelector(".l-feature .btn-attack"),c=document.querySelector(".l-feature .enemy-damage");document.querySelector(".l-feature .txt-property");oi.addEventListener("click",function(){b&&(b=!1,d=g(n.def,n.attack),c.textContent=d*n.num,setTimeout(function(){c.classList.add("is-in")},420),setTimeout(function(){c.classList.remove("is-in")},2e3),a++,1==a&&(l(".class","stand","attack"),l(".fellow","stand","attack"),l(".enemy","stand","attack",600,2e3),setTimeout(function(){document.querySelector(".enemy").classList.add("is-damage")},600),setTimeout(function(){document.querySelector(".enemy").classList.remove("is-damage")},1200),n.attack=100+w.attack+ut.attack+ft.attack,n.def=w.def+ut.def+ft.def,n.attr="fire",n.num=6,c.textContent=d*n.num),2==a&&(l(".class","stand","attack"),l(".fellow","stand","attack"),l(".kupole","stand","attack"),l(".enemy","stand","attack",900,2e3),ii()),a>=3&&(et=!1,l(".class","stand","attack"),l(".fellow","stand","attack"),l(".kupole","stand","attack"),ii(),n.attack=100+ot[t-1].attack+st[s-1].attack+ht[h-1].attack,n.def=ot[t-1].def+st[s-1].def+ht[h-1].def,function(t,i,r){let u=0,f=0,e=0;const o=[t,i,r];Array.prototype.forEach.call(o,function(n){"thunder"==n.attr&&(u+=n.num);"fire"==n.attr&&(f+=n.num);"holy"==n.attr&&(e+=n.num)});u>f&&u>e?(n.attr="thunder",n.num=u):f>u&&f>e?(n.attr="fire",n.num=f):e>u&&e>f&&(n.attr="holy",n.num=e);u==f&&u==e&&(n.attr="thunder",n.num=u)}(ot[t-1],st[s-1],ht[h-1]),"thunder"==n.attr?c.classList.add("green"):"fire"==n.attr?c.classList.add("red"):"holy"==n.attr&&c.classList.add("white"),c.textContent=d*n.num))});const ot=[w,{name:"ウィザード",attack:50,def:5,attr:"fire",num:2},{name:"クレリック",attack:40,def:15,attr:"holy",num:1}],st=[ut,{name:"ソルシャ・ハートン",attack:35,def:20,attr:"fire",num:1},{name:"ヴァレンティナス・ナイモン",attack:15,def:40,attr:"holy",num:3}],ht=[ft,{name:"ガビヤ",attack:20,def:8,attr:"fire",num:3},{name:"サウレ",attack:14,def:14,attr:"holy",num:2}];let t=1,s=1,h=1,k=1,ct=!1,lt=!1,at=!1,gt=window.navigator.userAgent.toUpperCase(),si=!1;document.querySelector("body").classList.contains("pc")&&-1===gt.indexOf("MSIE")&&gt.indexOf("TRIDENT");c.addEventListener("transitionend",function(n){"opacity"==n.propertyName&&(c.classList.contains("is-in")||(setTimeout(function(){b=!0;document.querySelector(".btn-attack").classList.add("is-disable");a<=1&&document.querySelector(".btn-help").classList.remove("is-disable");2==a&&document.querySelector(".btn-change").classList.remove("is-disable");a>=3&&(document.querySelector(".btn-retry").classList.remove("is-disable"),c.classList.remove("red"),c.classList.remove("green"),c.classList.remove("white"))},400),si=!0))});document.querySelector(".btn-help").addEventListener("click",function(){!function(){1==a&&(document.querySelector(".fellow").classList.remove("is-disable"),document.querySelector(".fellow").classList.add("is-visible"),document.querySelector(".kupole").classList.remove("is-disable"),document.querySelector(".kupole").classList.add("is-visible"));a<=2&&setTimeout(function(){document.querySelector(".btn-attack").classList.remove("is-disable");document.querySelector(".btn-help").classList.add("is-disable")},100)}()});let ni=!0;function ti(){ni&&(document.querySelector(".btn-attack").classList.remove("is-disable"),document.querySelector(".attr-class").classList.remove("attr-0"+t),document.querySelector(".attr-fellow").classList.remove("attr-0"+s),document.querySelector(".attr-kupole").classList.remove("attr-0"+h),t=g(2,3),s=g(1,3),h=g(1,3),document.querySelector(".class").classList.remove("class-01","class-02","class-03"),document.querySelector(".fellow").classList.remove("fellow-01","fellow-02","fellow-03"),document.querySelector(".kupole").classList.remove("kupole-01","kupole-02","kupole-03"),document.querySelector(".class").classList.remove("is-visible"),document.querySelector(".fellow").classList.remove("is-visible"),document.querySelector(".kupole").classList.remove("is-visible"),document.querySelector(".attr-class").classList.add("attr-0"+t),document.querySelector(".attr-fellow").classList.add("attr-0"+s),document.querySelector(".attr-kupole").classList.add("attr-0"+h),document.querySelector(".btn-class").classList.remove("is-disable"),document.querySelector(".btn-fellow").classList.remove("is-disable"),document.querySelector(".btn-kupole").classList.remove("is-disable"),document.querySelector(".enemy-wrap").classList.remove("is-visible"),document.querySelector(".enemy").classList.remove("die"),document.querySelector(".enemy").classList.remove("enemy-0"+k),k++,k>3&&(k=1),document.querySelector(".enemy").classList.add("enemy-0"+k),document.querySelector(".enemy").classList.add("stand"),setTimeout(function(){document.querySelector(".class").classList.add("class-0"+t);document.querySelector(".fellow").classList.add("fellow-0"+s);document.querySelector(".kupole").classList.add("kupole-0"+h);document.querySelector(".attr-class").classList.remove("is-disable");document.querySelector(".attr-fellow").classList.remove("is-disable");document.querySelector(".attr-kupole").classList.remove("is-disable");document.querySelector(".class").classList.add("is-visible");document.querySelector(".fellow").classList.add("is-visible");document.querySelector(".kupole").classList.add("is-visible");document.querySelector(".enemy-wrap").classList.add("is-visible")},600))}function vt(n){et&&("class"==n?ct||(ct=!0,document.querySelector(".class").classList.remove("is-visible"),document.querySelector(".class").classList.add("is-out"),document.querySelector(".attr-class").classList.remove("attr-0"+t),setTimeout(function(){document.querySelector(".class").classList.remove("is-out");document.querySelector(".class").classList.add("is-visible");document.querySelector(".class").classList.remove("class-0"+t);t>=3?t=1:t++;document.querySelector(".class").classList.add("class-0"+t);document.querySelector(".attr-class").classList.add("attr-0"+t);document.querySelector(".class").addEventListener("animationend",function(){document.querySelector(".class").classList.contains("is-out")||(ct=!1)})},800)):"fellow"==n?lt||(lt=!0,document.querySelector(".fellow").classList.remove("is-visible"),document.querySelector(".fellow").classList.add("is-out"),document.querySelector(".attr-fellow").classList.remove("attr-0"+s),setTimeout(function(){document.querySelector(".fellow").classList.remove("is-out");document.querySelector(".fellow").classList.add("is-visible");document.querySelector(".fellow").classList.remove("fellow-0"+s);s>=3?s=1:s++;document.querySelector(".fellow").classList.add("fellow-0"+s);document.querySelector(".attr-fellow").classList.add("attr-0"+s);document.querySelector(".fellow").addEventListener("animationend",function(){document.querySelector(".fellow").classList.contains("is-out")||(lt=!1)})},800)):"kupole"==n&&(at||(at=!0,document.querySelector(".kupole").classList.remove("is-visible"),document.querySelector(".kupole").classList.add("is-out"),document.querySelector(".attr-kupole").classList.remove("attr-0"+h),setTimeout(function(){document.querySelector(".kupole").classList.remove("is-out");document.querySelector(".kupole").classList.add("is-visible");document.querySelector(".kupole").classList.remove("kupole-0"+h);h>=3?h=1:h++;document.querySelector(".kupole").classList.add("kupole-0"+h);document.querySelector(".attr-kupole").classList.add("attr-0"+h);document.querySelector(".kupole").addEventListener("animationend",function(){document.querySelector(".kupole").classList.contains("is-out")||(at=!1)})},800))))}function l(n,t,i,r,u){void 0===r&&(r=0);setTimeout(function(){document.querySelector(n).classList.remove(t);document.querySelector(n).classList.add(i)},r);void 0===u&&(u=1e3);setTimeout(function(){document.querySelector(n).classList.remove(i);document.querySelector(n).classList.add(t)},u)}function ii(){setTimeout(function(){document.querySelector(".enemy").classList.remove("stand");document.querySelector(".enemy").classList.add("attack");document.querySelector(".enemy").classList.add("is-damage")},600);setTimeout(function(){document.querySelector(".enemy").classList.remove("stand");document.querySelector(".enemy").classList.remove("attack");document.querySelector(".enemy").classList.add("die");document.querySelector(".enemy").classList.remove("is-damage");document.querySelector(".enemy").classList.add("is-die")},2e3);setTimeout(function(){document.querySelector(".enemy").classList.remove("is-die")},3200)}function g(n,t){return Math.floor(Math.random()*(t+1-n))+n}document.querySelector(".txt-tap").addEventListener("animationend",function(n){ni=!0;"tapFadeOut"!==n.animationName&&"tapFadeOut_sp"!==n.animationName||(document.querySelector(".txt-tap").classList.add("is-disable"),b=!0)});document.querySelector(".btn-change").addEventListener("click",function(){document.querySelector(".txt-tap").classList.remove("is-disable");ti();b=!1;setTimeout(function(){document.querySelector(".btn-attack").classList.remove("is-disable");document.querySelector(".btn-change").classList.add("is-disable")},500)});document.querySelector(".btn-retry").addEventListener("click",function(){ti();document.querySelector(".btn-retry").classList.add("is-disable");et=!0});document.querySelector(".btn-class").addEventListener("click",function(){vt("class")});document.querySelector(".btn-fellow").addEventListener("click",function(){vt("fellow")});document.querySelector(".btn-kupole").addEventListener("click",function(){vt("kupole")});var tt=document.querySelector("body").classList.contains("pc"),it=document.querySelector("body").classList.contains("sp"),rt=document.querySelector("body").classList.contains("tab");function yt(n){let t=document.querySelectorAll(".nav li"),i=Array.prototype.slice.call(t,0);t&&i.forEach(function(n,i){t[i].classList.remove("active")});document.querySelector(n).classList.add("active")}tt?(e=0,r=1080,u=2100,o=4700,f=500):it?(e=0,r=560,u=1160,o=2830,f=250):rt&&(e=0,r=1020,u=2400,o=5930,f=500);document.querySelector(".bg-change .change-top .layer-04-03").addEventListener("animationend",function(n){"transTop04_2_Layer_sp"===n.animationName&&document.querySelector(".bg-change .change-top").classList.remove("fm")});window.addEventListener("scroll",function(){sctop=document.documentElement.scrollTop||document.body.scrollTop;sctop<=r-f&&document.querySelector(".deco-change .change-features").classList.remove("on");sctop>=e&&(document.querySelector(".bg-change .change-top").classList.add("on"),document.querySelector(".bg-change .change-features").classList.remove("on"),document.querySelector(".deco-change .change-features").classList.remove("on"));sctop>r-f&&(document.querySelector(".bg-change .change-top").classList.remove("on"),document.querySelector(".bg-change .change-features").classList.add("on"),document.querySelector(".deco-change .change-features").classList.add("on"));sctop>r&&sctop<=u?yt(".nav .nav-02"):sctop>u&&sctop<=o?yt(".nav .nav-03"):yt(".nav .nav-01")}),{create:function(n,t){function c(n){var r=u.getRandom(0,3),t=new TWEEN.Tween({x:parseInt(i[n].style.left)}).to({x:["+60","-60","+100","-100"][r]+"px"},u.getRandom(1e3,3e3)+1e3).delay(0).start();t.easing(TWEEN.Easing.Quadratic.InOut);t.onUpdate(function(t){i[n].style.left=t.x+"px"});t.onComplete(function(){c(n)})}function l(n){document.querySelector("body").classList.contains("pc")?(h=8e3,o=16e3):(h=2e4,o=28e3);var t=new TWEEN.Tween({y:parseInt(i[n].style.top),alpha:1}).to({y:u.winHeight+150+"px",alpha:0},u.getRandom(h,o)+8e3).delay(0).start();t.easing(TWEEN.Easing.Linear.None);t.onUpdate(function(t){i[n].style.top=t.y+"px"});t.onComplete(function(){i[n].style.top=u.getRandom(-30,-350)+"px";i[n].style.opacity=1;l(n)})}function a(n){u.getRandom(.2,.6);var t=new TWEEN.Tween({transform:1}).to({transform:359},u.getRandom(1e3,4e3)+3e3).delay(0).start();t.easing(TWEEN.Easing.Linear.None);t.onUpdate(function(t){i[n].style.transform="rotate3d(0.05,0.05,0.05,"+t.transform+"deg)"});t.onComplete(function(){a(n)})}var r,s,h,o;this.num=n;this.winWidth=window.innerWidth+20;this.winHeight=window.innerHeight+20;var u=this,i=[],v=document.querySelector(t),f=0,e=0;for(document.querySelector("body").classList.contains("pc")?(f=18,e=36):document.querySelector("body").classList.contains("sp")?(f=10,e=20):document.querySelector("body").classList.contains("tab")&&(f=18,e=36),r=n;r--;)s=document.createElement("div"),s.setAttribute("class","child-fly"),this.fly=v.appendChild(s),this.fly.style.left=this.getRandom(-this.winWidth/2,this.winWidth+this.winWidth/2)+"px",this.fly.style.top=this.getRandom(150,-550)+"px",this.fly.style.width=this.getRandom(f,e)+"px",this.fly.style.height=this.getRandom(17,34)+"px",this.fly.style.opacity=1,r%2&&(this.fly.style.transform="scaleX(-1)"),i.push(u.fly);for(r=0;r<i.length;r++)a(r),c(r),l(r);o=0;requestAnimationFrame(function n(t){requestAnimationFrame(n);TWEEN.update(t)})},getRandom:function(n,t){return Math.floor(Math.random()*(t+1-n))+n}}.create(14,".leaf-drop")}});window.onload=function(){let n=document.querySelectorAll(".preload"),t=Array.prototype.slice.call(n,0);n&&t.forEach(function(t,i){n[i].classList.remove("preload")})};userInsight=function(){var n=function(n,t,i,r){try{if(_uiconv&&_uiconv.push){var u={id:n,lg_id:t,free_1:i,free_2:r};_uiconv.push(u)}}catch(f){}};$("header.global-menu").on("click","nav li.nav-01",function(){n("retos","","menu","top")}).on("click","nav li.nav-02",function(){n("retos","","menu","features")}).on("click","nav li.nav-03",function(){n("retos","","menu","news")}).on("click","nav li.nav-04",function(){n("retos","","menu","guide")}).on("click","div.sns .btn-tw",function(){n("retos","","menu","follow_twitter")}).on("click","div.sns .btn-line",function(){n("retos","","menu","follow_line")}).on("click","div.sns .btn-yt",function(){n("retos","","menu","follow_youtube")});$("header.l-top").on("click","div.btn-mv",function(){n("retos","","top","movie")}).on("click","div.btn-cbt",function(){n("retos","","top","beta_btn")}).on("click","div.btn-notice",function(){n("retos","","top","news_btn")});$("div.bottom").on("click","div.btn-cbt",function(){n("retos","","top","beta_btn")}).on("click","div.btn-pre",function(){n("retos","","top","pre_btn")});$("section.l-cbt").on("click","button.btn-entry",function(){n("retos","","beta_recruitment","recruitment")}).on("click","div.btn-back",function(){n("retos","","beta_recruitment","backtosite")}).on("click","div.btn-tw",function(){n("retos","","beta_recruitment","official_twitter")});$("section.l-pre").on("click","div.btn-app",function(){n("retos","","pre","apple")}).on("click","div.btn-gp",function(){n("retos","","pre","google")});$("div.modal").on("click","section.line",function(){n("retos","","pre","line")}).on("click","section.twitter .btn-regist",function(){n("retos","","pre","twitter")}).on("click","section.mail",function(){n("retos","","pre","mail")}).on("click","section.caution",function(){n("retos","","pre","agreement")});$("div.modal section.mail").on("click","div.btn-regist",function(){n("retos","","pre_complete","mail")});$("section.l-pre").on("click","div.btn-back",function(){n("retos","","pre_complete","backtosite")}).on("click","div.btn-tw",function(){n("retos","","pre_complete","official_twitter")});$("footer").on("click","div.btn-tw",function(){n("retos","","footer","follow_twitter")}).on("click","div.btn-yt",function(){n("retos","","footer","follow_youtube")}).on("click","div.btn-line",function(){n("retos","","footer","follow_line")});return this};$(function(){userInsight()});submitState={isSubmitting:!1,canSubmit:function(){return!this.isSubmitting},startSubmitting:function(){this.isSubmitting=!0},completed:function(){this.isSubmitting=!1}};$(document).ajaxStart(function(){submitState.startSubmitting()});$(document).ajaxComplete(function(){submitState.completed()});cbtRecruitment=function(){var t={formCbtRecruitment:"#formCbtRecruitment",cbtRecruitmentError:"#cbtRecruitmentError",btnEntry:".btn-entry",osChecked:"input[name=os]:checked",mailAddress:"input[name=mailAddress]",cbtAgreement:"input[name=cbtAgreement]"},n={add:function(n){$(t.cbtRecruitmentError).html(n).show()},clear:function(){$(t.cbtRecruitmentError).empty().hide()}};$(t.btnEntry,t.formCbtRecruitment).on("click",function(i){var r,f,u;if(i.preventDefault(),!submitState.canSubmit())return modalDialog.show("ただいま処理中です。しばらくお待ちください。"),!1;if(r=$(t.formCbtRecruitment),f=r.find(t.osChecked),f.length===0)return n.add("OSが選択されていません。"),!1;if(u=$.trim(r.find(t.mailAddress).val()),u==="")return n.add("メールアドレスが入力されていません。"),!1;if(!/^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(u))return n.add("メールアドレスの形式が正しくありません。"),!1;if(!r.find(t.cbtAgreement).is(":checked"))return n.add("注意事項をご確認の上、同意のチェックを入れてください。"),!1;try{isSubmitting=!0;n.clear();$.ajax({url:"/retos/registCbtUser",type:"POST",data:{__RequestVerificationToken:$("input[name=__RequestVerificationToken ]").val(),os:f.val(),mailAddress:u}}).done(function(t){t.result?document.location="/retos/cbt_complete":n.add(t.message?t.message:"エラーが発生しました。")}).fail(function(){n.add("エラーが発生しました。")})}catch(i){n.add("エラーが発生しました。")}});n.clear()};$(function(){cbtRecruitment()});preregist=function(){var n={sectionMail:"section.mail",errorMessageContainer:"div.error",errorMessage:"#errormsg",email:"#email",eid:"#eid",mailMagazineFlg:"#mailmagazineflg",btnRegist:".btn-regist"},t={show:function(){$(n.errorMessageContainer,n.sectionMail).show()},add:function(t){$(n.errorMessage).html(t);this.show()},clear:function(){$(n.errorMessage).empty();$(n.errorMessageContainer,n.sectionMail).hide()}},i=function(i){var u;i.preventDefault();var f=$(n.mailMagazineFlg).is(":checked"),e=$(n.eid).val(),r=$.trim($(n.email).val());return r===""?(t.add("メールアドレスを入力してください。"),!1):/^(([^<>()[\]\\.,;:\s@\""]+(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(t.clear(),u=registsend("/retos/pre_complete","retos",e,r,f,null,null,null,null,null),u!==200?(t.show(),!1):void 0):(t.add("メールアドレスの形式が正しくありません。"),!1)};$(n.btnRegist,n.sectionMail).on("click",i);t.clear()};$(function(){preregist()})