function openCloseInfo(id) { if (currentSongId && currentSongId != id){ openCloseInfo(currentSongId); } link = $('#song-'+ id); song_info = $('#table'+ id); song_download = $('#song-'+ id +'-download'); if (song_info.css('display') == 'none' && song_download.css('display') == 'none') { currentSongId = id; link.css('backgroundImage',"url('/theme/styles/images/arrow_down.gif')"); link.css('color', '#799b1a'); song_info.show(); song_download.hide(); } else { currentSongId = ''; link.css('backgroundImage', "url('/theme/styles/images/arrow_right.gif')"); link.css('color', '#1b1b1b'); song_info.hide(); song_download.hide(); } } $(document).ready(function() { $('.listen').each(function(i, el) { $(el).flash({ src: $(this).attr('title'), wmode: 'transparent', width: 16, height: 16 }); }); $(".download_dialog").click(function(event) { var target_obj = $("#song-"+ $(this).attr("song-id") +"-download") var url_link = $(this).attr("id"); target_obj.html(''); $.ajax({ type: "GET", url: url_link, success: function(msg){ target_obj.html(msg); $('#close_dialog').click(function(event) { $(this).closest('.song-download').html(''); $("#song-"+ $(this).attr("song-id") +"-download").hide(); $('#table'+ $(this).attr("song-id")).show(); return false; }); } }); $(this).closest('table').hide(); target_obj.show() }); $('#song_download_link') .livequery('click', function(event) { $(this).closest('.song-download').html(''); $("#song-"+ $(this).attr("song-id") +"-download").hide(); $('#table'+ $(this).attr("song-id")).show(); }); });