if(document.images){var skinImg=new Array('skin_livestream2','skin_podcenter','skin_more','skin_webcams','skin_live_baseball','skin_live_basket','skin_live_football','skin_live_golf','skin_live_hockey','skin_live_soccer');document.image_chargee=new Array();for(i=0;i<skinImg.length;i++){document.image_chargee[i]=new Image();document.image_chargee[i].src=skinImagePath+skinImg[i]+'.jpg'}}$(function(){$('#stations').change(swapStation)});$(function(){$('#states').change(stationsByState)});function populateStations(b,c,d){var e='';if(b.toLowerCase()!='all'){e='?state='+b.toLowerCase()}stationsXML='/stations/player/stations.xml'+e;$.ajax({url:stationsXML,type:'GET',dataType:'xml',timeout:3000,error:function(){errorWithRequest()},success:function(a){$('#stations').html('<option value="">Select Station</option>');$(a).find('station').each(function(){sel='';if($(this).attr('state')==b||b=='all'){if(d>-1&&c){if($(this).attr('id')==d){changeStation($(this).attr('location'),true);sel='selected'}}$('#stations').append('<option '+sel+' value="'+$(this).attr('location')+'">'+$(this).attr('name')+'</option>')}});$('#stations').attr({disabled:false})}});$('#drops').show()}function changeStation(c,d){loadRequestTimeout=clearTimeout(loadRequestTimeout);$.ajax({url:c,type:'GET',dataType:'xml',timeout:3000,error:function(){errorWithRequest()},success:function(a){if(d){var b=$(a).find('station').attr('callsign');$('#blurb').html($(a).find('station').attr('blurb'));rebuildPlayer(b,true);$(a).find('station').find('images').each(function(){$(this).find('header').each(function(){setStationHeaderImage($(this).attr('value'))});$(this).find('generic').each(function(){generic90Img=$(this).attr('value')});$(this).find('background').each(function(){if(getCurrentTab=='tLive'){setBackground($(this).attr("value"))}})})}$('#blurb').html($(a).find('station').attr('blurb'));newShow(a)}})}function newShow(d){$(d).find('schedule').each(function(){var c=$(this).attr('timezone');$(this).find('day').each(function(){if($(this).attr("value").toLowerCase()==getCurrentDay().toLowerCase()){nextShow=false;$(this).find('show').each(function(){if(nextShow){nextShowInfo($(this).attr('name'),$(this).attr('link'));nextShow=false;return false}ems=parseInt(getETimeMS());ms=parseInt(getTimeMS());var a=parseInt($(this).attr("startms"))+ems;var b=parseInt($(this).attr("endms"))+ems;if($(this).attr('multiday')=='true'){b=b+86400000}if(ms>=a&&(ms<b)){$('#loadingbox').hide();$('#selecthelp').hide();$('#showbox').show();setShowInfo($(this).attr('name'),$(this).attr('link'));setShowImage($(this).attr('graphic'),$(this).attr('link'));countdown(Math.abs((b-ms)));$('#showThumb').fadeIn('slow');$('#showbox').fadeIn('slow');$('#timeremain').fadeIn('slow');nextShow=true}})}})})}function swapStation(){$('#thumbImg').hide();$('#showbox').hide();$('#loadingbox').show();$('#selecthelp').hide();stationXML=$('#stations').val();eq=stationXML.indexOf('=');adName=stationXML.substring(eq+1);grabAd('live',adName);if(stationXML!=''){changeStation(stationXML,true)}}function swapTab(c){$('#prestitial').hide();switch(getCurrentTab()){case"tLive":stopStreaming();$('#liveTab').hide();break;case"tCast":stopPodcast();$('#podcastTab').hide();break;case"tMore":stopAudio();$('#espnaudioTab').hide();break;case"tWebcams":stopVideo();hideWebcams();break}var b="";tabs=new Array("tCast","tLive","tMore","tWebcams");switch(c){case"tCast":b=skinImagePath+"skin_podcenter.jpg";$('#podcastTab').show();trackPageView('podcenter');break;case"tLive":b=skinImagePath+"skin_livestream2.jpg";$('#liveTab').show();trackPageView('live');break;case"tMore":b=skinImagePath+"skin_more.jpg";$('#espnaudioTab').show();trackPageView('audio');break;case"tWebcams":b=skinImagePath+defaultWebcamSkin;showWebcams();trackPageView('webcam');break;default:b=skinImagePath+"skin_livestream2.jpg";$('#liveTab').show();trackPageView('live')}try{$('body').attr({style:'background: #000000 url('+b+') no-repeat scroll 0% 0%;'});$('#'+getCurrentTab()).removeClass("realm");$('#'+c).toggleClass("realm")}catch(e){errorWithRequest()}setCurrentTab(c)}function countdown(a){count=Math.floor(a/1000);if(count>0){sec=toSt(count%60);count=Math.floor(count/60);min=toSt(count%60);count=Math.floor(count/60);hr=toSt(count%24);txt=hr+":"+min+":"+sec;$("#timeremain").html(txt);timeout=clearTimeout(timeout);timeout=setTimeout("countdown("+(a-1000)+")",1000)}else{$('#timeremain').fadeOut('slow');changeStation($('#stations').val(),false)}}function rebuildPlayer(a,b){volume_param='';$('#tempControl').hide();$('#streaming-player-home').show();if(getStreamVolume()>-1){volume_param='&vol='+getStreamVolume()}streamingPlayer.flashVars=a+volume_param;streamingPlayer.useDOM=true;streamingPlayer.targetElement="streaming-player-home";streamingPlayer.render(true)}function setShowImage(a,b){if(a!=null&&a!=''){$('#thumbImg').hide();if(b!=null){$('#thumbLink').attr({onclick:"openURL('"+b+"');"})}else{$('#thumbLink').attr({onclick:"void(0);"})}$('#thumbImg').attr({src:a});$('#thumbImg').fadeIn('slow')}else{$('#thumbImg').hide()}}function setShowInfo(a,b){$('#currentLink').hide();if(b!=null){$('#currentLink').attr({onclick:"openURL('"+b+"');"})}else{$('#currentLink').attr({onclick:"return false;"})}$('#currentLink').html(a);$('#currentLink').fadeIn('slow')}function nextShowInfo(a,b){$('#nextLink').hide();if(b!=null){$('#nextLink').attr({onclick:"openURL('"+b+"');"})}else{$('#nextLink').attr({onclick:"return false;"})}$('#nextLink').html(a);$('#nextLink').fadeIn('slow')}function setStationHeaderImage(a){$("#stationImage").attr({src:a})}function setBackground(a){if(a!=''){$('body').attr({style:'background: #000000 url('+a+') no-repeat scroll 0% 0%;'})}setLiveVideoSkin(a)}function getCurrentDay(){days=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');onairdate=new Date();onairdate.setHours(0);onairdate.setMinutes(0);onairdate.setSeconds(0);onairdate.setMilliseconds(0);mil=onairdate.getTime();tzone=onairdate.getTimezoneOffset();tzone>=0?gmttime=mil-(tzone*60*1000):gmttime=mil+(tzone*60*1000);etimems=gmttime+dstOffset;now=new Date();nowmil=now.getTime();nowtz=now.getTimezoneOffset();nowtz>=0?gmtnow=nowmil-(nowtz*60*1000):gmtnow=nowmil+(nowtz*60*1000);enow=new Date();enow.setTime(nowmil);eday=enow.getDay();return days[eday]}function getTimeMS(){now=new Date();nowmil=now.getTime();nowtz=now.getTimezoneOffset();nowtz>=0?gmtnow=nowmil-(nowtz*60*1000):gmtnow=nowmil+(nowtz*60*1000);return nowmil}function getETimeMS(){onairdate=new Date();onairdate.setHours(0);onairdate.setMinutes(0);onairdate.setSeconds(0);onairdate.setMilliseconds(0);mil=onairdate.getTime();tzone=onairdate.getTimezoneOffset();tzone>=0?gmttime=mil-(tzone*60*1000):gmttime=mil+(tzone*60*1000);etimems=gmttime+dstOffset;return etimems}function grabAd(a,b){param='';if(a=='null'||a==null||b=='undefined'||b==null||b=='null'){a='';b=''}if(a!=''){param='?'+a+'='+b}var c='http://sports.espn.go.com/espnradio/thisIsAnAd'+param;externalAd(c)}function openURL(a){var b=500;var c=null;if(screen.availHeight){b=screen.availHeight}var d=1024;if(screen.availHeight&&screen.availHeight<1024){d=screen.availHeight}if(opener){try{c=opener.window.open(a)}catch(e){window.open(a,'newWindow','status=1,toolbar=1,location=1,menubar=1,directories=1,resizable=1,scrollbars=1,top=0,left=0,height='+b+',width='+d)}}else{try{c=window.open(a,'newWindow','status=1,toolbar=1,location=1,menubar=1,directories=1,resizable=1,scrollbars=1,top=0,left=0,height='+b+',width='+d)}catch(e){window.open(a,'newWindow','status=1,toolbar=1,location=1,menubar=1,directories=1,resizable=1,scrollbars=1,top=0,left=0,height='+b+',width='+d)}}if(c){try{c.focus()}catch(e){}}}function externalAd(a){if(a.indexOf('null')>-1||a==null){a="http://sports.espn.go.com/espnradio/thisIsAnAd"}$("#adFrame").hide();$("#adFrame").attr({src:a});$("#adFrame").fadeIn('slow')}function stopVideo(){getFlashMovie("stw_video").stopLiveVideo()}function setLiveVideoSkin(a){a=a.replace('skin_','fullscreen_skin_');getFlashMovie("stw_video").setSkin(a)}function stopStreaming(){try{getFlashMovie("streamingPlayer").callTurnOff()}catch(e){}}function setStreamVolume(a){stream_vol=a;try{getFlashMovie("streamingPlayer").callSetStreamVolume(a)}catch(e){}}function getStreamVolume(){return stream_vol}function setPodcastVolume(a){podcast_vol=a}function getPodcastVolume(){return podcast_vol}function hidepreroll(a){hidePrestitialTimeout=clearTimeout(hidePrestitialTimeout);populateStations('all',true,stationId);so.useDOM=true;so.targetElement="webcamFrame";so.render(true);$('#prestitial').hide()}function showpreroll(a){$('#prest-table').attr({border:"10"});prest.flashFile="http://assets.espn.go.com/swf/espnradio/08/prestitial/prestitial_wgif.swf";prest.useDOM=true;prest.width="450";prest.height="358";prest.targetElement="prest-home";prest.render(true);so.render(false);hidePrestitialTimeout=setTimeout("hidepreroll()",30000)}function trackPageView(a){if(a=='live'){if(currentStation=='chicago'){a='espnradio1000:live';prop5='stations:espnradio1000'}else if(currentStation=='dallas'){a='espn1033:live';prop5='stations:espnradio1033'}else if(currentStation=='la'){a='710espn:live';prop5='stations:710espn'}else if(currentStation=='nyc'){a='1050espnradio:live';prop5='stations:1050espnradio'}else if(currentStation=='pittsburgh'){a='espnradio1250:live';prop5='stations:espnradio1250'}else if(currentStation=='espnradio'){a="live";prop5='player'}else{a=currentStation+':live';prop5='player'}}try{anClearVars();s_omni.pageName="espnradio:espnradio:player:"+a;s_omni.server=window.location.host;s_omni.channel="espnradio";s_omni.prop1="espnradio";s_omni.prop5='espnradio:'+prop5;s_omni.prop17="en";s_omni.prop25="none";s_omni.prop30="n";s_omni.hier1='espnradio:'+prop5;var b=s_omni.t();if(b)document.write(b)}catch(e){}}function getCurrentTab(){return currentTab}function setCurrentTab(a){currentTab=a}function log(a){try{console.log(a)}catch(e){}}function toSt(n){s="";if(n<10)s+="0";return s+n.toString()}function errorWithRequest(){$('#showThumb').hide();$('#showbox').hide();$('#loadingbox').html('Sorry, there was an error processing your request. Please try a different station or <a href="">refresh</a> the player<span id="dots_2"></span>');$('#loadingbox').show()}function stationsByState(){populateStations($('#states').val(),false,null)}function hideWebcams(){$('#scoreboard').show();$('#headlines').show();$('#webcamsTab').hide();$('#webnav').hide();$('#webcam_skin').hide()}function showWebcams(){$('#scoreboard').hide();$('#headlines').hide();$('#webcamsTab').show();$('#webnav').show();$('#webcam_skin').show()}function startScroll(a,b){if(a=="up"){y=-5-b;document.getElementById("headlinesScroll").scrollTop+=y}else{y=5+b;document.getElementById("headlinesScroll").scrollTop+=y}newInterval=b+1;var c="startScroll(\""+a+"\", "+newInterval+")";scrollInterval=setTimeout(c,50);return false}function endScroll(){if(scrollInterval!=null){scrollInterval=clearTimeout(scrollInterval)}return false}function rescaleApp(){window.resizeTo(masterWidth,masterHeight)}function flashUpgrade(){$('#help').html('Please click <a href="javascript:void(0);" onclick ="openURL(\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\');">here</a> to upgrade your flash player.')}function addEvent(a,b,c){if(a.addEventListener){a.addEventListener(b,c,false);return true}else if(a.attachEvent){var r=a.attachEvent("on"+b,c);return r}else{return false}}function getFlashMovie(a){if(window.document[a]){return window.document[a]}if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[a]){return document.embeds[a]}}else{return document.getElementById(a)}}