!function(){function e(){$("#facebook-code-link").attr("href","https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/"),$("#facebook-code-link").attr("onclick","window.open('https://www.facebook.com/sharer/sharer.php?u=https://zoff.me/', 'Share Zoff','width=600,height=300'); return false;"),$("#twitter-code-link").attr("href","https://twitter.com/intent/tweet?url=https://zoff.me/&text=Check%20out%20Zoff!&via=zoffmusic"),$("#twitter-code-link").attr("onclick","window.open('https://twitter.com/intent/tweet?url=https://zoff.me/&text=Check%20out%20Zoff!&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.me/&choe=UTF-8&chld=L%7C1"),$("#qr-code-image-link").attr("src","//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.me/&choe=UTF-8&chld=L%7C1")}function t(){var t=new Date;q.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)&&q.to_channel(t[3],!0)},A=$("#channel-list-container").html(),"fb.zoff.me"!=window.location.hostname&&e(),"zoff.me"==window.location.hostname?add="https://zoff.me":add=window.location.hostname,(void 0===V||Y.mobilecheck())&&(V=io.connect(""+add+":8080",rt)),0!==$("#alreadyfp").length&&!Y.mobilecheck()&&V._callbacks.$playlists||m(),$("#about").modal(),$("#help").modal(),$("#contact").modal(),Y.log("----"),Y.log("Sending frontpage_lists"),Y.log("Socket",V),Y.log("-----"),O.init(),O.get_offline()?T(!0,De):$("#offline-mode").tooltip({delay:5,position:"bottom",tooltip:"Enable private mode"}),V.emit("frontpage_lists"),$("#channel-load").css("display","none"),"#donation"==window.location.hash&&(window.location.hash="#",$("#donation").modal("open")),localStorage.ok_cookie||(M(),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")}),!Y.mobilecheck()&&q.winter&&$(".mega").prepend('
'),Y.mobilecheck()&&$("input#searchFrontpage").characterCounter(),window.__onGCastApiAvailable=function(e,t){e&&(Ye=!0)}}function a(){Oe=0;var e=!0;J=$("#chan").html(),Ze=Y.mobilecheck();var t=Y.mobilecheck()?"left":"right";if(window.onpopstate=function(e){N()},"fb.zoff.me"!=window.location.hostname&&L(),"zoff.me"==window.location.hostname?add="https://zoff.me":add=window.location.hostname,void 0!==ut&&(ut.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(),S(xe),Je=$("#temp-results-container"),We=$("#empty-results-container").html(),Te=$(".not-imported-container").html(),Se=$(".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"),O.set_width($(this).width()),k()},handles:"e",minWidth:350,maxWidth:$(window).width()-241}),(void 0===V||Y.mobilecheck())&&(e=!1,V=io.connect(""+add+":8080",rt)),O.init(),O.get_offline()&&($(".offline_switch_class")[0].checked=!0,T(!0,De)),0===$("#alreadychannel").length||Y.mobilecheck())s(),l(),c(),d();else{$("#channel-load").css("display","none"),$("#player").css("opacity","1"),$("#controls").css("opacity","1"),$(".playlist").css("opacity","1"),ut.readyLooks(),gt.initYoutubeControls(ut.player),gt.initSlider(),ut.player.setVolume(O.get_volume()),$(".video-container").removeClass("no-opacity");var a="https://remote."+window.location.hostname+"/"+Qe;$("#code-text").text(Qe),$("#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&&V.emit("list",J.toLowerCase()),$("#viewers").tooltip({delay:5,position:"top",tooltip:"Viewers"}),window.onYouTubeIframeAPIReady=ut.onYouTubeIframeAPIReady,(""===ut.player||void 0===ut.player||Y.mobilecheck())&&ut.loadPlayer(),Y.mobilecheck()?pt.initiate_volume():$("input#chan_description").characterCounter(),p(),h(),u(),Y.mobilecheck()||0!==$("#alreadychannel").length||f(),Y.msieversion()||Y.mobilecheck()||Notification.requestPermission(),$(".search_input").focus(),Y.sample(),$(".castButton-unactive").tooltip({delay:5,position:"top",tooltip:"Cast Zoff to TV"}),$(".castButton-active").tooltip({delay:5,position:"top",tooltip:"Stop casting"}),$("#results").hover(function(){$("div.result").removeClass("hoverResults"),me=0},function(){}),$("#search").focus(),$("#embed-button").css("display","inline-block"),$("#embed-area").val(w(Be,Ee,Ie,Pe)),$("#search").attr("placeholder","Find song on YouTube..."),/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())||Y.mobilecheck()||$(".castButton-unactive").css("display","none"),Y.log("chromecastAvailable"+Ae),Y.log("chromecastAvailable"+Ye),Ae?n(1):Ye?initializeCastApi():window.__onGCastApiAvailable=function(e,t){e?setTimeout(function(){Ye=!0,initializeCastApi()},1e3):Ye=!0},Y.mobilecheck()||null!=navigator.userAgent.match(/iPad/i)||setTimeout(function(){k()},100)}function n(e){if($(".castButton-unactive").toggleClass("hide"),$(".castButton-active").toggleClass("hide"),1==e){$("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide");try{ut.player.stopVideo()}catch(e){}ut.stopInterval=!0,$("#player_overlay").removeClass("hide"),$("#player_overlay").css("display","block"),Y.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/"+nt+"/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
"+F.La.friendlyName),ut.player.setVolume(100),$("#player_overlay_text").toggleClass("hide")}else 0==e&&($("#duration").toggleClass("hide"),$("#fullscreen").toggleClass("hide"),ut.player.playVideo(),ut.stopInterval=!1,duration=ut.player.getDuration(),ut.durationSetter(),Y.mobilecheck()||(ut.player.setVolume(O.get_volume()),$("#volume").slider("value",O.get_volume())),$("#player_overlay").addClass("hide"),$("#player_overlay_text").toggleClass("hide"),$("#chromecast_text").html(""),$("#playing_on").css("display","none"),De?ut.loadVideoById(nt):V.emit("pos",{channel:J.toLowerCase()}))}function i(e,t){var a=JSON.parse(t);switch(a.type){case-1:De?ut.playNext():V.emit("end",{id:a.videoId,channel:J.toLowerCase()});break;case 0:De?ut.playNext():V.emit("skip",{error:a.data_code,id:a.videoId,pass:oe,channel:J.toLowerCase})}}function o(){V.on("connect_failed",function(){Y.log("Connection Failed"),Le||(Le=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))}),V.on("connect_error",function(){Y.log("Connection Failed."),Le||(Le=!0,Materialize.toast("Error connecting to server, please wait..",1e8,"red lighten connect_error"))})}function s(){V.on("np",ut.youtube_listener)}function l(){V.on("get_list",function(){V.emit("list",J.toLowerCase())})}function c(){V.on("suggested",function(e){var t=!0;void 0===e.id&&(t=!1),mt.catchUserSuggests(e,t)})}function d(){V.on("viewers",function(e){re=e,void 0!==st&&ut.getTitle(st,re)})}function p(){V.on("toast",D.toast),V.on("pw",D.pw),V.on("conf",D.conf)}function u(){V.on("chat.all",j.allchat),V.on("chat",j.channelchat)}function h(){V.on("channel",G.channel_function)}function m(){Y.log("Setting up playlist_listener"),V.on("playlists",q.frontpage_function)}function f(){V.on("id",U.host_listener)}function y(e){V.on(e,U.host_on_action)}function v(){localStorage.debug=!0}function _(){localStorage.debug=!1}function w(e,t,a,n){return'