home *** CD-ROM | disk | FTP | other *** search
/ Software Selections: IBM PC 300GL / TWCUSN017WW.iso / content / left.js < prev    next >
Encoding:
Text File  |  1999-06-21  |  5.7 KB  |  211 lines

  1. var g_CurrentMenuItem;
  2. var g_strLastHelpURL;
  3. var g_AppsTable;
  4.  
  5. function Body_OnLoad()
  6. {
  7.     WaitForControls();
  8. }
  9.  
  10. function WaitForControls()
  11. {
  12.     g_AppsTable = GetControl("RightPane", "AppsTable");
  13.  
  14.     if (g_AppsTable != null && SSWorld.readyState == 4)
  15.         if (GetControl("RightPane", "InstallButton") != null)
  16.             if (GetControl("RightPane", "UninstallButton") != null)
  17.                 if (GetControl("RightPane", "DiskettesButton") != null)
  18.                     if (GetControl("RightPane", "DriversButton") != null)
  19.                     {
  20.                         if (!SSWorld.ReadLicenseAgreementSupport)
  21.                             Menu.deleteRow(License.rowIndex);
  22.  
  23.                         if (!SSWorld.ChangeSettingsSupport)
  24.                             AdvancedMenu.deleteRow(Settings.rowIndex);
  25.  
  26.                         if (!SSWorld.AddDriversSupport)
  27.                             AdvancedMenu.deleteRow(Drivers.rowIndex);
  28.  
  29.                         if (!SSWorld.DisketteImageSupport)
  30.                             AdvancedMenu.deleteRow(Diskettes.rowIndex);
  31.  
  32.                         if (!SSWorld.CDImageSupport)
  33.                             AdvancedMenu.deleteRow(CDImage.rowIndex);
  34.  
  35.                         if (AdvancedMenu.rows.length == 0)
  36.                             Menu.deleteRow(Advanced.rowIndex);
  37.  
  38.                         Menu.style.display = "";
  39.  
  40.                         Install.click();
  41.  
  42.                         return;
  43.                     }
  44.  
  45.     setTimeout("WaitForControls()", 1000);
  46. }
  47.  
  48. function Body_OnMouseUp()
  49. {
  50.     document.selection.empty();
  51. }
  52.  
  53. function Body_OnUnload()
  54. {
  55.     if (SSWorld.readyState == 4)
  56.         SSWorld.ArchiveData();
  57. }
  58.  
  59. function Menu_OnClick()
  60. {
  61.     if (" TABLE TBODY TD ".indexOf(" " + window.event.srcElement.tagName + " ") == -1)
  62.     {
  63.         var NewMenuItem = window.event.srcElement;
  64.  
  65.         while (NewMenuItem.tagName != "TR")
  66.             NewMenuItem = NewMenuItem.parentElement;
  67.  
  68.         if (NewMenuItem != null)
  69.         {
  70.             if (NewMenuItem.cells[1].children.tags("TABLE").length > 0)
  71.             {
  72.                 if (NewMenuItem.cells[1].children.tags("TABLE")[0].style.display == "")
  73.                 {
  74.                     NewMenuItem.cells[0].children.tags("IMG")[0].src             = "../images/closmenu.gif";
  75.                     NewMenuItem.cells[1].children.tags("TABLE")[0].style.display = "none";
  76.                 }
  77.                 else
  78.                 {
  79.                     NewMenuItem.cells[0].children.tags("IMG")[0].src             = "../images/openmenu.gif";
  80.                     NewMenuItem.cells[1].children.tags("TABLE")[0].style.display = "";
  81.                 }
  82.             }
  83.             else if (NewMenuItem != g_CurrentMenuItem)
  84.             {
  85.                 for (i = 0; i < document.all.tags("TR").length; ++i)
  86.                 {
  87.                     if (document.all.tags("TR")[i].contains(NewMenuItem))
  88.                         document.all.tags("TR")[i].style.color = "#FF9645";
  89.                     else
  90.                         document.all.tags("TR")[i].style.color = "white";
  91.                 }
  92.  
  93.                 DisplayTopic(NewMenuItem.id);
  94.  
  95.                 g_CurrentMenuItem = NewMenuItem;
  96.             }
  97.         }
  98.     }
  99. }
  100.  
  101. function DisplayTopic(strTopic)
  102. {
  103.     var strURL;
  104.  
  105.     if (parent.frames.RightPane != null)
  106.     {
  107.         if (g_CurrentMenuItem == Help)
  108.             g_strLastHelpURL = parent.frames.RightPane.document.SecondaryFrame.location.href;
  109.  
  110.         switch (strTopic)
  111.         {
  112.             case "Install":
  113.             case "Uninstall":
  114.             case "Drivers":
  115.             case "Diskettes":
  116.  
  117.                 // Synchronize AppsTable control settings with those of the SSWorld
  118.                 // control; but turn the redraw flag off until we're done, else the
  119.                 // AppsTable control will rebuild/repaint itself each time a setting
  120.                 // is changed.  NOTE:  We won't change the DataURL property until the
  121.                 // end of this function, because we want the table to be displayed
  122.                 // (albeit empty) while any wait indicator (e.g., wait cursor or
  123.                 // window with some animation) appears.
  124.  
  125.                 g_AppsTable.SetRedraw(false);
  126.  
  127.                 if (strTopic == "Install")
  128.                     g_AppsTable.Mode = 0;
  129.                 else if (strTopic == "Uninstall")
  130.                     g_AppsTable.Mode = 1;
  131.                 else if (strTopic == "Drivers")
  132.                     g_AppsTable.Mode = 2;
  133.                 else if (strTopic == "Diskettes")
  134.                     g_AppsTable.Mode = 3;
  135.  
  136.                 g_AppsTable.OS                   = SSWorld.OS;
  137.                 g_AppsTable.LocalCC              = SSWorld.LocalCC;
  138.                 g_AppsTable.ParentCC             = SSWorld.ParentCC;
  139.                 g_AppsTable.FlyoverEnabled       = SSWorld.FlyoverEnabled;
  140.                 g_AppsTable.CustomInstallEnabled = SSWorld.CustomInstallEnabled;
  141.  
  142.                 g_AppsTable.SetRedraw(true);
  143.  
  144.                 if (strTopic == "Install")
  145.                     Animation.style.backgroundImage = "url(../images/inst.gif)";
  146.                 else if (strTopic == "Uninstall")
  147.                     Animation.style.backgroundImage = "url(../images/unin.gif)";
  148.                 else
  149.                     Animation.style.backgroundImage = "url(../images/advc.gif)";
  150.                 break;
  151.  
  152.             case "Settings":
  153.  
  154.                 strURL = "settings.htm";
  155.                 Animation.style.backgroundImage = "url(../images/advc.gif)";
  156.                 break;
  157.  
  158.             case "CDImage":
  159.  
  160.                 strURL = "cdimage.htm";
  161.                 Animation.style.backgroundImage = "url(../images/advc.gif)";
  162.                 break;
  163.  
  164.             case "License":
  165.  
  166.                 strURL = "..\\license\\index.htm";
  167.  
  168.                 Animation.style.backgroundImage = "url(../images/read.gif)";
  169.  
  170.                 break;
  171.  
  172.             case "Help":
  173.  
  174.                 if (g_strLastHelpURL == null)
  175.                     g_strLastHelpURL = "help\\ssindx.htm";
  176.  
  177.                 strURL = g_strLastHelpURL;
  178.  
  179.                 Animation.style.backgroundImage = "url(../images/help.gif)";
  180.  
  181.                 break;
  182.  
  183.             default:
  184.  
  185.                 return;
  186.         }
  187.  
  188.         var PrimaryFrame   = parent.frames.RightPane.document.all.item("PrimaryFrame");
  189.         var SecondaryFrame = parent.frames.RightPane.document.all.item("SecondaryFrame");
  190.  
  191.         if (strURL == null)
  192.         {
  193.             SecondaryFrame.style.visibility = "hidden";
  194.             SecondaryFrame.src              = "";
  195.             PrimaryFrame.style.visibility   = "visible";
  196.  
  197.             // We waited until now to set the DataURL property, because we want the table
  198.             // to be visible at this point while the apps file is being read and any wait
  199.             // indicator is being displayed.
  200.  
  201.             if (strTopic == "Install" || strTopic == "Uninstall" || strTopic == "Drivers" || strTopic == "Diskettes")
  202.                 g_AppsTable.DataURL = SSWorld.GetValidDataPath(strTopic == "Uninstall");
  203.         }
  204.         else
  205.         {
  206.             PrimaryFrame.style.visibility   = "hidden";
  207.             SecondaryFrame.src              = strURL;
  208.             SecondaryFrame.style.visibility = "visible";
  209.         }
  210.     }
  211. }