home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd2.bin / nav2004 / download / NAV / External / NORTON / APP / NAVComUI.dll / HTML / COMMONUISHARED.JS < prev    next >
Text File  |  2003-08-17  |  3KB  |  105 lines

  1. // Disable Drag-and-drop support
  2. document.ondragstart = function(){return false;}
  3.  
  4. // MessageBox() Flags
  5. var MB_OK =                     0x00000000;
  6. var MB_OKCANCEL =               0x00000001;
  7. var MB_ABORTRETRYIGNORE =       0x00000002;
  8. var MB_YESNOCANCEL =            0x00000003;
  9. var MB_YESNO =                  0x00000004;
  10. var MB_RETRYCANCEL =            0x00000005;
  11.     
  12. var MB_ICONHAND =               0x00000010;
  13. var MB_ICONQUESTION =           0x00000020;
  14. var MB_ICONEXCLAMATION =        0x00000030;
  15. var MB_ICONASTERISK  =          0x00000040;
  16.     
  17. var MB_USERICON =               0x00000080;
  18. var MB_ICONWARNING =            MB_ICONEXCLAMATION;
  19. var MB_ICONERROR =              MB_ICONHAND;
  20.     
  21. var MB_ICONINFORMATION =        MB_ICONASTERISK;
  22. var MB_ICONSTOP =               MB_ICONHAND;
  23.     
  24. var IDOK =              1;
  25. var IDCANCEL =          2;
  26. var IDABORT =           3;
  27. var IDRETRY =           4;
  28. var IDIGNORE =          5;
  29. var IDYES =             6;
  30. var IDNO =              7;
  31.  
  32.  
  33. var ENTER_KEY =            13;
  34. var ESC_KEY =            27;
  35. var SPACEBAR_KEY =        32;
  36.     
  37. function Tooltip(line1, line2, line3, line4) 
  38. {
  39.     paddingX = 10;
  40.     paddingY = 10;
  41.     font_size = 8;
  42.  
  43.     if (line1)
  44.     {
  45.         tooltipWidth = document.body.clientWidth - (paddingX * 2);
  46.         tooltipX = paddingX;
  47.         tooltipY = paddingY;
  48.  
  49.         beginTable = "<table width="+tooltipWidth+" border=0 bgcolor='white' cellspacing=0 cellpadding=0 style='Border: black 1px solid'>"
  50.         endTable = "</table>";
  51.     
  52.         row1 = "<tr><td><table width='100%' height=17 border=0 cellspacing=0 cellpadding=0 style='background-image: url(tooltip_titlebar_430x17.gif); background-repeat: no-repeat'><tr><td width="+(tooltipWidth)+" style='color: #5B5B5B'><b>" + "  " + line1 + "</b></td><td width='10' align='right' style='color: #5B5B5B' OnClick='CloseTooltip()'><a style='text-decoration: none; cursor: hand'><b>X</b></a></td></tr></table></td></tr>";
  53.         
  54.         if (line3 && line4)
  55.             row2 = "<tr><td colspan=2><textarea readonly class=cutooltip TABINDEX=-1 style='background-color: #ffffff; width:"+(tooltipWidth)+"; height: 60'>" + line2 + "\n" + line3 + "\n" + line4 + "</textarea></td></tr>";
  56.         else
  57.             row2 = "<tr><td colspan=2><textarea readonly class=cutooltip TABINDEX=-1 style='background-color: #ffffff; width:"+(tooltipWidth)+"; height: 60'>" + line2 + "</textarea></td></tr>";
  58.         document.all("tooltiptext").innerHTML = beginTable + row1 + row2 + endTable;
  59.         document.all("tooltiptext").style.display = "";
  60.         document.all("tooltiptext").style.left = tooltipX;
  61.         document.all("tooltiptext").style.top = tooltipY;
  62.     }
  63. }
  64.  
  65. function CloseTooltip()
  66. {
  67.     document.all("tooltiptext").style.display = "none";
  68. }
  69.  
  70. function KeyboardCloseTooltip(objTR)
  71. {
  72.     // Close the Tooltip from the keyboard.
  73.     // Launch help for repair wizard from keyboard
  74.     // The "ENTER" and "ESC" keys are used.
  75.    if ( (event.keyCode == ENTER_KEY) || (event.keyCode == ESC_KEY) )
  76.    {
  77.         document.all("tooltiptext").style.display = "none";
  78.     }
  79. }
  80.  
  81. function SetProgress(nPct)
  82. {
  83.     // We must special case 0 otherwise we get "invalid property"... arrrgggg!
  84.     var nRemain = 100 - nPct;
  85.     
  86.     if(nPct > 0)
  87.     {
  88.         ProgDone.style.display = "";
  89.         ProgDone.width = nPct + "%";
  90.     }
  91.     else
  92.     {
  93.         ProgDone.style.display = "none";
  94.     }
  95.     
  96.     if(nRemain > 0)
  97.     {
  98.         ProgRemain.style.display = "";
  99.         ProgRemain.width = nRemain + "%";
  100.     }
  101.     else
  102.     {
  103.         ProgRemain.style.display = "none";
  104.     }
  105. }