You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1 lines
26 KiB

function __googleTranslateElementInit(){new google.translate.TranslateElement({pageLanguage:"ja",includedLanguages:"de,en,es,fr,it,ja,ko,pt,ru,zh-CN,zh-TW",layout:google.translate.TranslateElement.InlineLayout.SIMPLE,autoDisplay:!0},"google_translate_element")}function __checkInit(){"undefined"==typeof jQuery?setTimeout(__checkInit,10):$(function(){if($("meta:last").after('<meta name="theme-color" content="#000000">'),aidn.util.initStandAlone(),_isJapanese||null!=document.getElementById("google_translate_element")&&$.getScript("//translate.google.com/translate_a/element.js?cb=__googleTranslateElementInit",function(){var e=$(".aidn_sub").length,t=aidn.util.getQuery();setInterval(function(){$(".goog-te-banner-frame").length&&("none"==$(".skiptranslate").css("display")?e&&("block"==$("#menu_sp").css("display")?$("#menu, #menu_sp").css("top",0):$("#menu").css("top",0)):(e&&("block"==$("#menu_sp").css("display")?$("#menu, #menu_sp").css("top",39):$("#menu").css("top",39)),480>$(window).width()?$("iframe:first").contents().find(".goog-te-button").css("display","none"):$("iframe:first").contents().find(".goog-te-button").css("display","block"),0!=t.tw&&$("#goog-gt-tt").css({display:"none",opacity:0})))},100);var n=setInterval(function(){$(".goog-te-banner-frame").length&&"none"!=$(".skiptranslate").css("display")&&($(".goog-te-banner-frame").css({"box-shadow":"none","-webkit-box-shadow":"none","border-bottom":"1px solid #000000"}),$("iframe:first").contents().find(".goog-te-banner").css("background","#FFF"),$("div.skiptranslate").css("opacity",1),clearInterval(n))},100)}),aidn.util.checkMobile()&&($("a[href='http://twitter.com/daniwell_aidn']").attr("target","_self"),$("a[href='https://twitter.com/daniwell_aidn']").attr("target","_self")),0<$("#aidn").length&&(_active=!1),!_active){var e=aidn.constant.advUrlEn;if(aidn.util.checkJapanese()&&(e=aidn.constant.advUrlJa),e='<a href="'+e+'" target="_blank"><div class="adv_con"><p class="text">'+aidn.constant.advTex+"</p>",e+='<p class="image"><img src="'+aidn.constant.advImg+'" alt="'+aidn.constant.advAlt+'" /></p>',e+="</div></a>",0<$(".adv").length)$(".adv").html(e),$("body").css("overflow","auto");else{e='<div class="adv"><div class="hr_top"></div>'+e+"</div>";var t=$("#common_back");0<t.length&&($("body").css("overflow","auto"),t.after(e))}}})}var hr=location.href;0<hr.indexOf("a.aidn")&&(location.href=hr.split("a.aidn").join("aidn")),0<hr.indexOf("www.aidn")&&(location.href=hr.split("www.aidn").join("aidn"));var aidn=aidn||{};aidn.constant={album2ndJa:"/daniwell/cats/",album2ndEn:"/daniwell/cats/en/",advUrlJa:"/daniwell/",advUrlEn:"/daniwell/",advImg:"shared/img/adv.gif",advTex:"DANIWELL DISCOGRAPHY",advAlt:"DANIWELL (Nyan Cat Song Creator) DISCOGRAPHY"};try{for(var l=location.href.split("aidn")[1].split("/").length-2,i=0;i<l;i++)aidn.constant.advImg="../"+aidn.constant.advImg}catch(e){}aidn.init={ver:0,selectBasePath:function(e,t){var n=parseInt(aidn.util.getCookie("baseid"));return(isNaN(n)||1==t)&&(n=Math.floor(Math.random()*e.length),aidn.util.setCookie("baseid",n,604800)),(e.length<=n||0>n)&&(n=0),this.basepath=e[n]},loadScript:function(e,t){$.ajaxSetup({cache:!0});var n=function(i){var o=e[i]+"?"+aidn.init.ver;aidn.init.usebase&&0!=o.indexOf("http")&&(o=aidn.init.basepath+o),$.getScript(o,function(){i+1<e.length?n(i+1):t&&t()})};n(0)},basepath:"",usebase:!0},aidn.config={init:function(){this.clWidth=document.documentElement.clientWidth,this.clHeight=document.documentElement.clientHeight,this.scWidth=screen.width,this.scHeight=screen.height,this.inWidth=window.innerWidth,this.inHeight=window.innerHeight,(0>=this.clHeight||0>=this.clWidth)&&(this.clWidth=this.scWidth,this.clHeight=this.scHeight),(0>=this.inHeight||0>=this.inWidth)&&(this.inWidth=this.clWidth,this.inHeight=this.clHeight)},clWidth:0,clHeight:0,scWidth:0,scHeight:0,inWidth:0,inHeight:0,touchEnabled:null!=window.TouchEvent},aidn.audio={init:function(){if(!this._inited){this._inited=!0;try{this.audio=[],this.audio[0]=new Audio,this.availableAudio=!0,this.availableOgg=""!=this.audio[0].canPlayType("audio/ogg"),this.availableMP3=""!=this.audio[0].canPlayType("audio/mpeg"),this.availableWav=""!=this.audio[0].canPlayType("audio/wav")}catch(e){availableAudio=!1}}},setSrc:function(e,t){this.audio[e]?this.audio[e].src=t:this.audio[e]=new Audio(t)},load:function(e){this.audio[e].load()},play:function(e){this.audio[e].play()},pause:function(e){this.audio[e].pause()},stop:function(e){this.audio[e].ended||(this.audio[e].pause(),this.audio[e].currentTime=0)},volume:function(e,t){0>t&&(t=0),1<t&&(t=1),this.audio[e].volume=t},getPath:function(e){for(var t=e.length,n=0;n<t;n++){var i=e[n],o=i.toLowerCase();if(aidn.audio.availableMP3&&o.indexOf(".mp3"))break;if(aidn.audio.availableOgg&&o.indexOf(".ogg"))break;if(aidn.audio.availableWav&&o.indexOf(".wav"))break}return n==t&&(i=null),i},_inited:!1,audio:[],availableAudio:!1,availableMP3:!1,availableWav:!1,availableOgg:!1},aidn.canvas={create:function(e,t,n,i,o){var a='<canvas id="'+t+'" width="'+n+'" height="'+i+'"></canvas>';document.getElementById(e).innerHTML=a,this.canvas=document.getElementById(t),this.ctx=this.canvas.getContext("2d"),this.w=n,this.h=i,this.bgColor=o,this.clear(!0)},clear:function(e){this.ctx.fillStyle=this.bgColor,this.ctx.fillRect(0,0,this.w,this.h),e&&this.ctx.fill()},canvas:null,ctx:null,w:0,h:0,bgColor:"#ffffff"},aidn.event={addTouchEvent:function(e,t,n,i,o){"string"==typeof e&&(e=document.getElementById(e)),t&&e.addEventListener("touchstart",t,!1),n&&e.addEventListener("touchmove",n,!1),i&&e.addEventListener("touchend",i,!1),o&&e.addEventListener("touchcancel",o,!1)},removeTouchEvent:function(e,t,n,i,o){"string"==typeof e&&(e=document.getElementById(e)),t&&e.removeEventListener("touchstart",t,!1),n&&e.removeEventListener("touchmove",n,!1),i&&e.removeEventListener("touchend",i,!1),o&&e.removeEventListener("touchcancel",o,!1)},addMouseEvent:function(e,t,n,i,o){"string"==typeof e&&(e=document.getElementById(e)),t&&e.addEventListener("mousedown",t,!1),n&&e.addEventListener("mousemove",n,!1),i&&e.addEventListener("mouseup",i,!1),o&&e.addEventListener("mouseout",o,!1)},removeMouseEvent:function(e,t,n,i,o){"string"==typeof e&&(e=document.getElementById(e)),t&&e.removeEventListener("mousedown",t,!1),n&&e.removeEventListener("mousemove",n,!1),i&&e.removeEventListener("mouseup",i,!1),o&&e.removeEventListener("mouseout",o,!1)},add:function(e,t,n,i,o){(aidn.config.touchEnabled?this.addTouchEvent:this.addMouseEvent)(e,t,n,i,o)},remove:function(e,t,n,i,o){(aidn.config.touchEnabled?this.removeTouchEvent:this.removeMouseEvent)(e,t,n,i,o)},addMouseWheel:function(e,t){var n="onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll";"string"==typeof e&&(e=document.getElementById(e)),e.addEventListener(n,t)},removeMouseWheel:function(e,t){var n="onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll";"string"==typeof e&&(e=document.getElementById(e)),e.removeEventListener(n,t)},addDeviceOrientation:function(e){window.addEventListener("deviceorientation",e)},removeDeviceOrientation:function(e){window.removeEventListener("deviceorientation",e)},addDeviceMotion:function(e){window.addEventListener("devicemotion",e)},removeDeviceMotion:function(e){window.removeEventListener("devicemotion",e)},getWheelDelta:function(e){return void 0!==e.wheelDelta?e.wheelDelta:e.detail},getPos:function(e){return e.touches?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.originalEvent&&e.originalEvent.touches?{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}:{x:e.clientX,y:e.clientY}}},aidn.ref={init:function(e){0<this.__total&&e!=this.__interval&&(clearInterval(this.__sid),this.__sid=setInterval(this.__update,e)),this.__interval=e},addInterval:function(e,t){this.__list[this.__total]={time:0,delay:t,func:e},0==this.__total&&(this.__sid=setInterval(this.__update,this.__interval)),this.__total++},removeInterval:function(e){for(var t=0;t<this.__total;t++)this.__list[t].func==e&&(delete this.__list[t],this.__list.splice(t,1),this.__total--);0==this.__total&&clearInterval(this.__sid)},__update:function(){for(var e,t=aidn.ref.__list,n=aidn.ref.__total,i=aidn.ref.__interval,o=0;o<n;o++)e=t[o],e.time+=i,e.delay<e.time&&(e.time-=e.delay,e.func())},__interval:10,__sid:-1,__list:[],__total:0},aidn.util={initHideAddressBar:function(e,t){e&&window.addEventListener("load",function(){setTimeout(aidn.util.hideAddressBar,100)},!1),t&&window.addEventListener("orientationchange",function(){setTimeout(aidn.util.hideAddressBar,100)},!1)},hideAddressBar:function(){0>=window.pageYOffset&&window.scrollTo(0,1)},hideAddressBarStart:function(e){navigator.userAgent.match(/iphone|ipod/i)?(this.m=parseInt(document.body.style.minHeight),isNaN(this.m)&&(this.m=0),document.body.style.minHeight="2000px",window.addEventListener("scroll",this._scrolled),this.f=e,this.i=setInterval(function(){aidn.util.hideAddressBar()},50)):e&&e()},_scrolled:function(){var e=aidn.util;document.body.style.minHeight=Math.max(window.innerHeight,e.m)+"px",clearInterval(e.i),window.removeEventListener("scroll",e._scrolled),e.f&&e.f()},lowerAndroid:function(e){var t=!1,n=navigator.userAgent;return 0<n.indexOf("Android")&&parseFloat(n.substr(n.indexOf("Android")+8,3))<e&&(t=!0),t},getLanguage:function(){var e=this.getQuery();return e.lc?e.lc:(navigator.browserLanguage||navigator.language||navigator.userLanguage).substr(0,2)},stopScroll:function(){document.addEventListener("touchmove",function(e){e.preventDefault()},!1)},checkJapanese:function(){return this.getLanguage(),!!("ja"==this.getLanguage()||this.lowerAndroid(2.4)&&0<navigator.userAgent.toLowerCase().indexOf("ja-jp"))},useDummyDiv:function(){var e=aidn.util.getiOSVersion();return 0<e&&10>e},getiOSVersion:function(){var e=navigator.userAgent,t=e.match(/iPhone OS (\d+_*\d*)/);return t&&t[1]?parseFloat(t[1].replace("_",".")):(t=e.match(/iPad; CPU OS (\d+_*\d*)/))&&t[1]?parseFloat(t[1].replace("_",".")):-1},checkChrome:function(){var e=navigator.userAgent;return 0<=e.indexOf("CriOS")||0<=e.indexOf("Chrome")},checkSafari:function(){var e=navigator.userAgent;return 0<=e.indexOf("Version")&&0<=e.indexOf("Safari")},checkAndroid:function(){return 0<=navigator.userAgent.indexOf("Android")},checkiOS:function(e){var t=navigator.userAgent,n=0<=t.indexOf("iPhone")||0<=t.indexOf("iPod");return 0!=e?n||0<=t.indexOf("iPad"):n},checkMobile:function(){var e=navigator.userAgent;return 0<=e.indexOf("iPhone")||0<=e.indexOf("iPad")||0<=e.indexOf("iPod")||0<=e.indexOf("Android")||0<=e.indexOf("BlackBerry")||0<=e.indexOf("Windows Phone")},checkApps:function(){return aidn.util.checkAppTwitter()||aidn.util.checkAppFacebook()||aidn.util.checkAppLine()},checkAppTwitter:function(){var e=navigator.userAgent;return!(!aidn.util.checkSafari()||!aidn.util.checkMobile())||0<=e.indexOf("Twitter for")},checkAppFacebook:function(){return 0<=navigator.userAgent.indexOf("FBAV")},checkAppLine:function(){return 0<=navigator.userAgent.indexOf("Line")},shuffleArray:function(e){var t,n=e.length;for(t=0;t<n;t++){var i=e[t],o=Math.floor(Math.random()*n);e[t]=e[o],e[o]=i}return e},getQuery:function(){for(var e=[],t=window.location.search.slice(1).split("&"),n=t.length,i=0;i<n;i++){var o=t[i].split("=");e.push(o[0]),e[o[0]]=o[1]}return e},getTime:function(){return"undefined"==typeof performance||void 0===performance.now?Date.now():performance.now()},fullscreen:function(e){aidn.util.checkFullscreen()?document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.cancelFullScreen?document.cancelFullScreen():document.exitFullscreen&&document.exitFullscreen():(e?"string"==typeof e&&(e=document.getElementById(e)):e=document.body,e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.requestFullscreen&&e.requestFullscreen())},checkFullscreen:function(){return!!(document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.fullscreenElement)},enabledFullscreen:function(e){return(!e||!navigator.userAgent.match(/Firefox/i))&&(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||!1)},copyToClipboard:function(e){var t=document.createElement("textarea");return t.value=e,t.selectionStart=0,t.selectionEnd=t.value.length,e=t.style,e.position="fixed",e.left="-100%",document.body.appendChild(t),t.focus(),e=document.execCommand("copy"),t.blur(),document.body.removeChild(t),e},getCookie:function(e){var t=null,n=e+"=",i=(e=document.cookie).indexOf(n);return 0<=i&&(t=i+n.length,-1==(n=e.indexOf(";",t))&&(n=e.length),t=decodeURIComponent(e.substring(t,n))),t},setCookie:function(e,t,n,i){e=e+"="+encodeURIComponent(t)+";",0<=n&&(e+=" max-age="+n+";"),i&&(e+=" path="+i+";"),document.cookie=e},needExpandArea:function(e){var t=navigator.userAgent,n=0<=t.indexOf("iPhone")||0<=t.indexOf("iPod");return(n=n&&0<=t.indexOf("Version/")&&600>Math.max(window.screen.width,window.screen.height))&&1==e&&($("html,body").css("position","static"),$(window).on("touchmove.noScroll",function(e){e.preventDefault()}),window.scrollTo(0,0),$("body").css("padding-bottom",1),setInterval(function(){window.scrollTo(0,0)},100)),n},initStandAlone:function(){"standalone"in window.navigator&&window.navigator.standalone&&$("a").each(function(e,t){var n=$(this),i=n.attr("target"),o=!0;i&&0<=i.indexOf("blank")&&(o=!1);var a=n.attr("href");o&&a&&""!=a&&(n.click(function(e){location.href=a,e.preventDefault()}),n.attr("href",""))})},canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return!!(window.WebGLRenderingContext&&t&&t.getShaderPrecisionFormat)}catch(e){return!1}}(),webaudio:function(){for(var e=["SO-03F","SO-02F","SO-01F"],t=e.length,n=navigator.userAgent,i=0;i<t;i++)if(0<=n.indexOf(e[i]))return!1;return!(!window.AudioContext&&!window.webkitAudioContext)}()},aidn.window={useDummyDiv:aidn.util.useDummyDiv,addDummyDiv:function(){if(aidn.window.useDummyDiv()){var e=$("<div id='dummy'></div>");e.css({width:"100%",height:"100%",position:"fixed",zIndex:-1}),e.html('<p style="width:100%;height:100%;"></p>'),$("body").prepend(e),aidn.window._dummy=$("#dummy p")}},resize:function(e,t){aidn.window._isFit=t,void 0===t&&(aidn.window._isFit=!0),aidn.window._resizeFunc=e,$(window).resize(aidn.window._resize),aidn.window._isFit&&$(window).on("touchmove",function(e){e.preventDefault()}),aidn.window._isTwitteriOS&&aidn.window._resizeFix(),aidn.window._resize()},width:function(){return $(window).width()},height:function(){return aidn.window._isTwitteriOS?window.innerHeight:aidn.window._dummy?aidn.window._dummy.height():$(window).height()},_resize:function(){aidn.window._isTwitteriOS&&aidn.window._isFit&&$("body").height(window.innerHeight+20),aidn.window._isTwitteriOS?setTimeout(aidn.window._resizeFix,100):aidn.window._resizeFix()},_resizeFix:function(){aidn.window._isTwitteriOS&&aidn.window._isFit&&$("body").height(window.innerHeight),aidn.window._resizeFunc&&aidn.window._resizeFunc()},_isFit:!0,_isTwitteriOS:aidn.util.checkAppTwitter(),_dummy:null,_resizeFunc:null},aidn.math={toRad:function(e){return e*Math.PI/180},toDeg:function(e){return 180*e/Math.PI},rand:function(e,t){return Math.random()*(t-e)+e},randInt:function(e,t){return Math.floor(Math.random()*(t+1-e)+e)}},aidn.social={init:function(){this.initTw(),this.initFb(),this.initGp()},initTw:function(){if(!(0>location.href.indexOf("http"))){var e,t=document.getElementsByTagName("script")[0],n=/^http:/.test(document.location)?"http":"https";document.getElementById("twitter-wjs")||(e=document.createElement("script"),e.id="twitter-wjs",e.src=n+"://platform.twitter.com/widgets.js",t.parentNode.insertBefore(e,t))}},initFb:function(){if(!(0>location.href.indexOf("http"))){var e,t=document.getElementsByTagName("script")[0];document.getElementById("facebook-jssdk")||(e=document.createElement("script"),e.id="facebook-jssdk",e.src="//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0",t.parentNode.insertBefore(e,t))}},initGp:function(){if(!(0>location.href.indexOf("http"))){var e=aidn.util.getLanguage();"en"!=e&&(window.___gcfg={lang:e}),(e=document.createElement("script")).type="text/javascript",e.async=!0,e.src="https://apis.google.com/js/plusone.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}},reloadTw:function(e,t,n,i){0<=i.indexOf("http://aidn.jp")&&(i=i.replace("http","https")),0<$("#twitter iframe").length&&$("#twitter iframe").remove(),0<$("#twitter-wjs").length&&$("#twitter-wjs").remove();var o='<a href="https://twitter.com/share" class="twitter-share-button"';e&&(o+=' data-text="'+e+'"'),t&&(o+='data-related="'+t+'"'),n&&(o+='data-count="'+n+'"'),i&&(o+='data-url="'+i+'"'),o+=' data-lang="en">Tweet</a>',$("#twitter").append(o),this.initTw()},shareTw:function(e,t,n,i,o){0<=e.indexOf("https://aidn.jp")&&(e=e.replace("https","http")),e="https://twitter.com/intent/tweet?url="+encodeURIComponent(e),n&&(e+="&text="+encodeURIComponent(n)),i&&(e+="&related="+i),o&&(e+="&hashtags="+encodeURIComponent(o)),t&&!aidn.util.checkMobile()?window.open(e,"tw","width=730, height=460, personalbar=0,toolbar=0,scrollbars=1,resizable=1"):location.href=e},shareFb:function(e,t){0<=e.indexOf("https://aidn.jp")&&(e=e.replace("https","http"));var n="http://www.facebook.com/share.php?u="+encodeURIComponent(e);t?aidn.util.checkMobile()?window.open(n):window.open(n,"fb","width=730, height=460, personalbar=0,toolbar=0,scrollbars=1,resizable=1"):location.href=n},shareGp:function(e,t){0<=e.indexOf("https://aidn.jp")&&(e=e.replace("https","http"));var n="https://plus.google.com/share?url="+encodeURIComponent(e);t?aidn.util.checkMobile()?window.open(n):window.open(n,"gp","width=960, height=790, personalbar=0,toolbar=0,scrollbars=1,resizable=1"):location.href=n},shareLi:function(e,t){var n="http://line.me/R/msg/text/?"+encodeURIComponent(t)+" "+encodeURIComponent(e);location.href=n},setShareInfo:function(e,t){$("title").text(e),$("h1").text(e),$("#twitter a").attr("data-text",e),$("#twitter a").attr("data-url",t),$($("#facebook").children()).attr("href",t),$($("#plusone").children()).attr("href",t)}};var _isJapanese=aidn.util.checkJapanese(),_active=!1;(_active="undefined"==typeof swfobject||swfobject.hasFlashPlayerVersion("9")&&!aidn.util.checkMobile())||(swffit.fit=function(){}),__checkInit(),aidn.extra={Button:function(e,t){function n(){d||(0==++s%5&&c++,a<=c&&(clearInterval(r),i.text(o)));for(var e=o.substr(0,c),t=c;t<a;t++)e+=String.fromCharCode(65+26*Math.random());i.text(e)}var i=e;t&&(i=t);var o=i.text(),a=o.length,r=-1,d=!1,s=0,c=0;e.bind("mouseover",function(e){clearInterval(r),s=c=0,r=setInterval(n,20),d=!0}),e.bind("mouseout",function(e){d=!1})},initSnsButtons:function(e,t){0<=e.indexOf("http://aidn.jp")&&(e=e.replace("http","https")),$("#sns_tw").click(function(n){aidn.social.shareTw(e,!0,t,"daniwell_aidn")}),$("#sns_fb").click(function(t){aidn.social.shareFb(e,!0)}),$("#sns_gp").click(function(t){aidn.social.shareGp(e,!0)})}},aidn.Audio=function(){aidn.audio.init();var e,t,n,i,o,a,r=this,d=new Audio,s=1;this._audio=d,d.addEventListener("playing",function(){0<e&&(d.currentTime=e,e=-1)}),d.addEventListener("timeupdate",function(){t<=d.currentTime&&d.pause(),0<d.currentTime&&o&&(o(),o=null)}),d.addEventListener("ended",function(){a&&a(),n&&(d.currentTime=0,d.play(),d.playbackRate=s)}),d.addEventListener("canplaythrough",function(){0<e&&(d.currentTime=e,e=-1),i&&(i(),i=null)}),this.load=function(e,t){"string"==typeof e&&(e=[e]);var n=aidn.audio.getPath(e);if(!n)return!1;i=t,d.src=n,d.load()},this.play=function(i,a,s,c,u){void 0===i&&(i=0),void 0===a&&(a=!1),void 0===c&&(c=0),void 0===u&&(u=1),o=s,n=a,t=1e6;try{d.currentTime=i}catch(t){aidn.log(t),e=i}d.play(),0<c&&"undefined"!=typeof jQuery?(r.volume=0,$(r).stop().animate({volume:u},1e3*c,"easeInSine")):r.volume=u},this.pause=function(){d.pause()},this.playSprite=function(e,n){d.currentTime=e,d.play(),t=n},this.addEndEvent=function(e){a=e},Object.defineProperty(this,"speed",{get:function(){return s},set:function(e){d.playbackRate=s=e}}),Object.defineProperty(this,"loop",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"time",{get:function(){return d.currentTime},set:function(e){d.currentTime=e}}),Object.defineProperty(this,"volume",{get:function(){return d.volume},set:function(e){d.volume=e}}),Object.defineProperty(this,"duration",{get:function(){return d.duration}})},aidn.WebAudio=function(){function e(){i.onended=null,f&&f()}aidn.audio.init();var t,n,i,o,a,r,d,s,c,u,l,h,f,m=this,p=[],v=0,g=100,w=-1,_=!1,b=1,y=1;if(void 0!==aidn.___waContext)this._context=t=aidn.___waContext;else{try{t=new(window.AudioContext||window.webkitAudioContext)}catch(e){}this._context=t,aidn.___waContext=t}this.load=function(e,i,o){function a(){t.decodeAudioData(f?r.buffer:b.response,function(e){if(0<=w){for(var o=w,a=Number.MAX_VALUE,r=e.numberOfChannels,f=0;f<r;f++){for(var p=(b=e.getChannelData(f)).length,v=0;v<p&&!(o<Math.abs(b[v]));v++);v<a&&(a=v)}for(p=e.length-a,o=t.createBuffer(r,p,t.sampleRate),f=0;f<r;f++){var b=e.getChannelData(f),y=o.getChannelData(f);for(v=0;v<p;v++)y[v]=b[v+a]}e=o}g=(n=e).duration,i&&i(n),_&&(_=!1,m.play(d,s,c,u,l,h))},function(){})}var r,f=_=!1;if(0<=o&&(w=o),"string"==typeof e)if(0<e.indexOf("base64")){f=!0;var p=(o=atob(e.split(",")[1])).length;r=new Uint8Array(p);for(var v=0;v<p;++v)r[v]=o.charCodeAt(v)}else e=[e];if(!t)return!1;if(t.createBufferSource().start(0),n=null,!(e=aidn.audio.getPath(e))&&!f)return!1;if(f)a();else{var b=new XMLHttpRequest;b.open("GET",e,!0),b.responseType="arraybuffer",b.onload=a,b.send()}return!0},this.play=function(f,g,w,b,x,E){if(d=f,s=g,c=w,u=b,l=x,h=E,n){void 0===f&&(f=0),void 0===g&&(g=!1),void 0===b&&(b=0),void 0===x?x=y:y=x,void 0===E&&(E=0),(i=t.createBufferSource()).buffer=n,i.loop=g,i.onended=e,a||(a=t.createGain()),g=(g=[i,a]).concat(p),o&&g.push(o),r&&g.push(r);for(var O=1;O<g.length;O++){var k=g[O];g[O-1].connect(k),O==g.length-1&&k.connect(t.destination)}if(i.start?i.start(t.currentTime+E,f):i.noteOn(f),v=t.currentTime-f,this._source=i,this.nodeGain=a,0<b&&"undefined"!=typeof jQuery?(m.volume=0,$(m).stop().animate({volume:x},1e3*b,"easeInSine")):m.volume=x,w)var F=setInterval(function(){0<m.time&&(clearInterval(F),w())},10)}else _=!0,console.log('call "load" method before "play"')},this.stop=function(){_=!1,i&&(i.stop?i.stop(0):i.noteOff())},this.initPanner=function(e){return(void 0===e||0>=e)&&(e="equalpower"),0<e&&(e="HRTF"),o=t.createPanner(),o.panningModel=e,this.nodePanner=o},this.initBiquadFilter=function(e){return void 0===e&&(e=0),r=t.createBiquadFilter(),r.type=e,r},this.addNode=function(e){p.push(e)},this.addEndEvent=function(e){f=e},Object.defineProperty(this,"speed",{get:function(){return i.playbackRate.value},set:function(e){try{v=t.currentTime-this.time/e}catch(e){}i.playbackRate.value=b=e}}),Object.defineProperty(this,"loop",{get:function(){return i.loop},set:function(e){i.loop=e}}),Object.defineProperty(this,"time",{get:function(){return(t.currentTime-v)*b%g},set:function(e){i.stop(0),m.play(e,i.loop)}}),Object.defineProperty(this,"volume",{get:function(){return y},set:function(e){y=e,a&&(a.gain.value=e)}}),Object.defineProperty(this,"duration",{get:function(){return g}})},aidn.AutoAudio=function(e,t,n){void 0===e&&(e="../shared/swf/audio.swf"),aidn.audio.init();var i=2;"undefined"!=typeof swfobject&&swfobject.hasFlashPlayerVersion(10)&&null!=e?i=0:aidn.util.webaudio&&(i=1),0<=n&&2>=n&&(i=n);var o,a,r;if(___flash_audioLoadComplete=function(){a()},___flash_audioPlay=function(){r()},0==i){(n=document.createElement("div")).id="flash_audio",document.body.appendChild(n),swfobject.embedSWF(e,"flash_audio","20","20","10.2.0","",{callback:t},{menu:"false",scale:"noScale",wmode:"transparent",allowScriptAccess:"always",allowFullScreen:"true"},{id:"flash_audio",name:"flash_audio"});var d=setInterval(function(){document.getElementById("flash_audio").loadFunc&&(clearInterval(d),o=document.getElementById("flash_audio"),t(i))},100)}else this.audio=o=1==i?new aidn.WebAudio:new aidn.Audio,t&&setTimeout(function(){t(i)},10);this.load=function(){var e;if("string"==typeof arguments[0]&&(arguments[0]=[arguments[0]]),0==i){for(this.audio=o,e=0;e<arguments[0].length;e++)if(0<=arguments[0][e].indexOf(".swf")){arguments[0]=arguments[0][e];break}arguments[1]&&(a=arguments[1],arguments[1]="___flash_audioLoadComplete")}else{var t=[];for(e=0;e<arguments[0].length;e++)0>arguments[0][e].indexOf(".swf")&&t.push(arguments[0][e]);arguments[0]=t}(o.loadFunc||o.load).apply(o,arguments)},this.play=function(){0==i&&arguments[2]&&(r=arguments[2],arguments[2]="___flash_audioPlay"),(o.playFunc||o.play).apply(o,arguments)},this.stop=function(){(o.stopFunc||o.stop||o.pause).apply(o,arguments)},this.addEndEvent=function(e){0!=i&&o.addEndEvent(e)},Object.defineProperty(this,"speed",{get:function(){return 0==i?-1:o.speed},set:function(e){0==i||(o.speed=e)}}),Object.defineProperty(this,"time",{get:function(){return 0==i?o?o.getTimeFunc():-1:o.time},set:function(e){0==i||(o.time=e)}}),Object.defineProperty(this,"volume",{get:function(){return 0==i?-1:o.volume},set:function(e){0==i||(o.volume=e)}}),Object.defineProperty(this,"duration",{get:function(){return 0==i?-1:o.duration}}),this.type=i},aidn.log=function(){window.console&&console.log(arguments)},aidn.alert=function(){for(var e="",t=arguments.length,n=0;n<t-1;n++)e+=arguments[n]+", ";0<t&&(e+=arguments[n]),alert(e)},aidn.debug=function(){if("undefined"!=typeof jQuery){for(var e="",t=arguments.length,n=0;n<t;n++)e+=arguments[n]+", ";0==$("#__debugx").length&&$("html").append("<div id='__debugx' style='pointer-events:none;text-align:left;position:fixed;z-index:10000000;top:0;font-weight:bold;background:rgba(255,255,255,0.5);'></div>"),$("#__debugx").prepend("<p>"+e+"</p>")}},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)};