!function(){var e="avnavsplit.percent",t=-1,n=-1,o=document.getElementById("mover"),i=document.getElementById("left"),a=document.getElementById("right"),c=document.getElementById("split_main"),r=function(e){var t=i.getBoundingClientRect().width;e&&(t+=e);var n=o.getBoundingClientRect();o.style.left=t-n.width/2+"px"},d=function(t){i.style.width=t+"%",a.style.width=100-t+"%",r(),window.localStorage&&window.localStorage.setItem(e,t+""),window.setTimeout(function(){o.style.opacity=.3},5e3)},l=function(e){var t=c.getBoundingClientRect(),n=i.getBoundingClientRect().width,o=100*(n+=e)/t.width;o<0&&(o=0),o>=99.999&&(o=99.999),d(o)};o.addEventListener("dragstart",function(e){n=e.screenX,o.style.opacity=.6}),o.addEventListener("touchstart",function(e){e.preventDefault();var t=e.changedTouches[0];n=parseInt(t.screenX),o.style.opacity=.6,r()}),o.addEventListener("touchmove",function(e){if(!(n<0)){var o=e.changedTouches[0];t=parseInt(o.screenX),r(t-n)}}),o.addEventListener("touchend",function(e){if(!(n<0)){var o=e.changedTouches[0];t=parseInt(o.screenX),l(t-n),n=-1}}),o.addEventListener("dragend",function(e){e.preventDefault(),n<0||(l(e.screenX-n),n=-1)});var s=50;if(window.localStorage){var u=window.localStorage.getItem(e);u&&(s=parseInt(u))}var w,v=window.location.href+"",f=v=v.replace("viewer_split","avnav_viewer"),m={};["fullscreen","dimm"].forEach(function(e){var t=function(e,t){let n=RegExp(e+"[^&]+").exec(t||window.location.search);return decodeURIComponent(n?n.toString().replace(/^[^=]+./,""):"")}(e,f);t&&(m[e]=t)}),f=f.replace(/\?.*/,"");var p="?";for(w in m)f+=p+encodeURIComponent(w)+"="+encodeURIComponent(m[w]),p="&";if(v.match(/[?]/)||(v+="?"),v+="&splitMode=true",window.location.search.match(/split=/)){var g=window.location.search.replace(/.*split=/,"").replace(/[^0-9].*/,"");isNaN(g)||(s=g)}d(s),i.src=v+"&storePrefix=1&preventAlarms=true&ignoreAndroidBack=true",a.src=v+"&storePrefix=2",window.addEventListener("resize",function(){r()});const h=(e,t)=>{"string"==typeof e&&(e={type:e}),[i,a].forEach(function(n){t&&n.contentWindow===t||n.contentWindow.postMessage(e,window.location.origin)})};window.addEventListener("message",function(e){let t=e.data.type;if(["dimm"].indexOf(t)>=0)h(e.data,e.source);else{if("fullscreen"===t){let e=!1;document.fullscreenElement?document.exitFullscreen():(document.body.requestFullscreen(),e=!0),h({type:"fullScreenChanged",isFullScreen:e})}"settingsChanged"===t&&h("reloadSettings"),"finishSplit"===t&&(h("stopLeave"),window.setTimeout(()=>window.location.replace(f),100))}}),window.avnavAndroid&&(window.avnav||(window.avnav={}),window.avnav.android||(window.avnav.android={receiveEvent:(e,t)=>{h({type:"android",key:e,param:t})}}));let y="AVNav-Web";window.setInterval(function(){i.contentDocument&&i.contentDocument.title.match(y)||a.contentDocument&&a.contentDocument.title.match(y)?document.title=y+"-Split":document.title="AVNav-Split loading..."},500)}();