var $window,$document,$html,$body,$html_body,device,os=["",0],is_smart_layout=!1;function escapeHtml(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function getcookie(t){var e=document.cookie+";",a=e.indexOf(t,0);if(-1!=a){var o=(e=e.substring(a,e.length)).indexOf("=",0)+1,s=e.indexOf(";",o);return unescape(e.substring(o,s))}return""}function setcookie(t,e,a,o){a?((exp=new Date).setTime(exp.getTime()+2592e6),document.cookie=t+"="+escape(e)+";expires="+exp.toGMTString()+";domain=yakkun.com;path="+o+";"):document.cookie=t+"="+escape(e)+";expires=Fri, 31-Dec-1999 23:59:59;path="+o+";"}$(function(t){if($window=t(window),$document=t(document),$html=t("html"),$body=t("body"),$html_body=t("html,body"),!device){var e=navigator.userAgent;-1!=e.search(/iPhone/)||-1!=e.search(/iPad/)||-1!=e.search(/iPod/)?(device="iphone",os[0]="ios",-1!=e.search(/iPhone/)?(e.match(/iPhone OS (\w+){1,3}/g),os[1]=RegExp.$1.split("_")):-1!=e.search(/iPad/)&&(e.match(/CPU OS (\w+){1,3}/g),os[1]=RegExp.$1.split("_"))):-1!=e.search(/Android/)?(device="android",os[0]="android"):(device="pc",os[0]="other"),$body.addClass(device)}is_smart_layout=t("body#smart").length>0,t.hashScroll(),$window.on("keydown",function(e){e.keyCode=e.which?e.which:e.keyCode,9==e.keyCode&&0==t(":focus").length&&(0==t("input[tabindex]").length||$body.hasClass("toppage"))&&(t("input[type='search']").eq(0).focus(),e.preventDefault())});var a=t("#menu_holder");if(a.length>0&&("ios"!==os[0]||os[1][0]>=10)){a.css("min-height",a.height());var o=t("#menu"),s=t("#contents"),l=Math.floor(o.offset().top),i=0,n=!1,r=!1,c=function(){if(r){r=!1;return}var t=Math.floor(o.outerHeight());if(!(s.height()<=t)){var e=Math.floor($window.height()),a=Math.floor(o.offset().top),c=a+t,d=Math.floor($window.scrollTop()),u=d+e,f=u>i;n?(f&&ua&&o.hasClass("fixed_bottom")||al&&(o.css("marginTop",0),o.removeClass("fixed_bottom"),o.addClass("fixed_top"),n=!0,r=!0):f&&u>c?u<$body.height()&&(o.css("marginTop",0),o.removeClass("fixed_top"),o.addClass("fixed_bottom"),n=!0,r=!0):!f&&dl&&(o.css("marginTop",0),o.removeClass("fixed_bottom"),o.addClass("fixed_top"),o.offset().top').css({position:"fixed",top:0});e.hide();var a=t(this),o=a.clone(),s=a.find("th"),l=o.find("th");e.append(o),($table=a.closest("table")).before(e);var i=!1,n=function(){$window.scrollTop()>s.offset().top&&$window.scrollTop()<$table.offset().top+$table.height()?(i||r(),e.show(),i=!0):e.hide()},r=function(){for(var t=s.length,e=0;e=0&&(clearTimeout(m),m=-1),t("#mf-GdJiSy,#adx_custom_ol").hide()},n=function(){a=e.get(0).autocomplete_data.dataset,s=e.get(0).autocomplete_data.dataset_h,v>=0&&(clearTimeout(v),v=-1),t("ul.autocomplete_list").remove();var o=!0;$document.on("mousedown.autocomplete",function(a){o=t(a.target).is(e)}),$document.on("click.autocomplete",function(a){return!!o||!!t(a.target).is(e)||(e.is(":focus")&&e.blur(),v>=0&&(clearTimeout(v),v=-1),t("ul.autocomplete_list").remove(),$document.off("click.autocomplete"),!0)});var l=t('
    ');is_smart_layout||l.width(e.outerWidth());var i=[],n=window.localStorage?e.attr("data-autocomplete-save"):null;if(n)try{i=JSON.parse(window.localStorage.getItem("autocomplete-"+n)),null==i&&(i=[])}catch(r){i=[]}n&&e.closest("form").on("submit",function(){var t=e.val();if(""!=t){var a=i.indexOf(t);a>=0&&i.splice(a,1),i.length>=11&&i.pop(),i.unshift(t),window.localStorage.setItem("autocomplete-"+n,JSON.stringify(i))}});var c=function(t){e.val(t).trigger("change",[!0]),l.remove(),e.blur();var a=e.closest("form");if(a.hasClass("autocomplete_auto_focus")||e.hasClass("autocomplete_auto_focus")){var o=e.closest("form").find(":text,:password,textarea").filter(":visible"),s=o.index(e)+1;if(s=2?n.eq(0).click():a.submit()}};if(is_smart_layout&&Date.now()-p>1e3&&$html_body.smoothScroll(e.offset().top-1),$window.off("focus.autocomplete"),0==s.length)for(var d=a.length,u=0;ue[1]?1:-1});var f=void 0;l.click(function(a){var o=t(a.target);if(o.closest("li.clear_history").length>0)return i=[],window.localStorage.removeItem("autocomplete-"+n),f=void 0,e.focus(),!1;var s=o.closest("a").find("span.text").text();return""!=s&&c(s),!1});var h=window.setInterval(function(){if(0!=s.length){var t=e.val();if(f!=t){f=t,l.empty();var o=t.toUpperCase().toHankakuCase().toKatakanaCase().toHankakuCase().replace(/[・::\(\)\[\]]/g,"").replace(/ /g," ");o=o.replace(/^(アローラ|ガラル|ヒスイ|パルデア)/,"$1 ");var n=e.hasClass("autocomplete_show_empty");if(n||""!=o||!(i.length<=0)){var r=s.length,c=0,d=e.attr("data-autocomplete-num");null==d&&(d=12);for(var u=o.split(" "),h=u.length-1;h>=0;h--)""==u[h]&&u.splice(h,1);request_h_list_len=u.length;var p=[];if(n||""!=o){for(var m=[],v=function(t,e){return t[0]>e[0]?1:-1},h=0;hy&&(y=S);for(var T=!1,q=0;q<_;q++)if(!(S<=g[q][0]||C>=g[q][1])){g[q][0]=Math.min(g[q][0],C),g[q][1]=Math.max(g[q][1],S),w--,T=!0;break}T||(g.push([C,S]),_++,0===x&&C>=1&&(k=!0),0!==C||(b+=1e5))}if(!(g.length0&&c>=d)break}}p.sort(function(t,e){return t.order0){for(var h=0;h=0;q--){for(var P=H.length,D=p[h].match_list[q][0],I=p[h].match_list[q][1],x=0;x"+H.slice(D,I)+""+H.slice(I)}H=H.replace("(",'(').replace(")",")"),l.append("'+H+""+(null!=p[h].dataset.sub?''+p[h].dataset.sub+"":"")+"")}l.find("li:first-child").addClass("selected"),l.css("top",e.offset().top+e.outerHeight()+1),l.css("left",e.offset().left),$body.append(l)}}}},100);e.on("keydown.autocomplete",function(t){if(t.keyCode=t.which?t.which:t.keyCode,38==t.keyCode||40==t.keyCode){var a=l.find("li"),o=a.filter(".selected");if(a.removeClass("selected"),o.length>0){if(38==t.keyCode){var s=o.prev();s.length>0?s.addClass("selected"):a.eq(-1).addClass("selected")}else{var i=o.next();i.length>0?i.addClass("selected"):a.eq(0).addClass("selected")}}return t.preventDefault(),!1}if(13==t.keyCode){var o=l.find("li.selected");if(o.length>0&&c(o.find("span.text").text()),!e.hasClass("autocomplete_auto_submit"))return t.preventDefault(),!1}}),e.one("blur.autocomplete",function(){e.attr("autocomplete","on");var a=e.val();e.val("").val(a),window.clearInterval(h),h=0,v>=0&&(clearTimeout(v),v=-1),v=window.setTimeout(function(){null!=l&&l.remove(),v=-1},500),e.off("keydown.autocomplete"),$document.off("click.autocomplete"),$document.off("mousedown.autocomplete"),t("#mf-GdJiSy,#adx_custom_ol").length>0&&(m=setTimeout(function(){t("#mf-GdJiSy,#adx_custom_ol").show(),m=-1},500)),$window.on("focus.autocomplete",function(){p=Date.now(),$window.off("focus.autocomplete")})})};e.on("focus.autocomplete",i),(o||e.is(":focus"))&&i()};t(".autocomplete").each(function(){var e=t(this),a=this;a.autocomplete_data={},a.autocomplete_data.dataset_func=h,a.autocomplete_data.index=-1,e.one("focus.autocomplete_first",function(){void 0==a.autocomplete_data.dataset&&h(e,null,null,!0)}),e.on("change.autocomplete",function(){var t=a.autocomplete_data.dataset;if(null!=t){for(var o=e.val(),s=t.length,l=0;l0){i.addClass("highlight"),i.smoothScroll(-(.5*$window.height()));return}}}}else _=!0,location.hash="stupidtable/"+s+"/"+a.column+"/"+a.direction}$window.scrollTop()>o.offset().top&&o.smoothScroll()}),t("table.stupidtable:has(thead th.stupidtable_rank_th)").on("aftertablesort",function(e,a){var o,s,l=t(this),i=l.find("thead th.stupidtable_rank_th").index(),n=1;l.find("tbody tr").each(function(){var e=t(this),l=e.find("td:nth-child("+(a.column+1)+")"),r=l.data("sort-value");void 0==r&&(r=l.text()),r!=s&&(o=n,s=r),e.find("td:nth-child("+(i+1)+")").text(o),n++})}),stupidtable_hashchange_func=function(){if(_){_=!1;return}if(location.hash){var e,a=location.hash.split("/");if("#stupidtable"==a[0]){_=!0,t("table[data-stupidtable-id="+a[1]+"]").find("thead th").eq(a[2]).stupidsort(a[3])}}},window.addEventListener("hashchange",stupidtable_hashchange_func,!1),stupidtable_hashchange_func(),t("a[target='_blank']").each(function(){var e=t(this),a=e.attr("rel");0>(a=void 0!=a?a.split(" "):[]).indexOf("noopener")&&a.push("noopener"),0>a.indexOf("noreferrer")&&a.push("noreferrer"),e.attr("rel",a.join(" "))});var b=t(".rakysticky");if(b.length>0){var y=0,w=0,k=0,x=!1;window.addEventListener("scroll",function(){if($body.hasClass("smoothScrolling")){if(x){$body.removeClass("rakysticky_overlay");var e=t("#site_search_switch");e.length>0&&e.animate({marginTop:e.data("default-top")},200),w=k=0,x=!1}return}var a=$window.scrollTop();if(a>y){if(a>k&&(k=a),a>w+100){if(x){$body.removeClass("rakysticky_overlay");var e=t("#site_search_switch");e.length>0&&e.animate({marginTop:e.data("default-top")},200),x=!1}w=a}}else if(a0&&e.animate({marginTop:b.outerHeight()+5},200),x=!0}k=a}y=a},{passive:!0})}var C=t("a.popup_image");C.length>0&&C.on("click",function(){var e=t(this).attr("href"),a=t('');$body.append(a),a.hide(),a.fadeIn(200);var o=function(e){t(e.target).closest("img").length>0||a.fadeOut(200,function(){a.remove()})};return a.on("click",o),a.on("touchmove",function(t){t.preventDefault()}),!1})}),$.easing.quart=function(t,e,a,o,s){return-o*((e=e/s-1)*e*e*e-1)+a},$.hashScroll=function(){$document.on("click","a[href^='#'], area[href^='#']",function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname&&""!=this.hash){var t=$(this.hash);(t=t.length&&t||$("[name="+this.hash.slice(1)+"]")).length&&t.smoothScroll()}return!0})},$.fn.extend({smoothScroll:function(t){var e=this;void 0===t&&(t=0);var a=this.offset().top+t;return $html_body.stop(!0,!1),$body.addClass("smoothScrolling"),$html_body.animate({scrollTop:a},{duration:300,easing:"quart",complete:function(){$html_body.scrollTop(e.offset().top+t),$body.removeClass("smoothScrolling")}}),this}}); // kanaxs // https://code.google.com/p/kanaxs/ String.prototype.toKatakanaCase=function(){for(var a,b=this.length,c=[];b--;)a=this.charCodeAt(b),c[b]=12353<=a&&12438>=a?a+96:a;return String.fromCharCode.apply(null,c)};String.prototype.toHankakuCase=function(){for(var a,b=this.length,c=[];b--;)switch(a=c[b]=this.charCodeAt(b),!0){case 65281<=a&&65374>=a:c[b]-=65248;break;case 12288==a:c[b]=32}return String.fromCharCode.apply(null,c)}; String.prototype.toHankakuCase=function(){for(var t,r=this.length,a=[];r--;)switch(t=a[r]=this.charCodeAt(r),!0){case 65281<=t&&t<=65374:a[r]-=65248;break;case 12288==t:a[r]=32}return String.fromCharCode.apply(null,a)}; /*! * jQuery Cookie Plugin v1.3 * https://github.com/carhartl/jquery-cookie * * Copyright 2011, Klaus Hartl * Dual licensed under the MIT or GPL Version 2 licenses. * http://www.opensource.org/licenses/mit-license.php * http://www.opensource.org/licenses/GPL-2.0 */ (function($,document,undefined){var pluses=/\+/g;function raw(s){return s;}function decoded(s){return decodeURIComponent(s.replace(pluses,' '));}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null){options.expires=-1;}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}value=config.json?JSON.stringify(value):String(value);return(document.cookie=[encodeURIComponent(key),'=',config.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var decode=config.raw?raw:decoded;var cookies=document.cookie.split('; ');for(var i=0,l=cookies.length;i