Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.0 KiB

  1. function SuperImage(imgName,onsrc,offsrc)
  2. {
  3. this.HTMLimgName=imgName;
  4. this.onSrc=onsrc;
  5. this.offSrc=offsrc;
  6. this.selected=false;
  7. this.hover=false;
  8. // alert(this.HTMLimgName.toString());
  9. // alert(this.offSrc.toString());
  10. // alert(this.onSrc.toString());
  11. }
  12. new SuperImage("crap","crapon.gif","crapoff.gif");
  13. function SuperImage_over()
  14. {
  15. this.hover=true;
  16. // alert("blap");
  17. this.update();
  18. }
  19. SuperImage.prototype.over=SuperImage_over;
  20. function SuperImage_on()
  21. {
  22. this.selected=true;
  23. this.update();
  24. }
  25. SuperImage.prototype.on=SuperImage_on;
  26. function SuperImage_off()
  27. {
  28. this.selected=false;
  29. this.update();
  30. }
  31. SuperImage.prototype.off=SuperImage_off;
  32. function SuperImage_out()
  33. {
  34. this.hover=false;
  35. this.update();
  36. }
  37. SuperImage.prototype.out=SuperImage_out;
  38. function SuperImage_update()
  39. {
  40. if (document.images)
  41. {
  42. if (this.hover == true || this.selected == true)
  43. document[this.HTMLimgName].src = this.onSrc;
  44. else
  45. document[this.HTMLimgName].src = this.offSrc;
  46. }
  47. }
  48. SuperImage.prototype.update=SuperImage_update;