$(function() {    
	/* PNG FIX
	-------------------------------------------------- */
	$("img[src$='png'], #contentWrapperInner, #ad300Container, .spotlightImage, .musicOnAbcTitle, .artistsOnAbcTitle, .justHeardTitle, .upcomingPerformTitle, .btnItunes, .btnMusicVideo, .featuredOnTitle, .featuredSongsTitle, .artistRow, .lastPlayedTitle, .upcomingArtistsTitle").ifixpng();


	launchPlayer = function(url){
		newwindow = window.open(url,'Player','height=315,width=958,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0');
		if (window.focus) {newwindow.focus()}
		return false;
	}
	
	// function for popup player button/listen now
	$("#btnListenNow").click(function () { 
    	launchPlayer("http://musiclounge.abc.go.com/player"); 
    });
	
	var cachedData = "";
	
	var intervalID = setInterval(
		function(){
			$.ajax({
			      url: "http://musiclounge.abc.go.com/sites/musiclounge.abc.go.com/services/getStreamInfo.php?requestedBy=nowPlaying",
			      global: false,
			      type: "GET",
			      dataType: "text",
			      success: function(data){
					if(data != cachedData){
						var swf = swfobject.getObjectById('nowPlayingBlock');
					  	if(typeof(swf.updateNowPlaying) == "function"){
				        	swf.updateNowPlaying(data);
						}
					}
					cachedData = data;
			      }
			   }
			);
		}, 60000);
});