- elem.src = IMAGE.BUTTON_PLAY;
- add_listener(elem, "click", send_play_pause);
- if(window.stop_button) {
- elem = document.getElementById('stop_button');
- elem.style.display = "";
- elem.src = IMAGE.BUTTON_STOP;
- add_listener(elem, "click", send_stop_cmd);
- elem.parentNode.style.marginLeft = "-15px";
- }
-
- elem = document.getElementById("next_button");
- elem.src = IMAGE.BUTTON_NEXT;
- add_listener(elem, "click", send_next_song);
- elem = document.getElementById("previous_button");
- elem.src = IMAGE.BUTTON_PREVIOUS;
- add_listener(elem, "click", send_previous_song);
+ if (elem) /* we must be in read write mode to show these buttons */
+ {
+ elem.src = IMAGE.BUTTON_PLAY;
+ add_listener(elem, "click", send_play_pause);
+ if(window.stop_button) {
+ elem = document.getElementById('stop_button');
+ elem.style.display = "";
+ elem.src = IMAGE.BUTTON_STOP;
+ add_listener(elem, "click", send_stop_cmd);
+ elem.parentNode.style.marginLeft = "-15px";
+ }
+
+ elem = document.getElementById("next_button");
+ elem.src = IMAGE.BUTTON_NEXT;
+ add_listener(elem, "click", send_next_song);
+ elem = document.getElementById("previous_button");
+ elem.src = IMAGE.BUTTON_PREVIOUS;
+ add_listener(elem, "click", send_previous_song);
+ }