function docDomain(){var n=window.location.hostname,t=n.search("cbc.ca");return t>-1?document.domain="cbc.ca":null}function isIE(){var t=!!window.MSStream;return alert(t),t||Prototype.Browser.IE}function crumbleCookie(n){for(var i=document.cookie.split(";"),r={},u,f,t=0;t<i.length;t++)u=i[t].substring(0,i[t].indexOf("=")).trim(),f=i[t].substring(i[t].indexOf("=")+1,i[t].length).trim(),r[u]=f;return n?r[n]?r[n]:null:r}function gaCookies(){var n=function(){var n;if(crumbleCookie("__utma"))n=crumbleCookie("__utma").split(".");else return null;var t=n[0],i=n[1],r=n[2],u=n[3],f=n[4],e=n[5];return{cookie:n,domainhash:t,uniqueid:i,ftime:r,ltime:u,stime:f,sessions:e}},i=function(){var n,t;if(crumbleCookie("__utmb"))n=crumbleCookie("__utmb").split(".");else return null;return t=n[1],{cookie:n,gifrequest:t}},r=function(){var n,t;if(crumbleCookie("__utmv"))n=crumbleCookie("__utmv").split(".");else return null;return t=n[1],{cookie:n,value:t}},t=function(){var r,u,f,e,o,s,h,i,t,c,n;if(crumbleCookie("__utmz"))r=crumbleCookie("__utmz").split(".");else return null;for(i=r[4].split("|"),t=0;t<i.length;t++){c=i[t].substring(0,i[t].indexOf("=")),n=decodeURIComponent(i[t].substring(i[t].indexOf("=")+1,i[t].length)),n=n.replace(/^\(|\)$/g,"");switch(c){case"utmcsr":u=n;break;case"utmcmd":f=n;break;case"utmccn":e=n;break;case"utmctr":o=n;break;case"utmcct":s=n;break;case"utmgclid":h=n}}return{cookie:r,source:u,medium:f,name:e,term:o,content:s,gclid:h}};this.getDomainHash=function(){return n()&&n().domainhash?n().domainhash:null},this.getUniqueId=function(){return n()&&n().uniqueid?n().uniqueid:null},this.getInitialVisitTime=function(){return n()&&n().ftime?n().ftime:null},this.getPreviousVisitTime=function(){return n()&&n().ltime?n().ltime:null},this.getCurrentVisitTime=function(){return n()&&n().stime?n().stime:null},this.getSessionCounter=function(){return n()&&n().sessions?n().sessions:null},this.getGifRequests=function(){return i()&&i().gifrequest?i().gifrequest:null},this.getUserDefinedValue=function(){return r()&&r().value?decodeURIComponent(r().value):null},this.getCampaignSource=function(){return t()&&t().source?t().source:null},this.getCampaignMedium=function(){return t()&&t().medium?t().medium:null},this.getCampaignName=function(){return t()&&t().name?t().name:null},this.getCampaignTerm=function(){return t()&&t().term?t().term:null},this.getCampaignContent=function(){return t()&&t().content?t().content:null},this.getGclid=function(){return t()&&t().gclid?t().gclid:null}}var CBCR3,debug,traceCount,Trace,CBCDetect,myDomain,isLive,asual,SWFAddressEvent,SWFAddress;typeof CBCR3!="undefined"&&CBCR3||(CBCR3={}),debug=!1,traceCount=0,CBCR3.namespace=function(){for(var u=arguments,t=null,n,i,r=0;r<u.length;r=r+1)for(i=(""+u[r]).split("."),t=CBCR3,n=i[0]=="CBCR3"?1:0;n<i.length;n=n+1)t[i[n]]=t[i[n]]||{},t=t[i[n]];return t},Trace={log:function(n){this._outputToConsole(n)},error:function(n){var t=n.fileName,i=n.lineNumber;this._outputToConsole("ERROR - message: "+n.message+" error:"+n+" fileName: "+t+" lineNumber: "+i)},write:function(n,t){debug?this._outputToConsole(n):t&&this._outputToConsole(n)},_outputToConsole:function(n){window.top.location.href.toQueryParams().debug&&(typeof window.opera!="undefined"&&window.opera.postError(n),typeof console!="undefined"&&(traceCount++,console.log(this._source+" "+traceCount+":"),console.log(n)))},_source:""},Array.prototype.filter||(Array.prototype.filter=function(n){var f=this.length>>>0,i,u,t,r;if(typeof n!="function")throw new TypeError;for(i=[],u=arguments[1],t=0;t<f;t++)t in this&&(r=this[t],n.call(u,r,t,this)&&i.push(r));return i}),CBCDetect={isIE:function(){var n=!!window.MSStream;return Prototype&&Prototype.Browser?n||Prototype.Browser.IE:n}},CBCR3.environment=function(){return top.document._r3Environment||(top.document._r3Environment={}),top.document._r3Environment},CBCR3.namespace("CBCR3.Commons"),CBCR3.Commons.Event=Class.create({initialize:function(n,t,i){this.type=n,this.data=t,this.target=i}}),CBCR3.namespace("CBCR3.Commons"),CBCR3.Commons.EventDispatcher=Class.create({listenerChain:null,debug:!1,initialize:function(){},buildListenerChain:function(){this.listenerChain||(this.listenerChain={})},getListeners:function(){return this.listenerChain?this.listenerChain:null},addEventListener:function(n,t){!t instanceof Function&&alert("Listener isn't a function"),this.buildListenerChain(),this.listenerChain[n]?this.listenerChain[n].push(t):this.listenerChain[n]=[t]},hasEventListener:function(n){return this.listenerChain?typeof this.listenerChain[n]!="undefined":!1},removeEventListenerType:function(n){if(!this.hasEventListener(n))return!1;this.listenerChain[n]=[]},removeEventListener:function(n,t){if(!this.hasEventListener(n))return!1;Trace.write("METANODE: removeEventListener BEFORE",this.debug),Trace.write(this.listenerChain[n],this.debug),Trace.write(t,this.debug),Trace.write(this.listenerChain,this.debug);for(var i=0;i<this.listenerChain[n].length;i++)this.listenerChain[n][i]==t&&(Trace.write("equal",this.debug),this.listenerChain[n].splice(i,1));Trace.write("METANODE: removeEventListener AFTER",this.debug),Trace.write(this.listenerChain,this.debug)},clearEventListeners:function(){this.listenerChain={}},dispatchEvent:function(n,t,i){var r;if(typeof n=="object"?(r=n,n=r.type):r=new CBCR3.Commons.Event(n,t,i||this),this.buildListenerChain(),!this.hasEventListener(n))return!1;this.listenerChain[n].any(function(n){return n(r)==!1?!0:!1})}}),CBCR3.namespace("CBCR3.Commons"),CBCR3.Commons.DeepLinkController=Class.create({swfAddress:null,loaded:!1,url:"",changeInterval:0,defaultUrl:"",applicationPath:"",debug:!0,deepLinkChanged:!1,changeCount:0,browserList:null,firstLoad:!0,createMetaTag:null,currentUrl:null,initialize:function(n,t){this.defaultUrl=n,this.applicationPath=t},setInstance:function(n){this.loaded=!0,this.swfAddress=n,this.swfAddress.setHistory(!0),this.swfAddress.addEventListener("init",this.onSwfAddressInit.bind(this)),this.swfAddress.addEventListener("externalChange",this.onSwfAddressChange.bind(this))},setBrowserList:function(n){this.browserList=n},onSwfAddressInit:function(){this.url=this.swfAddress.getValue(),this.changeUrl(this.url)},changeUrl:function(n){if(n!=null&&n!=""){n=n.replace(/^!/g,"");var t=document.location.href;(t!=null&&t.indexOf("/#!/")<0&&t.indexOf("/#/")>-1&&(document.location.href=t.replace("/#/","/#!/")),this.currentUrl==null||this.currentUrl!=n)&&(n=this.parseUrl(n),Trace.write("changeUrl() url:"+n,this.debug),Trace.write(this.isRootUrl(n),this.debug),Trace.write(this.defaultUrl,this.debug),this.isRootUrl(n)?$("client").src=this.getDebugString(this.defaultUrl):this.isPlayPermalink(n)?document.location=n:$("client").src=n)}},isPlayPermalink:function(n){return n!=null&&(n.indexOf("/play/")>-1||n.indexOf("/stream/")>-1)&&n.indexOf(".aspx")<0},isStreamPermalink:function(n){return n!=null&&n.indexOf("/stream/")>-1&&n.indexOf(".aspx")<0},isRootUrl:function(n){return n==this.applicationPath||n=="/"||n.blank()},isExternalUrl:function(n){return n!=null&&n.indexOf("/http")==0},onSwfAddressChange:function(n){this.url=n.value,this.changeUrl(this.url)},listenForChange:function(){Prototype.Browser.IE&&(this.changeInterval=setInterval(this.checkChange.bind(this),500))},stopListenForChange:function(){Prototype.Browser.IE&&(clearInterval(this.changeInterval),this.changeInterval=0)},checkChange:function(){var i=this.swfAddress.getValue(),n=decodeURIComponent(this.url).strip(),t=decodeURIComponent(this.swfAddress.getValue()).strip();n!=t&&(this.url=this.swfAddress.getValue(),clearInterval(this.changeInterval),this.changeUrl(this.url))},setBrowserValue:function(n){this.setValue(n)},parseUrl:function(n){if(n!=null){var t=n.replace(/;amp;/ig,"&");n=t.replace(/;que;/ig,"?")}return n},getDebugString:function(n){if(n.indexOf("debug=true")>-1)return n;if(document.location.href.indexOf("debug=true")>-1){var t=n.indexOf("?")>-1?"&":"?";return n+t+"debug=true"}return n},setValue:function(n,t){try{if(n=this.parseUrl(n),t&&n.indexOf("?br=")>-1)return;this.isExternalUrl(n)&&(window.location=n.substr(1)),(this.loaded&&this.url!=n||document.location.href.indexOf("/#!/")<0)&&(this.isRootUrl(n)&&this.firstLoad?this.firstLoad=!1:this.swfAddress.setValue(n)),this.url=n,this.firstLoad=!1}catch(i){Trace.error(i)}},getParameterNames:function(){if(this.swfAddress)return this.swfAddress.getParameterNames()},getParameter:function(n){return this.swfAddress&&(n!=null||n!="")?this.swfAddress.getParameter(n):null}}),CBCR3.namespace("CBCR3.Services"),CBCR3.Services.NodeListenerService=Class.create(CBCR3.Commons.EventDispatcher,{nodeservice:null,initialize:function($super,n){$super(),this.nodeservice=n,this.nodeservice.addEventListener("metaNode:updated",this.metanodeUpdateHandler.bind(this)),this.nodeservice.addEventListener("metaNode:playerupdated",this.metanodePlayerUpdateHandler.bind(this))},metanodeUpdateHandler:function(n){Trace.write(" Index metanodeUpdateHandler()",!1),Trace.write(n,!1),this.dispatchEvent("metaNode:updated",{value:n.data.value})},metanodePlayerUpdateHandler:function(n){Trace.write(" Index metanodeUpdateHandler()",!1),Trace.write(n,!1),this.dispatchEvent("metaNode:playerupdated",{value:n.data.value})},joinRoom:function(n){this.nodeservice!=null&&this.nodeservice.joinRoom(n)},leaveRoom:function(n){this.nodeservice!=null&&this.nodeservice.leaveRoom(n)},joinWebStationRoom:function(n){this.nodeservice!=null&&this.nodeservice.joinWebStationRoom(n)}}),myDomain=window.location.hostname,isLive=myDomain.indexOf("cbc.ca"),isLive>-1&&(document.domain="cbc.ca"),asual||(asual={}),asual.util||(asual.util={}),asual.util.Browser=new function(){var n=navigator.userAgent.toLowerCase(),i=/webkit/.test(n),r=/opera/.test(n),t=/msie/.test(n)&&!/opera/.test(n),u=/mozilla/.test(n)&&!/(compatible|webkit)/.test(n),f=parseFloat(t?n.substr(n.indexOf("msie")+4):(n.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1]);this.toString=function(){return"[class Browser]"},this.getVersion=function(){return f},this.isMSIE=function(){return t},this.isSafari=function(){return i},this.isOpera=function(){return r},this.isMozilla=function(){return u}},asual.util.Events=new function(){var r="DOMContentLoaded",u="onstop",f=window,n=document,t=[],s=asual.util,h=s.Browser,i=h.isMSIE(),e=h.isSafari(),o,c;this.toString=function(){return"[class Events]"},this.addListener=function(n,u,f){t.push({o:n,t:u,l:f}),u==r&&(i||e)||(n.addEventListener?n.addEventListener(u,f,!1):n.attachEvent&&n.attachEvent("on"+u,f))},this.removeListener=function(n,u,f){for(var s=0,o;o=t[s];s++)if(o.o==n&&o.t==u&&o.l==f){t.splice(s,1);break}u==r&&(i||e)||(n.removeEventListener?n.removeEventListener(u,f,!1):n.detachEvent&&n.detachEvent("on"+u,f))},o=function(){for(var i=0,n;n=t[i];i++)n.t!=r&&s.Events.removeListener(n.o,n.t,n.l)},c=function(){if(n.readyState=="interactive"){function t(){n.detachEvent(u,t),o()}n.attachEvent(u,t),f.setTimeout(function(){n.detachEvent(u,t)},0)}},(i||e)&&function(){try{(i&&n.body||!/loaded|complete/.test(n.readyState))&&n.documentElement.doScroll("left")}catch(u){return setTimeout(arguments.callee,0)}for(var f=0,u;u=t[f];f++)u.t==r&&u.l.call(null)}(),i&&f.attachEvent("onbeforeunload",c),this.addListener(f,"unload",o)},asual.util.Functions=new function(){this.toString=function(){return"[class Functions]"},this.bind=function(n,t){for(var r=2,u,f=[];u=arguments[r];r++)f.push(u);return function(){return n.apply(t,f)}}},SWFAddressEvent=function(n){var t,i,r;for(this.toString=function(){return"[object SWFAddressEvent]"},this.type=n,this.target=[SWFAddress][0],this.value=SWFAddress.getValue(),this.path=SWFAddress.getPath(),this.pathNames=SWFAddress.getPathNames(),this.parameters={},t=SWFAddress.getParameterNames(),i=0,r=t.length;i<r;i++)this.parameters[t[i]]=SWFAddress.getParameter(t[i]);this.parameterNames=t},SWFAddressEvent.INIT="init",SWFAddressEvent.CHANGE="change",SWFAddressEvent.INTERNAL_CHANGE="internalChange",SWFAddressEvent.EXTERNAL_CHANGE="externalChange",SWFAddress=new function(){var y=function(){var t=n.href.indexOf("#!"),i=2;return t<0&&(t=n.href.indexOf("#"),i=1),t!=-1?hi(nt(n.href.substr(t+i))):""},yi=function(){try{return top.document,top}catch(n){return window}},yt=function(n,t){return s.strict&&(n=t?n.substr(0,1)!="/"?"/"+n:n:n==""?"/":n),n},ot=function(t,i){return l&&n.protocol=="file:"?i?r.replace(/\?/,"%3F"):r.replace(/%253F/,"?"):t},ti=function(n){if(n.childNodes)for(var t=0,r=n.childNodes.length,i;t<r;t++)if(n.childNodes[t].src&&(at=String(n.childNodes[t].src)),i=ti(n.childNodes[t]))return i},pt=function(){i.title!=dt&&i.title.indexOf("#!")!=-1&&(i.title=dt)},ii=function(){if(!vt){var i=y(),u=!(r==i);d&&e<523?rt!=p.length&&(rt=p.length,typeof tt[rt-1]!=t&&(r=tt[rt-1]),ht.call(this,!1)):l&&u?e<7?n.reload():this.setValue(i):u&&(r=i,n.hash="#!"+i,ht.call(this,!1)),l&&pt.call(this)}},pi=function(e){if(b.length>0){var popup=window.open(b[0],b[1],eval(b[2]));typeof b[3]!=t&&eval(b[3])}b=[]},wi=function(){for(var r,u,o=0,f,n,e=SWFAddress.getValue(),i="setSWFAddressValue";f=w[o];o++)n=document.getElementById(f),n?n.parentNode&&typeof n.parentNode.so!=t?n.parentNode.so.call(i,e):(n&&typeof n[i]!=t||(r=n.getElementsByTagName("object"),u=n.getElementsByTagName("embed"),n=r[0]&&typeof r[0][i]!=t?r[0]:u[0]&&typeof u[0][i]!=t?u[0]:null),n&&n[i](e)):(n=document[f])&&typeof n[i]!=t&&n[i](e)},st=function(n){this.dispatchEvent(new SWFAddressEvent(n)),n=n.substr(0,1).toUpperCase()+n.substr(1),typeof this["on"+n]==ct&&this["on"+n]()},bi=function(){lt.Browser.isSafari()&&i.body.addEventListener("click",pi),st.call(this,"init")},ri=function(){wi(),st.call(this,"change")},ht=function(n){ri.call(this),n?st.call(this,"internalChange"):st.call(this,"externalChange"),it(k.bind(wt,this),10)},wt=function(){var i=(n.pathname+(/\/$/.test(n.pathname)?"":"/")+this.getValue()).replace(/\/\//,"/").replace(/^\/$/,""),r=o[s.tracker];typeof r==ct?r(i):typeof o.pageTracker!=t&&typeof o.pageTracker._trackPageview==ct?o.pageTracker._trackPageview(i):typeof o.urchinTracker==ct&&o.urchinTracker(i)},ui=function(){var n=u.contentWindow.document;n.open(),n.write("<html><head><title>"+i.title+"<\/title><script>var "+h+' = "'+y()+'";<\/script><\/head><\/html>'),n.close()},ki=function(){var i=u.contentWindow,e=i.location.href;r=typeof i[h]!=t?i[h]:"",r!=y()&&(ht.call(SWFAddress,!1),n.hash=ot(r,f))},fi=function(){if(!ci){if(ci=f,l&&e<8){var r=i.getElementsByTagName("frameset")[0],o="javascript:void((function(){document.open();document.domain='cbc.ca';document.close();})())";u=i.createElement((r?"":"i")+"frame"),r?(r.insertAdjacentElement("beforeEnd",u),r[r.cols?"cols":"rows"]+=",0",u.src=o,u.noResize=!0,u.frameBorder=u.frameSpacing=0):(u.src=o,u.style.display="none",i.body.insertAdjacentElement("afterBegin",u)),it(function(){bt.addListener(u,"load",ki),typeof u.contentWindow[h]==t&&ui()},50)}else d&&(e<418&&(i.body.innerHTML+='<form id="'+h+'" style="position:absolute;top:-9999px;" method="get"><\/form>',kt=i.getElementById(h)),typeof n[h]==t&&(n[h]={}),typeof n[h][n.pathname]!=t&&(tt=n[h][n.pathname].split(",")));it(k.bind(function(){bi.call(this),ri.call(this),wt.call(this)},this),1),l&&e>=8?(i.body.onhashchange=k.bind(ii,this),si(k.bind(pt,this),50)):si(k.bind(ii,this),50)}},h="swfaddress",ct="function",t="undefined",f=!0,c=!1,lt=asual.util,et=lt.Browser,bt=lt.Events,k=lt.Functions,e=et.getVersion(),l=et.isMSIE(),ei=et.isMozilla(),oi=et.isOpera(),d=et.isSafari(),g=c,o=yi(),i=o.document,p=o.history,n=o.location,si=setInterval,it=setTimeout,nt=decodeURI,hi=encodeURI,u,kt,at,dt=i.title,rt=p.length,vt=c,ci=c,gt=f,li=f,ut=this,tt=[],w=[],b=[],a={},r=y(),s={history:f,strict:f},ni,v,ai,ft,vi;if(l&&i.documentMode&&i.documentMode!=e&&(e=i.documentMode!=8?7:8),g=ei&&e>=1||l&&e>=6||oi&&e>=9.5||d&&e>=312,g){for(oi&&(history.navigationMode="compatible"),ft=1;ft<rt;ft++)tt.push("");if(tt.push(y()),l&&n.hash!=y()&&(n.hash="#!"+ot(y(),f)),ti(document),ni=at?at.indexOf("?"):-1,ni!=-1)for(ai=at.substr(ni+1).split("&"),ft=0;vi=ai[ft];ft++)v=vi.split("="),/^(history|strict)$/.test(v[0])&&(s[v[0]]=isNaN(v[1])?/^(true|yes)$/i.test(v[1]):parseInt(v[1])!=0),/^tracker$/.test(v[0])&&(s[v[0]]=v[1]);l&&pt.call(this),window==o&&bt.addListener(document,"DOMContentLoaded",k.bind(fi,this)),bt.addListener(o,"load",k.bind(fi,this))}else!g&&n.href.indexOf("#!")!=-1||d&&e<418&&n.href.indexOf("#!")!=-1&&n.search!=""?(i.open(),i.write('<html><head><meta http-equiv="refresh" content="0;url='+n.href.substr(0,n.href.indexOf("#!"))+'" /><\/head><\/html>'),i.close()):wt();this.toString=function(){return"[class SWFAddress]"},this.back=function(){p.back()},this.forward=function(){p.forward()},this.up=function(){var n=this.getPath();this.setValue(n.substr(0,n.lastIndexOf("/",n.length-2)+(n.substr(n.length-1)=="/"?1:0)))},this.go=function(n){p.go(n)},this.href=function(i,r){r=typeof r!=t?r:"_self",r=="_self"?self.location.href=i:r=="_top"?n.href=i:r=="_blank"?window.open(i):o.frames[r].location.href=i},this.popup=function(url,name,options,handler){try{var popup=window.open(url,name,eval(options));typeof handler!=t&&eval(handler)}catch(ex){}b=arguments},this.getIds=function(){return w},this.getId=function(){return w[0]},this.setId=function(n){w[0]=n},this.addId=function(n){this.removeId(n),w.push(n)},this.removeId=function(n){for(var t=0;t<w.length;t++)if(n==w[t]){w.splice(t,1);break}},this.addEventListener=function(n,i){typeof a[n]==t&&(a[n]=[]),a[n].push(i)},this.removeEventListener=function(n,i){if(typeof a[n]!=t){for(var r=0,u;u=a[n][r];r++)if(u==i)break;a[n].splice(r,1)}},this.dispatchEvent=function(n){if(this.hasEventListener(n.type)){n.target=this;for(var t=0,i;i=a[n.type][t];t++)i(n);return f}return c},this.hasEventListener=function(n){return typeof a[n]!=t&&a[n].length>0},this.getBaseURL=function(){var t=n.href;return t.indexOf("#!")!=-1&&(t=t.substr(0,t.indexOf("#!"))),t.substr(t.length-1)=="/"&&(t=t.substr(0,t.length-1)),t},this.getStrict=function(){return s.strict},this.setStrict=function(n){s.strict=n},this.getHistory=function(){return s.history},this.setHistory=function(n){s.history=n},this.getTracker=function(){return s.tracker},this.setTracker=function(n){s.tracker=n},this.getTitle=function(){return i.title},this.setTitle=function(r){if(!g)return null;typeof r!=t&&(r=="null"&&(r=""),r=nt(r),it(function(){dt=i.title=r,li&&u&&u.contentWindow&&u.contentWindow.document&&(u.contentWindow.document.title=r,li=c),!gt&&ei&&n.replace(n.href.indexOf("#!")!=-1?n.href:n.href+"#!"),gt=c},10))},this.getStatus=function(){return o.status},this.setStatus=function(i){if(!g)return null;if(typeof i!=t&&(i=="null"&&(i=""),i=nt(i),!d)){if(i=yt(i!="null"?i:"",f),i=="/"&&(i=""),!/http(s)?:\/\//.test(i)){var r=n.href.indexOf("#!");i=(r==-1?n.href:n.href.substr(0,r))+"#!"+i}o.status=i}},this.resetStatus=function(){o.status=""},this.getValue=function(){return g?nt(yt(ot(r,c),c)):null},this.setValue=function(u){var o,a;if(!g)return null;typeof u!=t&&(u=="null"&&(u=""),u=hi(nt(yt(u,f))),u=="/"&&(u=""),r!=u)&&(gt=f,r=u,vt=f,ht.call(SWFAddress,!0),tt[p.length]=r,d?s.history?(n[h][n.pathname]=tt.toString(),rt=p.length+1,e<418?n.search==""&&(kt.action="#!"+r,kt.submit()):e<523||r==""?(o=i.createEvent("MouseEvents"),o.initEvent("click",f,f),a=i.createElement("a"),a.href="#!"+r,a.dispatchEvent(o)):n.hash="#!"+r):n.replace("#!"+r):r!=y()&&(s.history?n.hash="#!"+nt(ot(r,f)):n.replace("#!"+nt(r))),l&&e<8&&s.history&&it(ui,50),d?it(function(){vt=c},1):vt=c)},this.getPath=function(){var n=this.getValue();return n.indexOf("?")!=-1?n.split("?")[0]:n.indexOf("#!")!=-1?n.split("#!")[0]:n},this.getPathNames=function(){var n=this.getPath(),t=n.split("/");return(n.substr(0,1)=="/"||n.length==0)&&t.splice(0,1),n.substr(n.length-1,1)=="/"&&t.splice(t.length-1,1),t},this.getQueryString=function(){var n=this.getValue(),t=n.indexOf("?");if(t!=-1&&t<n.length)return n.substr(t+1)},this.getParameter=function(n){var i=this.getValue(),u=i.indexOf("?");if(u!=-1){i=i.substr(u+1);for(var r,f=i.split("&"),e=f.length,t=[];e--;)r=f[e].split("="),r[0]==n&&t.push(r[1]);if(t.length!=0)return t.length!=1?t:t[0]}},this.getParameterNames=function(){var n=this.getValue(),r=n.indexOf("?"),u=[],i,t;if(r!=-1&&(n=n.substr(r+1),n!=""&&n.indexOf("=")!=-1))for(i=n.split("&"),t=0;t<i.length;)u.push(i[t].split("=")[0]),t++;return u},this.onInit=null,this.onChange=null,this.onInternalChange=null,this.onExternalChange=null,function(){var n,i,r,u,f,e,o;typeof FlashObject!=t&&(SWFObject=FlashObject),typeof SWFObject!=t&&SWFObject.prototype&&SWFObject.prototype.write&&(i=SWFObject.prototype.write,SWFObject.prototype.write=function(){n=arguments,this.getAttribute("version").major<8&&(this.addVariable("$swfaddress",SWFAddress.getValue()),(typeof n[0]=="string"?document.getElementById(n[0]):n[0]).so=this);var t;return(t=i.apply(this,n))&&ut.addId(this.getAttribute("id")),t}),typeof swfobject!=t&&(r=swfobject.registerObject,swfobject.registerObject=function(){n=arguments,r.apply(this,n),ut.addId(n[0])},u=swfobject.createSWF,swfobject.createSWF=function(){n=arguments;var t=u.apply(this,n);return t&&ut.addId(n[0].id),t},f=swfobject.embedSWF,swfobject.embedSWF=function(){n=arguments,typeof n[8]==t&&(n[8]={}),typeof n[8].id==t&&(n[8].id=n[1]),f.apply(this,n),ut.addId(n[8].id)}),typeof UFO!=t&&(e=UFO.create,UFO.create=function(){n=arguments,e.apply(this,n),ut.addId(n[0].id)}),typeof AC_FL_RunContent!=t&&(o=AC_FL_RunContent,AC_FL_RunContent=function(){n=arguments,o.apply(this,n);for(var t=0,i=n.length;t<i;t++)n[t]=="id"&&ut.addId(n[t+1])})}()},CBCR3.namespace("CBCR3.Player.Application"),CBCR3.Player.Application.R3PlayerBootStrap=Class.create({serverFrame:null,clientFrame:null,autoStart:!0,permalink:null,isIphone:!1,debug:!0,fromPlayPermalink:!1,masterPlayerInstance:null,streamPlayerLoaded:!1,playlistPlayerLoaded:!1,initialize:function(n){this.autoStart=n.autoStart,Trace.write("R3PlayerBootStrap init()",this.debug),Trace.write(n.cbcmusicpermalink,this.debug),Trace.write(n.fromPlayPermalink,this.debug),this.permalink=n.cbcmusicpermalink,this.fromPlayPermalink=n.fromPlayPermalink},setServerFrame:function(n){this.serverFrame=n},setIsIphone:function(n){this.isIphone=n},setClientFrame:function(n){this.clientFrame=n},loadPlayer:function(){try{if(Trace.write("loadPlayer - playerbootstrap",!0),Trace.write("clientFrame:"+this.clientFrame+" serverFrame:"+this.serverFrame,!0),!this.clientFrame||!this.serverFrame)return;this.serverFrame.getPlayerInstance()==null?this.initializePlayer():this.resumePlayer(),this.clientFrame.document.fire("player:loaded")}catch(n){Trace.error(n)}},getAudioStreamManager:function(){return this.clientFrame?this.clientFrame.getAudioStreamManager():null},initializePlayer:function(){try{Trace.write("playerbootstrap.js -> initializePlayer()",!0),this.serverFrame.initPlayer(),this.masterPlayerInstance=this.serverFrame.getPlayerInstance(),this.masterPlayerInstance.addEventListener("stateInitEvent:streamPlayerLoaded",this.streamPlayerLoadedHandler.bind(this)),this.masterPlayerInstance.addEventListener("stateInitEvent:playlistPlayerLoaded",this.playlistPlayerLoadedHandler.bind(this)),this.clientFrame.loadPlayer(this.masterPlayerInstance),this.isIphone||this.clientFrame.checkEnvironment()}catch(n){Trace.error(n)}},resumePlayer:function(){Trace.write("resumePlayer in playerbootstrap.js",!0),this.serverFrame.initPlayer(),this.clientFrame.loadPlayer(this.serverFrame.getPlayerInstance()),this.clientFrame.resumePlayer()},playPlayer:function(){try{if(Trace.write("playPlayer()",!0),Trace.write(this.permalink,!0),this.streamPlayerLoaded&&this.permalink.include("/stream/")){var n=this.clientFrame.getAudioStreamManager().getStreamByPermalink(this.permalink);if(Trace.write("autoStart: "+this.autoStart+" isPermalinkEntry:"+this.isPermalinkEntry+" permalink has /stream/: "+this.permalink.include("/stream/"),!0),n==null)return;this.fromPlayPermalink?this.clientFrame.getPlayerInstance().stream(n.roomid,this.permalink,n.mount,n.name):this.clientFrame.getPlayerInstance().streamMetadataOnly(n.roomid,this.permalink,n.mount,n.name);return}this.playlistPlayerLoaded&&this.permalink.include("/play/")&&(this.fromPlayPermalink?this.clientFrame.getPlayerInstance().playlist(this.permalink):this.clientFrame.getPlayerInstance().resumePlaylistState())}catch(t){Trace.write("Error: streamPlayerLoadedHandler",!0),Trace.error(t)}},streamPlayerLoadedHandler:function(){this.streamPlayerLoaded=!0,this.playPlayer()},playlistPlayerLoadedHandler:function(){this.playlistPlayerLoaded=!0,this.playPlayer()}}),String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"")},String.prototype.empty=function(){return this.length==0?!0:this.length>0?/^\s*$/.test(this):void 0}