home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / trial / MonitorIT 5.2.06 / monitorit_fullsetup.exe / data1.cab / Js / ButtonFunc.js < prev    next >
Encoding:
JavaScript  |  2003-06-24  |  1.6 KB  |  56 lines

  1. /* ======================================================================
  2. DESC: Common Button Functions for the Administer Operations
  3.  
  4. PLATFORMS: >= MS IE 4.0
  5.  
  6. USAGE NOTES: 
  7. ====================================================================== */
  8. var IfnS = ".gif";  // Image file name suffix; JPG for > 8 bit color; GIF <= 8 bit
  9. var preLoadDone = false;
  10.  
  11. /* Preload button images */
  12. function IMGPreload(img) {
  13.     var a=new Image();
  14.     a.src=img;
  15.     return a;
  16. }
  17.  
  18. // Determine Color Depth and Type of image files to use
  19. //IfnS = (screen.colorDepth > 4) ? ".jpg" : ".gif";
  20.  
  21. /* Set Button State accordingly to either Normal or Disabled */
  22. function SetButtonState(BtObj,BState) {
  23.     if (BState == "0") {
  24.         BStrg = "N";
  25.         BtObj.bdis = "0";
  26.         BtObj.style.cursor = "hand";
  27.     }
  28.     else {
  29.         BStrg = "G";
  30.         BtObj.bdis = "1";
  31.         BtObj.style.cursor = "auto";
  32.     }
  33.     BtObj.src = eval("B" + BtObj.btype + BStrg + ".src");
  34. }
  35.  
  36. /* Process Button Mouse Events and toggle Buttons accordingly */
  37. function processButtonMouseOut() {
  38.     if (event.srcElement.bdis == "0") {
  39.         event.srcElement.src = eval("B" + event.srcElement.btype + "N.src");
  40.     }
  41. }
  42. function processButtonMouseOver(){
  43.     if (event.srcElement.bdis == "0") {
  44.         event.srcElement.src = eval("B" + event.srcElement.btype + "O.src");
  45.     }
  46. }
  47. function processButtonMouseDown() {
  48.     if (event.srcElement.bdis == "0") {
  49.         event.srcElement.src = eval("B" + event.srcElement.btype + "D.src");
  50.     }
  51. }
  52. function processButtonMouseUp() {
  53.     if (event.srcElement.bdis == "0") {
  54.         event.srcElement.src = eval("B" + event.srcElement.btype + "O.src");
  55.     }
  56. }