!function(){function e(){$("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.no/', 'Share Zöff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","https://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('https://twitter.com/intent/tweet?url=https://zoff.no/&text=Check%20out%20Zöff!&via=zoffmusic','Share Playlist','width=600,height=300'); return false;"),$("#qr-code-link").attr("href","//chart.googleapis.com/chart?chs=500x500&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/&choe=UTF-8&chld=L%7C1")}function t(){var t=new Date;j.blob_list=[],3==t.getMonth()&&1==t.getDate()&&($(".mega").css("-webkit-transform","rotate(180deg)"),$(".mega").css("-moz-transform","rotate(180deg)")),window.onpopstate=function(e){var t=window.location.href.split("/");""!==t[3]&&"#"!=t[3].substring(0,1)&&j.to_channel(t[3],!0)},M=$("#channel-list-container").html(),e(),"zoff.no"==window.location.hostname?add="https://zoff.no":add=window.location.hostname,(void 0===A||R.mobilecheck())&&(A=io.connect(""+add+":8080",nt)),0!==$("#alreadyfp").length&&!R.mobilecheck()&&A._callbacks.$playlists||m(),$("#about").modal(),$("#help").modal(),$("#contact").modal(),R.log("----"),R.log("Sending frontpage_lists"),R.log("Socket",A),R.log("-----"),D.init(),D.get_offline()?S(!0,Ae):$("#offline-mode").tooltip({delay:5,position:"bottom",tooltip:"Enable private mode"}),A.emit("frontpage_lists"),$("#channel-load").css("display","none"),"#donation"==window.location.hash&&(window.location.hash="#",$("#donation").modal("open")),localStorage.ok_cookie||(B(),Materialize.toast("We're using cookies to enhance your experience! ok",1e4));var a=0;document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="http://etys.no")}),!R.mobilecheck()&&j.winter&&$(".mega").prepend('
'),R.mobilecheck()&&$("input#searchFrontpage").characterCounter(),window.__onGCastApiAvailable=function(e,t){e&&(De=!0)}}function a(){var e=!0;G=$("#chan").html(),Ge=R.mobilecheck();var t=R.mobilecheck()?"left":"right";if(window.onpopstate=function(e){L()},E(),"zoff.no"==window.location.hostname?add="https://zoff.no":add=window.location.hostname,void 0!==lt&&(lt.stopInterval=!1),$("ul.playlist-tabs").tabs(),$("ul.playlist-tabs-loggedIn").tabs(),$("ul.chatTabs").tabs(),$("#settings").sideNav({menuWidth:300,edge:t,closeOnClick:!1}),$(".collapsible").collapsible({accordion:!0}),$("#help").modal(),$("#contact").modal(),$("#embed").modal(),T(we),Ye=$("#temp-results-container"),He=$("#empty-results-container").html(),be=$(".not-imported-container").html(),ke=$(".not-exported-container").html(),$(".not-imported-container").empty(),$(".not-exported-container").empty(),$(".video-container").resizable({start:function(e,t){$("iframe").css("pointer-events","none")},stop:function(e,t){$("iframe").css("pointer-events","auto"),D.set_width($(this).width()),k()},handles:"e",minWidth:350,maxWidth:$(window).width()-241}),(void 0===A||R.mobilecheck())&&(e=!1,A=io.connect(""+add+":8080",nt)),D.init(),D.get_offline()&&($(".offline_switch_class")[0].checked=!0,S(!0,Ae)),0===$("#alreadychannel").length||R.mobilecheck())s(),l(),c(),d();else{$("#channel-load").css("display","none"),$("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),lt.readyLooks(),rt.initYoutubeControls(lt.player),rt.initSlider(),lt.player.setVolume(D.get_volume()),$(".video-container").removeClass("no-opacity");var a="https://remote."+window.location.hostname+"/"+Fe;$("#code-text").text(Fe),$("#code-qr").attr("src","https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+a),$("#code-link").attr("href",a)}e&&A.emit("list",G.toLowerCase()),$("#viewers").tooltip({delay:5,position:"top",tooltip:"Viewers"}),window.onYouTubeIframeAPIReady=lt.onYouTubeIframeAPIReady,(""===lt.player||void 0===lt.player||R.mobilecheck())&<.loadPlayer(),R.mobilecheck()?st.initiate_volume():$("input#chan_description").characterCounter(),p(),h(),u(),R.mobilecheck()||0!==$("#alreadychannel").length||f(),R.msieversion()||R.mobilecheck()||Notification.requestPermission(),$(".search_input").focus(),R.sample(),$(".castButton-unactive").tooltip({delay:5,position:"top",tooltip:"Cast Zöff to TV"}),$(".castButton-active").tooltip({delay:5,position:"top",tooltip:"Stop casting"}),$("#results").hover(function(){$("div.result").removeClass("hoverResults"),pe=0},function(){}),$("#search").focus(),$("#embed-button").css("display","inline-block"),$("#embed-area").val(w(Se,xe,Ce,Le)),$("#search").attr("placeholder","Find song on YouTube..."),/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())||R.mobilecheck()||$(".castButton-unactive").css("display","none"),Be?n(1):De?initializeCastApi():window.__onGCastApiAvailable=function(e,t){e?setTimeout(function(){De=!0,initializeCastApi()},1e3):De=!0},R.mobilecheck()||null!=navigator.userAgent.match(/iPad/i)||k()}function n(e){if($(".castButton-unactive").toggleClass("hide"),$(".castButton-active").toggleClass("hide"),1==e){$("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide");try{lt.player.stopVideo()}catch(e){}lt.stopInterval=!0,$("#player_overlay").removeClass("hide"),$("#player_overlay").css("display","block"),R.mobilecheck()?$("#pause").hasClass("hide")?($("#play").toggleClass("hide"),$("#pause").toggleClass("hide")):$("#play").hasClass("hide")&&($("#play").toggleClass("hide"),$("#pause").toggleClass("hide")):($("#volume").slider("value",100),$("#player_overlay").width($("#player").width()+1)),$("#player_overlay").css("background","url(https://i.ytimg.com/vi/"+Xe+"/maxresdefault.jpg)"),$("#player_overlay").css("background-position","center"),$("#player_overlay").css("background-size","100%"),$("#player_overlay").css("background-color","black"),$("#player_overlay").css("background-repeat","no-repeat"),$("#player_overlay").css("height","calc(100% - 32px)"),$("#playing_on").css("display","flex"),$("#chromecast_text").html("Playing on
"+q.La.friendlyName),lt.player.setVolume(100),$("#player_overlay_text").toggleClass("hide")}else 0==e&&($("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide"),lt.player.playVideo(),lt.stopInterval=!1,duration=lt.player.getDuration(),lt.durationSetter(),R.mobilecheck()||(lt.player.setVolume(D.get_volume()),$("#volume").slider("value",D.get_volume())),$("#player_overlay").addClass("hide"),$("#player_overlay_text").toggleClass("hide"),$("#chromecast_text").html(""),$("#playing_on").css("display","none"),Ae?lt.loadVideoById(Xe):A.emit("pos",{channel:G.toLowerCase()}))}function i(e,t){var a=JSON.parse(t);switch(a.type){case-1:Ae?lt.playNext():A.emit("end",{id:a.videoId,channel:G.toLowerCase()});break;case 0:Ae?lt.playNext():A.emit("skip",{error:a.data_code,id:a.videoId,pass:ae,channel:G.toLowerCase})}}function o(){A.on("connect_failed",function(){R.log("Connection Failed"),Te||(Te=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))}),A.on("connect_error",function(){R.log("Connection Failed."),Te||(Te=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))})}function s(){A.on("np",lt.youtube_listener)}function l(){A.on("get_list",function(){A.emit("list",G.toLowerCase())})}function c(){A.on("suggested",function(e){var t=!0;void 0===e.id&&(t=!1),dt.catchUserSuggests(e,t)})}function d(){A.on("viewers",function(e){oe=e,void 0!==tt&<.getTitle(tt,oe)})}function p(){A.on("toast",z.toast),A.on("pw",z.pw),A.on("conf",z.conf)}function u(){A.on("chat.all",V.allchat),A.on("chat",V.channelchat)}function h(){A.on("channel",H.channel_function)}function m(){R.log("Setting up playlist_listener"),A.on("playlists",j.frontpage_function)}function f(){A.on("id",Y.host_listener)}function y(e){A.on(e,Y.host_on_action)}function v(){localStorage.debug=!0}function _(){localStorage.debug=!1}function w(e,t,a,n){return'