"/*(c) Copyright 2007-2008 Slacker, Inc. 16935 West Bernardo Dr. San Diego, CA 92127 - All rights reserved.*/";haveFlash=false;globalCookie={};plugins={};playbackEngine=null;var wmp;var qt;var real;var isWebUi;var isMiniplayer;var isVerboseClientLogging;haveFlash=false;haveTargetSpot=false;pluginProgressPolling=0;ignorePlaybackPlugins={};playbackEngineCheck=1;serviceUrls={dev:{art:"http://images-0%hash%.slacker.com/e1/",customart:"http://images-0%hash%.dev.sdslacker.com/e1/",register:"https://store.dev.sdslacker.com/register/Register.do?done=<done-url>&fail=<fail-url>&site=slacker&client=webplayer",inlineLanding:"https://store.dev.sdslacker.com/store/InlineLanding.do?site=slacker&client=webplayer",store:"https://store.dev.sdslacker.com/",acctmgmt:"https://store.dev.sdslacker.com/acctmgmt/",metadata:"",shop:"http://www.amazon.com/gp/search?&index=music&keywords=<key>&_encoding=UTF8&tag=slackercom-20",ringtone:"http://api.motime.com/landingapi/?country=us"},stg:{art:"http://images-0%hash%.slacker.com/e1/",customart:"http://images-0%hash%.stg.sdslacker.com/e1/",register:"https://store.stg.sdslacker.com/register/Register.do?done=<done-url>&fail=<fail-url>&site=slacker&client=webplayer",inlineLanding:"https://store.stg.sdslacker.com/store/InlineLanding.do?site=slacker&client=webplayer",store:"https://store.stg.sdslacker.com/",acctmgmt:"https://store.stg.sdslacker.com/acctmgmt/",metadata:"",shop:"http://www.amazon.com/gp/search?&index=music&keywords=<key>&_encoding=UTF8&tag=slackercom-20",ringtone:"http://api.motime.com/landingapi/?country=us"},"stg2":{art:"http://images-0%hash%.slacker.com/e1/",customart:"http://images-0%hash%.stg2.sdslacker.com/e1/",register:"https://store.stg2.sdslacker.com/register/Register.do?done=<done-url>&fail=<fail-url>&site=slacker&client=webplayer",inlineLanding:"https://store.stg2.sdslacker.com/store/InlineLanding.do?site=slacker&client=webplayer",store:"https://store.stg2.sdslacker.com/",acctmgmt:"https://store.stg2.sdslacker.com/acctmgmt/",metadata:"",shop:"http://www.amazon.com/gp/search?&index=music&keywords=<key>&_encoding=UTF8&tag=slackercom-20",ringtone:"http://api.motime.com/landingapi/?country=us"},www:{art:"http://images-0%hash%.slacker.com/e1/",customart:"http://images-0%hash%.slacker.com/e1/",register:"https://store.slacker.com/register/Register.do?done=<done-url>&fail=<fail-url>&site=slacker&client=webplayer",inlineLanding:"https://store.slacker.com/store/InlineLanding.do?site=slacker&client=webplayer",store:"https://store.slacker.com/",acctmgmt:"https://store.slacker.com/acctmgmt/",metadata:"",shop:"http://www.amazon.com/gp/search?&index=music&keywords=<key>&_encoding=UTF8&tag=slackercom-20",ringtone:"http://api.motime.com/landingapi/?country=us"},getUrl:function(type,args){var env=this._getEnv();if(!this[env]){env="www"}var url=this[env][type];if(type=="art"||type=="customart"){if(args==null||isNaN(args)){args=0}args=args.toString();var hash=parseInt(args.substring(args.length-1));url=this[env][type].replace(/\%hash\%/g,hash)}return url},_getEnv:function(){var url=location.toString();var filtered=url.substring((url.indexOf(".")+1));var env=filtered.substring(0,filtered.indexOf("."));return env}};if(navigator.plugins&&navigator.plugins.length>0){var pVer=/(\d+(\.\d+)?(\.\d+)?(\.\d+)?)(\s)?/;var _ver;if(navigator.userAgent.indexOf("AppleWebKit")>-1||navigator.appName.indexOf("Safari")>-1){for(var i=0;i<navigator.plugins.length;i++){_ver=pVer.exec(navigator.plugins[i].description);this.plugins[navigator.plugins[i].name]={description:navigator.plugins[i].description,version:(_ver&&_ver.length>0)?_ver[1]:0}}}else{for(var i in navigator.plugins){_ver=pVer.exec(navigator.plugins[i].description);this.plugins[navigator.plugins[i].name]={description:navigator.plugins[i].description,version:(_ver&&_ver.length>0)?_ver[1]:0}}}}else{try{var _flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.9");if(_flash){this.plugins["Shockwave Flash"]={description:"Shockwave Flash 9.0 or higher for Internet Explorer",version:"9.0"}}}catch(e){}}function FlashPlayer_Event(obj){if(obj){switch(obj.event){case"log":com.debug.console.log(obj.level,"FlashPlayer_Event: "+obj.msg);if(obj.msg.indexOf("ident response: ")>-1){var idx=obj.msg.indexOf("ident response: ")+16;playbackEngine.commands.identip=obj.msg.substring(idx)}break;case"loaded":com.debug.console.log("warn","Flash is loaded and ready");haveFlash=true;if(!playbackEngine.commands||!playbackEngine.commands.getVersion()){com.debug.console.log("warn","Flash is here, but no playback engine yet...try again.");detectPlaybackEngine()}detectFirstLaunch(true);break;case"error":switch(obj.type){case"TrackLoadTimeout":RockitDevice.events.notify("OnDeviceError",[false,"Flash: The requested url yielded no data after 20 sec: "+obj.url]);playbackBeacon("playbackError","No data after 20 seconds",obj,false);var ctType=RockitDevice.player.metadata.get("type");if(ctType=="clip"){playbackEngine.commands.reset();player.events.notify("OnPlayerTrackEnd",["clipError"]);RockitDevice.events.notify("OnDeviceMsg",["The requested clip may no longer be available.",null,true])}else{RockitDevice.control.fire("stop",[false,"Error"]);if(ctType!="library"){RockitDevice.control.fire("play")}}break;case"StreamingBlocked":RockitDevice.events.notify("OnDeviceError",[false,"Required protocol cannot be opened to stream: "+obj.url]);createMiniNotification("Flash server error. Skipping...",null,5000);playbackBeacon("playbackError","rmtp blocked or not available",obj,true);RockitDevice.control.fire("stop",[true,"Error"]);RockitDevice.control.fire("skip",[null,null,"rtmperror"]);break;default:if(obj.level=="fatal"){RockitDevice.events.notify("OnDeviceError",[false,obj.type+": "+obj.url]);playbackBeacon("playbackError","rmtp error: "+obj.type,obj,true);if(obj.url.substr(0,4)=="rtmp"){com.debug.console.log("debug","flash default error stopping");var retry=(RockitDevice.player.states.isPlaying&&!RockitDevice.player.states.isPaused);RockitDevice.control.fire("stop",[true,"Error"]);if(retry){com.debug.console.log("debug","flash default error skipping");createMiniNotification("Flash RTMP server error. Skipping...",null,5000);try{if(RockitDevice.player.recover&&typeof RockitDevice.player.recover=="function"){RockitDevice.player.recover("rtmp server")}else{com.debug.console.log("error","Strange pointer in flash error handling.")}}catch(e){com.debug.console.log("error","Error caught in flash error handling.")}}com.debug.console.log("debug","flash default error complete")}else{var retry=(RockitDevice.player.states.isPlaying&&!RockitDevice.player.states.isPaused);RockitDevice.control.fire("stop",[true,"Error"]);if(retry){createMiniNotification("Flash server error. Skipping...",null,5000);RockitDevice.control.fire("skip",[null,null,"rtmperror"])}}}break}break;case"OnTrackEnd":com.debug.console.log("debug","Flash OnTrackEnd");player.events.notify("OnPlayerTrackEnd");break;case"ad_mutePlayer":ad_mutePlayer();break;case"ad_unmutePlayer":ad_unmutePlayer();break;case"ad_clickedAd":ad_clickedAd();break;case"info":var msg=null;switch(obj.type){case"GettingRtmpConnection":msg="Getting RTMP Connection...";break;case"FindNetConnection":msg="Find Net Connection...";break;case"RtmpConnectionTimeout":msg="RTMP Connection Timeout...";break;case"NetStream.Buffer.Full":case"NetStream.Play.Start":case"NetStream.Play.Stop":case"NetStream.Buffer.Empty":case"NetConnection.Connect.Success":case"NetConnection.Connect.Failed":default:break}if(msg){}break;case"warn":RockitDevice.events.notify("OnDeviceError",[false,obj.type+" : "+obj.url]);com.rockit.kernel.beacon("IdentFailure",{desc:obj.type,tid:RockitDevice.player.metadata.get("trackId"),fid:RockitDevice.player.metadata.get("fileId"),sid:RockitDevice.player.metadata.get("stationId"),url:obj.url});break}}else{com.debug.console.log("warn","Unknown flash event: "+obj.event)}}function playbackBeacon(name,desc,obj,appendRTMP){var beaconParams={desc:desc,tid:RockitDevice.player.metadata.get("trackId"),fid:RockitDevice.player.metadata.get("fileId"),sid:RockitDevice.player.metadata.get("stationId"),url:obj.url};if(appendRTMP){beaconParams["blessedRtmp"]=obj.blessedRtmp;beaconParams["hasStreamed"]=obj.hasStreamed}var protocol=obj.url.substring(0,4);if(protocol=="rtmp"){beaconParams["identip"]=playbackEngine.commands.identip}com.rockit.kernel.beacon(name,beaconParams)}function getPluginObject(id){var f;if(navigator.appName.indexOf("Microsoft")!=-1){f=window[id];if(f[0]){f=f[0]}}else{if(navigator.appName.indexOf("Opera")!=-1){f=document.getElementById(id)}else{f=document[id]}}return f}function replaceFlashObject(){return ;var parent=$("flash_mp3").parentElement;var newFlash=$("flash_mp3").cloneNode(true);parent.removeChild($("flash_mp3"));parent.appendChild(newFlash);playbackEngine=new com.rockit.webplayer.playbackEngine.engine("flash",getPluginObject("flash_mp3"))}var adModuleView="";var adModuleIsTakeover=false;var adModuleTakeoverIsUp=false;var adModuleResumeWhenDone=true;var adModuleAdLength=0;var AdModuleState={None:0,Embedded:1,Startup:2,Idle:3,Queueing:4,Playing:5};var adModuleState=AdModuleState.None;var adModuleFailToStart_tm=null;var adModuleFailToEnd_tm=null;var adModulePrefetchedAd=null;var AdTest={None:0,TestID:1,TestMode:2,TestAll:3};var adModuleDemo1;var adModuleDemo2;var adModuleUnloadOnEnd=false;var adModuleLeaveupRemaining=-1;var adModuleLeaveupIgnoreNext=false;var ADMODULE_LEAVEUP=14;var adModuleUseOldTSSetup=false;var targetSpotVolumeFactor=0.7;function ad_startup(afterloaded){if(adModuleState==AdModuleState.None){if(adModuleUseOldTSSetup){try{if(afterloaded){if(!window.ActiveXObject){adModuleState=AdModuleState.Embedded;com.debug.console.log("info","AdModule (TargetSpot): page load will embed object");setTimeout(function(){try{com.debug.console.log("info","AdModule (TargetSpot): page load embedding object now");var tsContainer=document.createElement("div");tsContainer.setAttribute("id","tscontainer");document.getElementsByTagName("body")[0].appendChild(tsContainer);ts_embedControl(true)}catch(e){}},10000)}}else{if(window.ActiveXObject){adModuleState=AdModuleState.Embedded;ts_embedControl(false)}}}catch(e){}}else{if(afterloaded){var testMode=false;if(Q_STRING.get("adtest")){testMode=true}setTimeout(function(){com.debug.console.log("debug","calling initializeAds (testMode="+testMode+") after startup timeout");getPluginObject("flash_mp3").initializeAds(testMode);ad_ready()},8*1000);adModuleState=AdModuleState.Embedded}}}else{}}function ad_ready(){if(adModuleState==AdModuleState.Embedded){com.debug.console.log("info","AdModule:  ad_ready called");adModuleState=AdModuleState.Startup;var adReadyCheck;adReadyCheck=setInterval(function(){if(adModuleState==AdModuleState.Startup&&RockitDevice){com.debug.console.log("info","AdModule: RockitDevice present, handling startup");adModuleState=AdModuleState.Idle;if(adModuleUseOldTSSetup){haveTargetSpot=true}try{ad_moveAway();ad_setDemo();RockitDevice.attachEvent("OnDeviceViewChange",function(evt,newView,oldView,bNoAddToHistory){adModuleView=newView;if(adModuleState==AdModuleState.Playing||ad_isTakeoverAdVisible()){com.debug.console.log("debug","AdModule:  View changed, moving control");ad_moveToCorrectView(newView)}else{ad_moveTo(-1000,35,1,1)}ad_updateDismissButton()});RockitDevice.attachEvent("OnChangeStation",function(evt,id,bFinishCurrentTrack,callback){ad_unloadAd();if(adModuleState==AdModuleState.Playing){com.debug.console.log("warn","AdModule:  Station changed during ad, interrupting ad playback");adModuleResumeWhenDone=false;ad_killAd(false)}else{if(adModuleState==AdModuleState.Queueing){adModuleState=AdModuleState.Idle}}});RockitDevice.player.attachEvent("OnPlay",function(evt,t,bLoadOnly,skipReason){var type=RockitDevice.player.getMetadata("type");if(adModuleLeaveupIgnoreNext){adModuleLeaveupIgnoreNext=false}else{if(adModuleLeaveupRemaining>=0){if(type=="imaging"){adModuleLeaveupRemaining++}else{if(type!="radio"){adModuleLeaveupRemaining=0}}if(adModuleLeaveupRemaining==0){com.debug.console.log("info","AdModule: ad takeover unloaded on track change");ad_unloadAd()}adModuleLeaveupRemaining--}}});if(RockitDevice.uiMode=="nowPlaying"){adModuleView=RockitDevice.nowPlayingView}else{adModuleView=RockitDevice.uiMode}}catch(e){}finally{clearInterval(adReadyCheck);adReadyCheck=null}}},1000)}else{com.debug.console.log("error","AdModule: Unnecessary ad_ready call skipped")}}function ad_pauseAd(pause){}function ad_mutePlayer(){if(adModuleState==AdModuleState.Queueing){com.debug.console.log("info","AdModule:  Ad is beginning to play (ad_mutePlayer)");clearTimeout(adModuleFailToStart_tm);adModuleFailToStart_tm=null;if(adModuleUseOldTSSetup){ts_matchPlayerVolume()}else{playbackEngine.commands.setVolume(globalCookie.vol)}if(adModuleIsTakeover){adModuleTakeoverIsUp=true;if(RockitDevice.ui.currentView!="player_ad_takeover_indirect"){com.rockit.webplayer.pageUtils.showPageTakeover("/webplayer/client/web/nags/takeover_300x250_with_upsell.vm",null,"indirect_ad",null,null,"player_ad_takeover_indirect")}com.rockit.webplayer.core.toggleStationTreeVisible(false);ad_moveToCorrectView(adModuleView)}else{ad_moveToCorrectView(adModuleView)}RockitDevice.player.playbackMonitor.stop();adModuleState=AdModuleState.Playing;var timeoutLength=(parseInt(adModuleAdLength)+10)*1000;if(adModuleFailToEnd_tm){clearTimeout(adModuleFailToEnd_tm)}adModuleFailToEnd_tm=setTimeout(function(){if(adModuleState==AdModuleState.Playing){com.debug.console.log("error","AdModule: Ad did not end in "+timeoutLength+" ms, resuming the player.");adModuleResumeWhenDone=false;ad_killAd();ad_notifyPlayerToResume();ad_moveAway()}},timeoutLength)}else{com.debug.console.log("error","AdModule: unexpected call to ad_mutePlayer - ignoring.");ad_killAd()}}function ad_unmutePlayer(){com.debug.console.log("info","AdModule: Ad has finished playing (ad_unmutePlayer)");clearTimeout(adModuleFailToEnd_tm);adModuleFailToEnd_tm=null;if(adModuleResumeWhenDone){ad_notifyPlayerToResume()}adModuleResumeWhenDone=true;adModuleState=AdModuleState.Idle;if(!adModuleIsTakeover){setTimeout(function(){if(adModuleState==AdModuleState.Idle){ad_unloadAd()}},500)}ad_updateDismissButton();if(adModuleUnloadOnEnd){com.debug.console.log("info","AdModule: Ad marked to unload on finish");ad_unloadAd()}adModuleUnloadOnEnd=false}function ad_clickedAd(){com.debug.console.log("info","AdModule: Ad was clicked (ad_clickedAd) ("+adModuleState+")");if(adModuleState==AdModuleState.Playing){adModuleUnloadOnEnd=true}else{if(adModuleState==AdModuleState.Idle){ad_unloadAd()}}}function ad_updateDismissButton(){if(ad_isTakeoverAdVisible()){if(adModuleState==AdModuleState.Playing||adModuleState==AdModuleState.Queueing){$("takeover_ad_dismiss").style.display="none"}else{$("takeover_ad_dismiss").style.display="block"}}}function ad_unloadAd(){ad_moveAway();if(adModuleUseOldTSSetup){}else{getPluginObject("flash_mp3").unloadAd(0)}}function ad_attemptPlayAd(provider,adtime,adtakeover){if(adModuleState==AdModuleState.Idle){com.debug.console.log("debug","AdModule: Attempt to play an ad");if(adtime==null){adtime=30}if(provider==null){provider="targetspot"}if(adtakeover==null){adTakeover=false}adModuleAdLength=adtime;if(!adModuleUseOldTSSetup){adModuleIsTakeover=adtakeover}ad_moveToCorrectView(adModuleView);com.debug.console.log("info","AdModule: Starting ad from "+provider+" for "+adModuleAdLength+" second gap");try{adModuleState=AdModuleState.Queueing;adModuleResumeWhenDone=true;if(adModuleUseOldTSSetup){ts_streamEvent("playAd",adtime)}else{ad_unloadAd();ad_setDemo();adModuleLeaveupRemaining=ADMODULE_LEAVEUP;adModuleLeaveupIgnoreNext=true;var adId=0;if(adModulePrefetchedAd){adId=adModulePrefetchedAd["id"];adModulePrefetchedAd=null}getPluginObject("flash_mp3").playAd(adId,provider,adtime)}var timeoutLength=20*1000;if(adModuleFailToStart_tm){clearTimeout(adModuleFailToStart_tm)}adModuleFailToStart_tm=setTimeout(function(){if(adModuleState==AdModuleState.Queueing){com.debug.console.log("error","AdModule: ad did not start in "+timeoutLength+" ms, resuming the player.");adModuleState=AdModuleState.Idle;ad_killAd();setTimeout(function(){ad_notifyPlayerToResume()},1000)}},timeoutLength)}catch(e){com.debug.console.log("error","AdModule: Something failed starting the ad ["+((e.message)?e.message:e)+"], resuming the player");adModuleState=AdModuleState.Idle;ad_notifyPlayerToResume()}}else{com.debug.console.log("error","AdModule: not ready or idle - resuming the player");ad_notifyPlayerToResume()}}function ad_attemptPrefetchAd(provider,adtime,adtakeover){com.debug.console.log("debug","AdModule attempt prefetch ad");if(adModulePrefetchedAd){ad_killAd(adModulePrefetchedAd["id"]);adModulePrefetchedAd=null}if(adModuleState>=AdModuleState.Idle){if(adtime==null){adtime=30}if(provider==null){provider="targetspot"}if(adtakeover==null){adtakeover=false}com.debug.console.log("info","AdModule: Prefetching ad from "+provider+" for "+adtime+" second gap");try{if(!adModuleUseOldTSSetup){ad_setDemo();var adId=getPluginObject("flash_mp3").prefetchAd(provider,adtime);if(adId!=0){adModulePrefetchedAd=new Object;adModulePrefetchedAd["id"]=adId}}}catch(e){com.debug.console.log("error","AdModule: Something failed prefetching the ad ["+((e.message)?e.message:e)+"]")}}}function ad_setDemo(){var obj=getPluginObject("flash_mp3");if(RockitDevice&&obj){var newDemo1=RockitDevice.userFlags.demo1;if(newDemo1&&newDemo1!=adModuleDemo1){obj.setDemo("demo1",newDemo1);adModuleDemo1=newDemo1}var newDemo2=RockitDevice.userFlags.demo2;if(newDemo2&&newDemo2!=adModuleDemo2){obj.setDemo("demo2",newDemo2);adModuleDemo2=newDemo2}}}function ad_isTakeoverAdVisible(){var ctrl=$("player_ad_takeover_indirect");return(ctrl&&ctrl.style.display=="block")}function ad_moveTo(left,top,width,height){if(adModuleState!=AdModuleState.None){try{var ctrl1;var ctrl2;if(adModuleUseOldTSSetup){ctrl1=document.getElementById("av_ad");ctrl2=$swf("av_ad")}else{ctrl1=document.getElementById("flash_mp3");ctrl2=getPluginObject("flash_mp3")}ctrl1.style.left=-900;ctrl1.style.top=top;ctrl1.style.width=width;ctrl1.style.height=height;ctrl2.style.width=width;ctrl2.style.height=height;ctrl1.width=width;ctrl1.height=height;ctrl2.width=width;ctrl2.height=height;ctrl1.style.left=left}catch(e){}}}function ad_moveAway(){if(adModuleTakeoverIsUp){$("takeover_richMediaContainer").setAttribute("active","false");com.rockit.webplayer.pageUtils.dismissTakeover();RockitDevice.handleDeviceNavHistory(-1);adModuleTakeoverIsUp=false}ad_moveTo(-1000,35,1,1)}function ad_moveOverElement(img){var pos=com.system.utils.GetAbsoluteXY(img);var width=img.style.width;var height=img.style.height;if(!width){width=img.width}if(!height){height=img.height}ad_moveTo(pos[0],pos[1],width,height)}function ad_moveToCorrectView(view){if(adModuleIsTakeover){var div=$("takeover_richMediaContainer");if(div&&ad_isTakeoverAdVisible()){ad_moveOverElement(div)}else{ad_moveTo(-1000,35,1,1)}}else{switch(view){case"player_nowPlaying_bigArt":var art=$("nowPlayingBigArt");var mv=art;for(var i=0;i<art.childNodes.length;i++){if(art.childNodes.item(i).nodeType==1){mv=art.childNodes.item(i);break}}ad_moveOverElement(mv);break;case"player_nowPlaying_main":ad_moveOverElement($("nowPlayingAlbumImage_main_container"));break;case"player_nowPlaying_playlist":ad_moveOverElement($("playerSmallImage"));break;case"player_nowPlaying_artist":ad_moveOverElement($("playerSmallImage"));break;case"player_nowPlaying_album":ad_moveOverElement($("playerSmallImage"));break;case"player_nowPlaying_lyrics":ad_moveOverElement($("nowPlayingAlbumImage_lyrics"));break;default:ad_moveOverElement($("playerSmallImage"));break}}}function ad_notifyPlayerToResume(){player.events.notify("OnPlayerTrackEnd")}function ad_killAd(adId){if(adModuleUseOldTSSetup){ts_streamEvent("interruptAd")}else{if(!adId){adId=0}getPluginObject("flash_mp3").killAd(adId)}}function ts_matchPlayerVolume(){if(adModuleUseOldTSSetup){var playerVolume=playbackEngine.commands.getVolume();var tsVolume=playerVolume*targetSpotVolumeFactor;ts_setVolume(tsVolume);com.debug.console.log("debug","TargetSpot:  Volume matched player("+playerVolume+") with TargetSpot("+tsVolume+")")}}function ts_tickleControlOnce(){if(adModuleUseOldTSSetup){if(adModuleState==AdModuleState.Embedded){var ctrl=getPluginObject("av_ad");com.debug.console.log("warn","TargetSpot: control is not active - trying to activate now");if(ctrl){ctrl.style.display="none";setTimeout(function(){ctrl.style.display="block"},200)}return false}}return true}function ts_tickleControlRepeated(timeout){if(adModuleUseOldTSSetup){if(!ts_tickleControlOnce()){var tickleInterval=0;if(timeout&&timeout>0){var tickleStop=setTimeout(function(){if(tickleInterval!=0){clearInterval(tickleInterval);tickleInterval=0;com.debug.console.log("error","TargetSpot: control is not active - stopping retry after "+timeout+" milliseconds")}},timeout)}var tickleInterval=setInterval(function(){if(ts_tickleControlOnce()){if(tickleInterval!=0){clearInterval(tickleInterval);tickleInterval=0}}},15000)}}}function ts_embedSLK(ty,width,height,stationId,zipCode,gender,age,income,prl){document.getElementById("tscontainer").innerHTML+=ts_embed_data(ty,width,height,stationId,zipCode,gender,age,income,prl)}function ts_embedControl(breplace){try{if(!breplace){ts_embed("av",400,400,"SLACKERIN",0,0,0,0,"ignore")}else{ts_embedSLK("av",400,400,"SLACKERIN",0,0,0,0,"ignore")}var ctrl1=document.getElementById("av_ad");var ctrl2=$swf("av_ad");ctrl1.style.position="absolute";ctrl1.style.display="block";ctrl1.style.zIndex=10;ctrl1.setAttribute("bgcolor","#000080");ctrl2.setAttribute("bgcolor","#000080");ad_moveTo(450,35,1,1);setTimeout(function(){ts_tickleControlRepeated(300000)},15000)}catch(e){com.debug.console.log("error","TargetSpot: failed to embed object")}}function ts_ready(){com.debug.console.log("warn","TargetSpot: ready received!");ad_ready()}function ts_mutePlayer(){ad_mutePlayer()}function ts_unmutePlayer(){ad_unmutePlayer()}function ad_loadVideoAd(){com.debug.console.log("error","videoAd - ad_loadVideoAd - should not be called");slacker_initFlashObject("AdNetworks.swf","video_ad_space","AdNetworks",560,386,{wmode:"transparent"});var yume_player_div_id="flvplayerdiv";var yume_cb_medrect_id="cb_medrect1_div";var yume_force_cb_medrect_id="float_cb_medrect1_div";var yume_force_cb="default";var player_id="flash_flv_player";var yume_div_opacity=70;var yume_dimout_div_zIndex=9999}function yumeAdPlayer(){com.debug.console.log("error","videoAd - yumeAdPlayer - should not be called");var yumeCbAdObject1=new yumeStaticCbAd();yumeCbAdObject1.setPlayerMediumRectangleCompanionBannerDivSource("cb_medrect1_div");yumeCbAdObject1.setPlayerAdDomainUrl("AD SERVER URL");yumeCbAdObject1.setPlayerIframeBannerPlaylist("dynamic_banner_iframe.html?domain=YOUR DOMAIN")}var AdNetworks=null;var _videoAdCallback=null;var MAX_VIDEO_AD_LOCKOUT_TIME=30*60;var _videoAdLockoutTime=MAX_VIDEO_AD_LOCKOUT_TIME;var _videoAdLastEndTime=0;var _videoAdLastStartedStationId=null;function ad_setVideoAdLockoutTime(seconds){if(seconds<MAX_VIDEO_AD_LOCKOUT_TIME){_videoAdLockoutTime=seconds;com.debug.console.log("info","Video lockout set: "+_videoAdLockoutTime)}else{com.debug.console.log("error","Video lockout invalid.  Not set.")}}function ad_setVideoAdConfiguration(){var tp=new Object();tp.imu="";tp.pubchannel="";tp.iabcat="ArtsAndEntertainment";tp.iabsubcat="Music";tp.country_code=RockitDevice.userFlags.territory;if(typeof (tp.country_code)!="string"){tp.country_code=RockitDevice.userFlags.ipcountry}if(typeof (tp.country_code)!="string"){tp.country_code=""}tp.city="";tp.postal_code=RockitDevice.userFlags.ipzip;if(typeof (tp.postal_code)!="string"){tp.postal_code=""}tp.gender=(RockitDevice.userFlags.demo1=="B")?"female":"male";switch(RockitDevice.userFlags.demo2){case"B":tp.age="13_17";break;case"C":tp.age="18_20";break;case"D":tp.age="21-24";break;case"E":tp.age="25_34";break;case"F":tp.age="35_44";break;case"G":tp.age="45_54";break;case"H":tp.age="55_99";break}tp.tags="";tp.title="";tp.duration="";tp.station="";tp.customstation="";var config=new Object();config.isTestVersion=false;config.yumeHTTPDomain="http://plg4.yumenetworks.com/";config.yumePublisherDomain="655IJlIKZOY";config.url=mapperBase+"/flash/ads/yume_ad_library.swf";config.targetingParameters=tp;AdNetworks.run("setConfiguration",config)}function ad_shouldShowVideoAd(deviceSkipEvent){if(deviceSkipEvent!="ChangeStation"){com.debug.console.log("debug","No video ads for event: "+deviceSkipEvent);return false}if(RockitDevice.player.metadata.get("stationId")==_videoAdLastStartedStationId){com.debug.console.log("debug","Station ID did not change: "+_videoAdLastStartedStationId);return false}if(isFacebookLaunch()){com.debug.console.log("debug","No video ads for facebook launch");return false}if(RockitDevice.isStationSports(RockitDevice.player.metadata.get("stationId"))){com.debug.console.log("debug","No video ads for sports");return false}if(RockitDevice.userFlags.level>=RockitDevice.serviceLevels.PLUS||RockitDevice.userFlags.level<RockitDevice.serviceLevels.BASIC){com.debug.console.log("debug","No video ads for user level: "+RockitDevice.userFlags.level);return false}var curTime=(new Date()).getTime()/1000;var timeSinceLastAd=(curTime-_videoAdLastEndTime);if(timeSinceLastAd<_videoAdLockoutTime){com.debug.console.log("debug","No video ads: "+(_videoAdLockoutTime-timeSinceLastAd)+" more seconds");return false}com.debug.console.log("warn","videoAd - ad_shouldShowVideoAd - should show a video ad");return true}function ad_continueAfterVideoAd(played){com.debug.console.log("warn","videoAd - ad_continueAfterVideoAd(played) - played("+played+")");_videoAdLastStartedStationId=RockitDevice.player.metadata.get("stationId");if(played){_videoAdLastEndTime=(new Date()).getTime()/1000}if(typeof (_videoAdCallback)=="function"){_videoAdCallback()}_videoAdCallback=null;com.debug.console.log("warn","videoAd - ad_continueAfterVideoAd - complete")}function ad_rememberVideoAdCallback(callback){_videoAdCallback=callback}function ad_showVideoAd(deviceSkipEvent,callback){com.debug.console.log("warn","videoAd - ad_showVideoAd(deviceSkipEvent) - deviceSkipEvent("+deviceSkipEvent+")");ad_rememberVideoAdCallback(callback);if(AdNetworks==null){com.debug.console.log("error","Failed to play video ad: AdNetworks is null");ad_continueAfterVideoAd(false);return }if(typeof (AdNetworks.run)!="function"){com.debug.console.log("error","Failed to play video ad: object not ready - ["+AdNetworks+"] typeof(run)("+typeof (AdNetworks.run)+")");ad_continueAfterVideoAd(false);return }if(!ad_shouldShowVideoAd(deviceSkipEvent)){ad_continueAfterVideoAd(false);return }try{com.debug.console.log("warn","videoAd - ad_showVideoAd - setConfiguration now");ad_setVideoAdConfiguration()}catch(e){com.debug.console.log("error","Failed to set video ad configuration: "+e)}try{com.debug.console.log("warn","videoAd - ad_showVideoAd - setVolume now");var vol=playbackEngine.commands.getVolume()/100;AdNetworks.run("setVolume",vol);com.debug.console.log("warn","videoAd - ad_showVideoAd - volume set to "+vol);com.debug.console.log("warn","videoAd - ad_showVideoAd - playAd now");AdNetworks.run("playAd");com.debug.console.log("warn","videoAd - ad_showVideoAd - playAd complete")}catch(e){com.debug.console.log("error","Failed to play video ad: "+e);ad_continueAfterVideoAd(false)}com.debug.console.log("warn","videoAd - ad_showVideoAd - complete")}function ad_initializeVideoAdFlash(){com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash");slacker_initFlashObject(mapperBase+"/flash/ads/AdNetworks.swf","video_ad_space","AdNetworks",560,386,{wmode:"transparent"});com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash - flash object initialized - AdNetworks"+AdNetworks+")");if(AdNetworks==null){com.debug.console.log("error","videoAd - ad_initializeVideoAdFlash - AdNetworks is null");return }AdNetworks.style.position="absolute";AdNetworks.style.zIndex="6000";setTimeout(function(){com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash - defered handling move");AdNetworks.style.top="0px";AdNetworks.style.left="-10000px";AdNetworks.style.width="10px";AdNetworks.style.height="10px";com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash - defered handling move complete")},1000);com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash - attach to logout");RockitDevice.attachEvent("OnServiceLogout",function(evt){_videoAdLastEndTime=0;_videoAdLastStartedStationId=null});com.debug.console.log("warn","videoAd - ad_initializeVideoAdFlash - complete")}function writeRegSetting(k,v){try{getPluginObject("flash_mp3").setRegValue(k,v)}catch(e){}}function readRegSetting(v){try{return getPluginObject("flash_mp3").getRegValue(v)}catch(e){return null}}function detectPlaybackEngine(){ignorePlaybackPlugins.wmp=true;ignorePlaybackPlugins.qt=true;while(1){if(!ignorePlaybackPlugins.wmp||(playbackEngine&&playbackEngine.type=="wmp")){com.debug.console.log("warn","Searching for WMP");try{if(document.getElementById("wmpControl")&&document.getElementById("wmpControl").versionInfo){loadPlaybackEngine("wmp");if(playbackEngine.commands.getVersion()){playbackEngineCheck=1;break}else{playbackEngine=null}}}catch(e){}ignorePlaybackPlugins.wmp=true;com.debug.console.log("warn","WMP not found or not useable")}if(navigator.userAgent.indexOf("Safari")==-1&&navigator.userAgent.indexOf("iPhone")==-1){ignorePlaybackPlugins.qt=true}if(!ignorePlaybackPlugins.qt||(playbackEngine&&playbackEngine.type=="qt")){com.debug.console.log("warn","Searching for Quicktime");try{if(document.getElementById("qtControl").GetQuickTimeVersion()){loadPlaybackEngine("qt");try{if(playbackEngine.commands.getVersion()){playbackEngineCheck=1;break}else{playbackEngine=null}}catch(e){playbackEngine=null}}}catch(e){}ignorePlaybackPlugins.qt=true;com.debug.console.log("warn","Quicktime not found or not useable")}else{if(playbackEngine&&playbackEngine.type=="qt"){playbackEngineCheck=1}}playbackEngine=new com.rockit.webplayer.playbackEngine.engine("flash",getPluginObject("flash_mp3"));if(playbackEngine.commands.getVersion()){com.debug.console.log("warn","Flash player found! - version: "+playbackEngine.commands.getVersion());try{playbackEngine.commands.setVolume(100);setTimeout(function(){playbackEngine.commands.setVolume(globalCookie.vol)},1000);slk.volSlider.set(globalCookie.vol)}catch(e){}break}setTimeout(detectPlaybackEngine,1000);return false;break}}function detectFlash(){var error=false;var flashVersion;try{flashVersion=haveFlash||getPluginObject("flash_mp3").getVersionInfo()}catch(e){error=true}if(error&&playbackEngineCheck<10){com.debug.console.log("warn","FlashPlayer still not loaded...attempt "+playbackEngineCheck);playbackEngineCheck++;return false}else{if(error){try{flashVersion=getPluginObject("flash_mp3").getVersionInfo()}catch(e){}if(!flashVersion){require("com.debug.console");require("com.rockit.webplayer.client.web");muteUi(false);var d=createModalDialog("deviceError");d.createModalDialogContent("Web Player cannot finish loading.  Flash could not be found or there is a problem with the plugin.","deviceError");modalDialogOpen(d,true);return false}}}return flashVersion}function loadPlaybackEngine(code,bAlert){switch(code){case"wmp":if(document.getElementById("wmpControl").versionInfo){var version=document.getElementById("wmpControl").versionInfo.split(".");if(version[0]>=10){playbackEngine=new com.rockit.webplayer.playbackEngine.engine(code,document.getElementById("wmpControl"));try{playbackEngine.commands.setVolume(50);slk.volSlider.set(globalCookie.vol)}catch(e){}com.debug.console.log("warn","WMP found! - version: "+playbackEngine.commands.getVersion());if(bAlert){alert("Playback engine changed to WMP: "+playbackEngine.commands.getVersion())}}else{com.debug.console.log("warn","WMP version too old to use: "+version);if(bAlert){alert("WMP version too old to use: "+version)}}}else{if(bAlert){alert("WMP cannot be used as a playback engine")}}break;case"qt":if(document.getElementById("qtControl").GetQuickTimeVersion()){var version=document.getElementById("qtControl").GetQuickTimeVersion().split(".");if(version[0]>=7&&version[1]>0){playbackEngine=new com.rockit.webplayer.playbackEngine.engine(code,document.getElementById("qtControl"));if(playbackEngine.commands.getVersion()){try{playbackEngine.commands.setVolume(50);slk.volSlider.set(globalCookie.vol)}catch(e){}com.debug.console.log("warn","Quicktime found! - version: "+playbackEngine.commands.getVersion());if(bAlert){alert("Playback engine changed to Quicktime: "+playbackEngine.commands.getVersion())}}else{if(bAlert){alert("Quicktime cannot be used as a playback engine")}}}else{com.debug.console.log("warn","Quicktime version too old to use: "+version);if(bAlert){alert("Quicktime version too old to use: "+version)}}}else{if(bAlert){alert("Quicktime cannot be used as a playback engine")}}break;case"flash":if(detectFlash()){playbackEngine=new com.rockit.webplayer.playbackEngine.engine(code,getPluginObject("flash_mp3"));if(playbackEngine.commands.getVersion()){try{playbackEngine.commands.setVolume(50);slk.volSlider.set(globalCookie.vol)}catch(e){}com.debug.console.log("warn","Flash found! - version: "+playbackEngine.commands.getVersion());if(bAlert){alert("Playback engine changed to Flash: "+playbackEngine.commands.getVersion())}}else{if(bAlert){alert("Flash cannot be used as a playback engine")}}}else{if(bAlert){alert("Flash cannot be used as a playback engine")}}break;default:alert(code+" is not a valid playback plugin choice")}}function detectFirstLaunch(bJBCheckOnly){require("com.system.cookie");var timeLeft=0;var flashCache=readRegSetting("RWP");globalCookie=com.system.cookie.GetCompoundCookie("RWP","|");if(!bJBCheckOnly){if(!globalCookie.v){if(flashCache){globalCookie=flashCache}else{globalCookie.fl=(new Date()).getTime();globalCookie.exp=(30*24*60)}}if(!globalCookie.lc){globalCookie.lc=1}else{globalCookie.lc++}if(!globalCookie.fl){globalCookie.fl=(new Date()).getTime()}if(!globalCookie.vol){globalCookie.vol=50}else{}timeLeft=24-(((new Date()).getTime()-globalCookie.fl)/1000/3600);var hrs=parseInt(timeLeft);var min=60*parseFloat("."+timeLeft.toString().substr(timeLeft.toString().indexOf(".")+1,2));com.debug.console.log("warn","First 24hrs check: "+hrs+"hrs "+min+"min")}if(flashCache){globalCookie.jb=(flashCache.jb)?1:0}else{globalCookie.jb=0}com.system.cookie.SetCompoundCookie("RWP",globalCookie,"|",globalCookie.exp,"/",null,null,true);writeRegSetting("RWP",globalCookie);timeLeft=null}function getStylesheet(name){var styles=document.getElementsByTagName("link");var style;for(var i=0;i<styles.length;i++){style=styles[i];if(style.rel.indexOf("stylesheet")>-1&&style.id==name){return style}}return false}function appendPageStyle(file,id,bIsAlternate){var style=document.createElement("link");style.id=id;style.key=file;style.rel="stylesheet";style.disabled=(bIsAlternate==true);style.type="text/css";style.href=mapperBase+file;document.getElementsByTagName("head")[0].appendChild(style)};
