var pico8container = document.createElement("div"); pico8container.innerHTML = `
`; document.body.appendChild(pico8container); function microAjax(B,A){this.bindFunction=function(E,D){return function(){return E.apply(D,[D])}};this.stateChange=function(D){if(this.request.readyState==4){this.callbackFunction(this.request.responseText)}};this.getRequest=function(){if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}return false};this.postBody=(arguments[2]||"");this.callbackFunction=A;this.url=B;this.request=this.getRequest();if(this.request){var C=this.request;C.onreadystatechange=this.bindFunction(this.stateChange,this);if(this.postBody!==""){C.open("POST.html",B,true);C.setRequestHeader("X-Requested-With","XMLHttpRequest");C.setRequestHeader("Content-type","application/x-www-form-urlencoded");C.setRequestHeader("Connection","close")}else{C.open("GET.html",B,true)}C.send(this.postBody)}}; var current_time="2020-05-20 17:28:56",s_uid=0;function $(e){return document.getElementById(e)}var p_page=1,p_sub=0,p_cat=0,p_pid=0,search_url_base="",tag_url_base="",pip_form_data={},touch_detected=!1,undefined="undefined",current_playing_cart_id=-1;function microAjax(e,t){var n;this.bindFunction=function(e,t){return function(){return e.apply(t,[t])}},this.stateChange=function(e){4==this.request.readyState&&this.callbackFunction(this.request.responseText)},this.getRequest=function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):!!window.XMLHttpRequest&&new XMLHttpRequest},this.postBody=arguments[2]||"",this.callbackFunction=t,this.url=e,this.request=this.getRequest(),this.request&&((n=this.request).onreadystatechange=this.bindFunction(this.stateChange,this),""!==this.postBody?(n.open("POST.html",e,!0),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.setRequestHeader("Connection","close")):n.open("GET.html",e,!0),n.send(this.postBody))}function post_ajax(e,t,n){var i="string"==typeof t?t:Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&"),o=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");return o.open("POST.html",e),o.onreadystatechange=function(){3";microAjax("setb1f8.html?pid="+e+"&sid="+n+"&which="+t,function(e){for(var t=document.getElementsByClassName(i),n=0;n'}function cancel_attr(e,t,n){var i;console.log("@ cancel_attr("+e+", "+t+", "+n),document.getElementById(e)&&((i=document.getElementById(t)).innerHTML='
',microAjax(n,function(e){i.innerHTML=json_parse(e).printable}))}function edit_attr(n,e,i,t,o){var s=document.getElementById(e);s&&(s.innerHTML='
',microAjax(t,function(e){s.innerHTML=json_parse(e).printable;var t=document.getElementById(n);t&&o&&(t.focus(),set_enter_to_save(t,document.getElementById(i)))}))}function submit_pip_form_data(e){var t=document.getElementsByClassName("pip_form_input");console.log("@ submit form: adding "+t.length+" values");for(var n=0;n"),stringified_data=JSON.stringify(pip_form_data),8388608n.right||t.clientY>n.bottom||t.clientY',el.innerHTML!=new_str&&(el.innerHTML=new_str);var l=p8_is_running;p8_touch_detected||"p8_menu_buttons_touch"!=el.parentElement.id||(l=!1),p8_touch_detected&&"p8_menu_buttons"==el.parentElement.id&&(l=!1),o&&(l=!1),el.style.display=l?"":"none"}requestAnimationFrame(p8_update_button_icons)}else requestAnimationFrame(p8_update_button_icons)}else requestAnimationFrame(p8_update_button_icons)}function abs(e){return 0>e?-e:e}function pico8_buttons_event(e,t){if(p8_is_running&&document.getElementById("touch_controls_gfx")){2==t&&void 0!==pico8_mouse&&(pico8_mouse[2]=0);var A=0;if(e.touches&&(A=e.touches.length),0==A)void 0!==pico8_mouse&&(pico8_mouse[2]=0);else{let A=e.touches[0];var n=A.clientX,o=A.clientY;window.innerWidth,window.innerHeight;let i=p8_document().getElementById("canvas");if(p8_touch_detected&&void 0!==pico8_mouse&&i){var a=i.getBoundingClientRect();if(n>=a.left&&n=a.top&&ot?1:0]);pico8_mouse[2]=0}}"none"==document.getElementById("touch_controls_gfx").style.display?pico8_buttons_event_virtual_keyboard(e,t):pico8_buttons_event_virtual_dpad(e,t)}}function pico8_buttons_event_virtual_keyboard(e,t){if(p8_is_running&&0==t){var A=0;e.touches&&(A=e.touches.length);for(var n=0;nc&&0<=u&&6>u){let e=[["X{[(*-=_+X","1234567890","qwertyuiop","asdfghjklX","zxcvbnm,.X","XXXX <>/"],["XXXXX[]`~X",'!"#$%^&@()',"QWERTYUIOP","ASDFGHJKLX","ZXCVBNM;:X","XXXX ?'\\"]][p8_keyboard_state][u].charCodeAt(c);(3==u||4==u)&&9==c&&(e=13),0==u&&9==c&&(e=8),0==u&&0==c&&(e=27),5==u&&0<=c&&4>c&&(e=-1),codo_key_buffer.push(e),0==p8_keyboard_state&&0==u&&1<=c&&3>=c&&(1==c&&codo_key_buffer.push(125),2==c&&codo_key_buffer.push(93),3==c&&codo_key_buffer.push(41)),5==u&&0==c&&(p8_keyboard_state=p8_keyboard_state?0:1,el=document.getElementById("controls_keyboard_panel"),el&&el.setAttribute("src",p8_keyboard_state?"/gfx/controls_keyboard2.png":"/gfx/controls_keyboard.png")),p8_give_focus()}}}}}function pico8_buttons_event_virtual_dpad(e){if(p8_is_running){pico8_buttons[0]=0;var t=0;e.touches&&(t=e.touches.length);for(var A=0;Al-8*d)o>i-3*d&&(b|=64),o<3*d&&(codo_key_buffer.push(27),p8_give_focus());else if(o.6*abs(r)&&(s<-deadzone&&(b|=1),s>deadzone&&(b|=2)),abs(r)>.6*abs(s)&&(r<-deadzone&&(b|=4),r>deadzone&&(b|=8))}else o>i-6*d&&(mask=48,l-a>.8*(i-o)&&(b|=16),i-o>.8*(l-a)&&(b|=32));pico8_buttons[0]|=b}}}var p8_update_layout_hash=-1,last_windowed_container_height=512;function p8_update_layout(){var e=p8_document().getElementById("canvas"),t=p8_document().getElementById("p8_playarea"),A=p8_document().getElementById("p8_container"),n=p8_document().getElementById("p8_frame"),o=512,a=0,i=0,l=p8_aspect;if(!(e&&t&&A&&n))return p8_update_layout_hash=-1,void requestAnimationFrame(p8_update_layout);var d=document.fullscreenElement||document.mozFullScreenElement||document.webkitIsFullScreen||document.msFullscreenElement,s=n.offsetWidth,r=n.offsetHeight;if(d?(s=window.innerWidth,r=window.innerHeight):(s=Math.min(s,window.innerWidth),r=Math.min(r,window.innerHeight)),o=Math.min(s,r),p8_touch_detected&&p8_is_running){var u=Math.max(window.innerWidth,window.innerHeight);o=Math.min(o,2*u/3)}1==l&&512<=s&&512<=r&&(o=-128&o+1),!d&&n&&(o=Math.min(o,last_windowed_container_height)),d&&(i=(s-o*l)/2,a=p8_touch_detected?window.innerWidthwindow.location.hash.search("playing")&&p8_close_cart()})}}function p8_update_gamepads(){var e=navigator.getGamepads()||navigator.webkitGetGamepads();if(e){pico8_gamepads.count=e.length;for(var t,A=0;A.3&&(pico8_buttons[A]|=2),t.axes[1]&&t.axes[1]<-.3&&(pico8_buttons[A]|=4),t.axes[1]&&t.axes[1]>.3&&(pico8_buttons[A]|=8),j=0;jj?pico8_buttons[A]|=16<<(1&(j+1)/2):pico8_buttons[0]|=64);requestAnimationFrame(p8_update_gamepads)}}function p8_give_focus(){el=void 0===codo_textarea?document.getElementById("codo_textarea"):codo_textarea,el&&(el.focus(),el.select())}function p8_request_fullscreen(){if(document.fullscreenElement||document.mozFullScreenElement||document.webkitIsFullScreen||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen();else{var e=document.getElementById("p8_playarea");e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}}requestAnimationFrame(p8_update_gamepads),document.addEventListener("keydown",function(e){e=e||window.event,!p8_is_running||1==pico8_state.has_focus&&0>[17,88,67,86].indexOf(e.keyCode)&&e.preventDefault&&e.preventDefault()},{passive:!1});var p8_aspect=1;function activate_p8_player(e,t,A,n,o){var a=document.getElementById("p8_frame_0"),l=document.getElementById(n),d=document.getElementById(o);if(p8_aspect=1,0<=e.indexOf("vox")&&(p8_aspect=820/512),a){for(a.parentNode.removeChild(a),l.appendChild(a),a.style="display:table; width:100%;height:100%; max-width:100vw;max-height:100vh; min-width:256px;min-height:256px;margin:0px;background-color:#111",d.style.display="none",p8_touch_detected&&(el=document.getElementById("body_0"),el&&(el.style.display="none"),el.parentNode.appendChild(document.getElementById("p8_frame_0"))),p8_run_cart(e,t,A),embedded=window.parent&&window.parent!=window?1:0,microAjax("/bbs/on_play.php?id="+t+"&embedded="+embedded+"&cab=0",function(e){var A=document.getElementById("more_carts_"+t);A&&(A.innerHTML=e)}),els=document.getElementsByClassName("dormant_player"),i=0;i