!function(e,t){"use strict";if(storageOK&&"3rd"==localStorage.GenkiEdition&&/\/privacy\/|\/report\/|\/help\/|\/donate\/|\/download\//.test(e.location.pathname)&&(t.getElementById("home-link").href+="lessons-3rd/",t.getElementById("footer-home").href+="lessons-3rd/"),t.getElementById("announcement")){e.GenkiAnn={rotation:!1,edition:/lessons-3rd/.test(e.location.pathname)?"3rd":"2nd",msg:[{date:"12/23/25",content:'Check out our last progress update for the year! Wishing you a Merry Christmas and a Happy New Year! See you next year!'},{date:"11/19/25",content:'Work on our new project is going well so far thanks to everyone\'s feedback! Click here to read our progress update and to see a preview of the new website.'},{date:"10/17/25",content:'We\'d like to hear from you! Please click here to take the survey for our new project.'},{date:"9/29/25",content:'IMPORTANT: If any exercises are missing, it is because The Japan Times requested their removal. Please click here for more details.'},{date:"9/20/25",content:'The 2nd Edition resources have been upgraded. Please click here for more details.'},{date:"9/11/25",content:'IMPORTANT: The 3rd Edition resources have been removed at the request of The Japan Times. Please click here for more details.'},{date:"6/6/25",content:'Quartet Study Resources is now available! Click here to learn more about this new Japanese practice website.'},{date:"5/22/25",content:'From today on, I will be streaming the development progress of Quartet Study Resources on Twitch each day to share the process of building these websites. Click here for more information, such as my schedule.'},{date:"5/13/25",content:'You can now choose what exercises you want to practice for the Random Exercise Button via the settings manager! Click here to learn more about this new setting.'},{date:"5/9/25",content:'You can now change the interface language of the website to 日本語 via the settings manager! Click here to learn more about this new setting.'},{date:"4/8/25",content:'The Genki Grammar Index is now complete! If you notice any typos or have any suggestions, please don\'t hesitate to let us know on GitHub. Happy Studying!'},{date:"2/10/25",content:'You can now change the main theme color to the Genki II color scheme via the settings manager! Click here to learn more about this new setting.'},{date:"1/15/25",content:'Happy New Year! With the new year, comes new projects! Click here to learn about what I have planned for 2025.'},{date:"12/14/24",content:'I\'ve been slowly rolling out ads on my website recently. They\'re optional for this project, however, so please click here to learn more about this update.'},{date:"10/26/24",content:'Click here to learn about the recent updates made to the website as well as my future plans.'},{content:'Interested in learning Japanese? Check out our guide for more information on how to learn the language, as well as useful tools that you can utilize in your studies!'},{edition:"2nd",content:'Looking for more self-study resources? Visit the official self-study room for Genki or check out some of the resources in the readme on GitHub.'},{edition:"3rd",content:'Looking for more self-study resources? Visit the official self-study room for Genki or check out some of the resources in the readme on GitHub.'},{content:'Want to stay up to date on the latest changes made to Genki Study Resources? You can follow updates via GitHub, Twitter, or Ko-fi. Feel free to also contact us on the forum if you have any questions or feedback.'},{content:'Have a question about the site? Check out the FAQ! If you can't find an answer to your question, feel free to contact us via GitHub's issues and we'll try to answer your question in a timely manner."},{content:'Find a bug or mistake on the site? Want to submit a suggestion or give us feedback? Check out the report page for more information. We'd love to hear from you!"},{content:"Don't have a network connection all the time? Genki Study Resources can be used offline as well! Head on over to the download page to get the latest release.'},{content:'If you found this tool helpful for studying with Genki, please consider making a donation to help support my work. Thank you!'}],index:0,list:t.getElementById("announce-list"),next:function(t,n){GenkiAnn.msg[GenkiAnn.index].className+=" announce-hidden","number"==typeof t?(GenkiAnn.index+=t,-1==GenkiAnn.index&&(GenkiAnn.index=GenkiAnn.msg.length-1)):GenkiAnn.index++,GenkiAnn.msg[GenkiAnn.index]||(GenkiAnn.index=0),GenkiAnn.msg[GenkiAnn.index].className=GenkiAnn.msg[GenkiAnn.index].className.replace(" announce-hidden",""),GenkiAnn.rotation&&n&&(e.clearInterval(GenkiAnn.rotator),GenkiAnn.rotate())},rotate:function(){GenkiAnn.rotator=e.setInterval(GenkiAnn.next,15e3)},init:function(){if(GenkiAnn.msg.length>1){t.getElementById("announcement-controls").style.display="";for(var e=0,n=GenkiAnn.msg.length,o="",a=!0;e'+(GenkiAnn.msg[e].date?''+GenkiAnn.msg[e].date+"":"")+GenkiAnn.msg[e].content+"",a&&(a=!1));GenkiAnn.list.insertAdjacentHTML("beforeend",o),GenkiAnn.msg=t.querySelectorAll(".announcement"),GenkiAnn.rotation&&GenkiAnn.rotate()}}};var n=new Date,o=n.getMonth()+1,a=n.getDate();if(12==o&&25==a){GenkiAnn.msg.splice(0,0,{content:"今日きょうはクリスマスだよ。メリークリスマス!"});var r=t.getElementById("announcement");r.style.position="relative",r.style.paddingBottom="25px",r.style.marginBottom="75px",r.insertAdjacentHTML("beforeend",'
")}else 10==o&&31==a?(GenkiAnn.msg.splice(0,0,{content:"ハッピーハロウィン!お菓子かしをくれないとイタズラしちゃうぞ!"}),e._scrollSpider={config:{side:"right",offset:"0px",tooltip:"Squash..?",image:getPaths()+"resources/images/holiday/halloween.png",web:"background-color:#000;width:2px;height:999em;position:absolute;right:42%;bottom:95%;"},move:function(){_scrollSpider.spider.style.top=(t.body.scrollTop+t.documentElement.scrollTop)/(t.documentElement.scrollHeight-t.documentElement.clientHeight)*100+"%"},goingUp:!1,toTop:function(){if(!_scrollSpider.goingUp&&(t.body.scrollTop||t.documentElement.scrollTop)){var n=t.body.scrollTop?t.body:t.documentElement;_scrollSpider.goingUp=!0,_scrollSpider.scroll={top:n.scrollTop,body:n,by:(t.documentElement.scrollHeight-t.documentElement.clientHeight)/100,window:e.setInterval(function(){_scrollSpider.scroll.top>0?(_scrollSpider.scroll.body.scrollTop=_scrollSpider.scroll.top-=_scrollSpider.scroll.by,_scrollSpider.move()):(e.clearInterval(_scrollSpider.scroll.window),_scrollSpider.goingUp=!1)},10)}}},applyOffset:function(){var t=_scrollSpider.spider.getElementsByTagName("IMG")[0];t&&t.complete?(_scrollSpider.spider.style.marginTop="-"+t.height+"px",_scrollSpider.spider.style.display=""):e.addEventListener("load",_scrollSpider.applyOffset)},init:function(){var n=t.createElement("DIV");n.id="scrollSpider",n.innerHTML='
',n.style.position="fixed",n.style[/left|right/i.test(_scrollSpider.config.side)?_scrollSpider.config.side:"right"]=_scrollSpider.config.offset,n.style.top="0%",n.style.display="none",t.body.appendChild(n),_scrollSpider.spider=n,_scrollSpider.move(),_scrollSpider.applyOffset(),e.addEventListener("scroll",_scrollSpider.move)}},t.addEventListener("DOMContentLoaded",_scrollSpider.init)):1==o&&1==a&&GenkiAnn.msg.splice(0,0,{content:"みなさん、あけましておめでとうございます!今年ことし頑張がんばりましょう!"});GenkiAnn.init()}if("file:"==e.location.protocol||/localhost/.test(e.location.href))for(var s=t.getElementsByTagName("A"),i=0,l=s.length;i');if(storageOK){var d=t.querySelector("footer"),h=t.createElement("LABEL"),p=t.createElement("DIV"),u=t.createElement("A");h.id="light-switch",h.tabIndex=0,h.innerHTML='
",h.onkeyup=function(e){"Enter"==e.key&&this.firstChild.click()},h.firstChild.onchange=function(){var n,o=t.documentElement;if(this.checked?(localStorage.darkMode="on",(n=t.createElement("LINK")).id="dark-mode",n.rel="stylesheet",n.href=getPaths()+"resources/css/stylesheet-dark.min.css",t.head.appendChild(n),o.className+=" dark-mode"):(localStorage.darkMode="off",(n=t.getElementById("dark-mode"))&&t.head.removeChild(n),o.className=o.className.replace(" dark-mode","")),e.KanjiCanvas){KanjiCanvas.darkMode=!!t.querySelector(".dark-mode"),KanjiCanvas.quizOver=!!t.querySelector(".quiz-over");for(var a=t.querySelectorAll(".kanji-canvas"),r=0,s=a.length;rDark Modeダークモード ',u.id="genki-site-settings",u.innerHTML='',u.title="ja"==GenkiLang?"ウェブサイトの設定":"Site Settings",u.href="#",u.onclick=function(){return!t.getElementById("genki-modal")&&(GenkiSettings.manager(),!1)},p.appendChild(h),p.appendChild(u),d.appendChild(p)}else{d=t.querySelector("footer");(p=t.createElement("DIV")).id="light-switch-container",p.innerHTML='Where is Dark Mode?ダークモードはどこ?',d.appendChild(p)}t.addEventListener("keydown",function(e){if(e.ctrlKey&&e.altKey||e.metaKey&&e.shiftKey){var n;switch(e.key.toLowerCase()){case"left":case"arrowleft":n=t.querySelector(".prev-ex");break;case"right":case"arrowright":n=t.querySelector(".next-ex");break;case"e":n=t.getElementById("toggle-exercises");break;case"q":n=t.getElementById("quick-jisho-toggle");break;case"d":n=t.getElementById("light-switch");break;case"f":n=t.getElementById("toggle-furigana");break;case"r":n=t.getElementById("random-exercise");break;case"m":n=t.getElementById("genki-site-settings");break;case"c":n=t.getElementById("check-answers-button");break;case"l":GenkiSettings.updateLang(null,"ja"==GenkiLang?"en":"ja")}n&&(e.preventDefault(),n.click())}if("multi"==Genki.active.type&&e.altKey){var o=e.code.replace("Key","").toUpperCase(),a=t.querySelector("#quiz-q"+Genki.stats.solved+' div[data-option="'+o+'"]');a&&(a.click(),e.preventDefault())}})}(window,document);