
(function(){var ns=rx.namespace('stream.show.notify');var cookie=rx.util.cookie;var w=$(window);if(document.hasFocus)
ns.hasfocus=function(){return document.hasFocus();};else{w.focus(function(){delete ns.blur;}).blur(function(){ns.blur=true;});ns.hasfocus=function(){return!ns.blur;};}
function setfavicon(href){var cur=$('link[rel*=icon]');var old=cur.attr('href');cur.remove();$('<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="'+
href+'" />').appendTo('head');return old;}
new Image().src=ns.faviconalturl;var oldfav=null;var oldtitle=null;var flashtime=null;var flashto=null;function stopflash(){clearInterval(flashto);flashto=null;if(oldtitle!==null){document.title=oldtitle;oldtitle=null;}
if(oldfav!==null){setfavicon(oldfav);oldfav=null;}}
w.focus(stopflash);ns.flash=function(txt){stopflash();function f(){if(oldtitle!==null){document.title=oldtitle;oldtitle=null;}else{oldtitle=document.title;document.title=txt;}
if(oldfav!==null){setfavicon(oldfav);oldfav=null;}else oldfav=setfavicon(ns.faviconalturl);if((flashtime*=1.125)>1250)stopflash();else flashto=setTimeout(f,flashtime);}
flashtime=100;f();};ns.sound=function(name){};var checkbox=$('.footer .tools .sound input');checkbox.click(function(){if(this.checked){cookie.set('stream-sound-off',null,0);ns.soundon=true;}else{cookie.set('stream-sound-off','',3600*24*365);delete ns.soundon;}}).removeAttr('onclick');})();