1.  
  2. var slideLeft = function(e) {
  3. if (!timer1.getEnabled()) {
  4. timer1.start();
  5. }
  6. var ct = 0;
  7. var moveLeft = function(e) {
  8. for (var i=0;i<SLIDE_SPEED;i++) {
  9. if (ct < SLIDE_AMOUNT) {
  10. var left = pictureSliderPanel.getLeft();
  11. pictureSliderPanel.setLeft(--left);
  12. ct++;
  13. } else {
  14. timer1.stop();
  15. ct = 0;
  16. break;
  17. }
  18. }
  19. }
  20. if (!timer1.hasListeners("tick")) {
  21. timer1.addEventListener("tick", moveLeft);
  22. }
  23. if (pictureSliderPanel.getLeft() == MAX_LEFT) {
  24. rightBtn.setEnabled(false);
  25. rightBtn.setUri("./rightBtnDisabled.gif");
  26. currentPosition.setLocation(posIndicator.getWidth() - currentPosition.getWidth(),0);
  27. } else {
  28. currentPosition.setLocation(posIndicator.getWidth() - 18,0);
  29. }
  30. leftBtn.setEnabled(true);
  31. leftBtn.setUri("./leftBtnActive.gif");
  32. }
  33.  
  34.