song_length = _tpl_vars['song_length']; ?> ; song_position = _tpl_vars['song_position']; ?> ; song_min = _tpl_vars['initialmin']; ?> ; song_sec = _tpl_vars['initialsec']; ?> ; progressbar_width = _tpl_vars['progressbar_width']; ?> ; mpd_state = '_tpl_vars['mpd_state']; ?> '; = 60) { song_sec = 0; song_min = song_min + 1 } } progressbar = document.getElementById(\'progressbar\'); new_margin = Math.round(progressbar_width - ((song_position / song_length) * progressbar_width)); new_margin_string = new_margin + \'px\'; progressbar.style.marginRight = new_margin_string; document.getElementById(\'min\').innerHTML = format_time(song_min); document.getElementById(\'sec\').innerHTML = format_time(song_sec); //alert(progressbar.style.marginRight + \' - \' + new_margin_string); } if (mpd_state == \'play\') { //start off with a shorter interval. this should make the whole thing a little more accurate. setTimeout(\'update_progress()\', 750); } '; ?>