function do360SoundCheck() { // check to make sure there is an audio div and that it has links if(document.getElementById("artAudioBox").getElementsByTagName("a")) { // grab the artist ID from the URL string, match artistid=SOME_NUMBERS, and then just grab SOME_NUMBERS var artistId = window.location.toString().match(/artistId=(\d+)/g).toString().match(/\d+/g); var artSongList = document.getElementById("artAudioBox").getElementsByTagName("a"); var songId; for(var i = 0; i < artSongList.length; i++) { // grab the song ID from the link. This solution relies on it being the second number return // from the regex search (360 being the first) songId = artSongList[i].href.match(/\d+/g)[1]; //artSongList[i].href = "javascript:openwin('http://www.austin360.com/music/content/music/soundcheck/player/player.html?playlist_url=getTrackByArtistTagTrackTag/" + artistId + "/" + songId + "', 'jukebox', 'width=775,height=600,scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no');"; //artSongList[i].href = "http://www.austin360.com/music/content/music/soundcheck/player/player.html?playlist_url=getTrackByArtistTagTrackTag/" + artistId + "/" + songId + "&resize=true&w=800&h=775"; artSongList[i].target = "_aas_song"; artSongList[i].href = "http://www.austin360.com/music/content/music/soundcheck/player/player.html?playlist_url=getTrackByArtistTagTrackTag/" + artistId + "/" + songId; artSongList[i].onclick = function() { //"return aasopen(800, 700, '_aas_song');"; return aasopen(800, 550, '_aas_song'); } } // display the artAudioBox previously hidden via CSS. This will ensure that users // cannot click on a link before this script has a chance to run. document.getElementById("artAudioBox").style.display = "block"; } } addLoadEvent(do360SoundCheck);