home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / ASE.Z / settform.js < prev    next >
Encoding:
Text File  |  1997-08-21  |  4.3 KB  |  128 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3. //the file that includes this must also include settings.js!
  4.  
  5.  
  6. // Request privilege
  7. var thePlatform = new String(navigator.userAgent);
  8. var x=thePlatform.indexOf("(")+1;
  9. var y=thePlatform.indexOf(";",x+1);
  10. thePlatform=thePlatform.substring(x,y);
  11.  
  12. if (thePlatform != "Macintosh")    {
  13.     compromisePrincipals();            // work around for the security check
  14.     }
  15.  
  16. function loadData()
  17. {
  18.  
  19.     
  20.     var acctSetupFile        =     parent.parent.globals.getAcctSetupFilename(parent.parent.globals);
  21.      var forceExisting         =     "";
  22.      var    forceNew            =     "";
  23.      var showPhones            =    "";
  24.      var asFormName            =    "asglobals";
  25.  
  26.      modeSectionName            =    "Mode Selection";
  27.      newSectionName            =    "New Acct Mode";    
  28.      existingSectionName        =    "Existing Acct Mode";
  29.      
  30.     
  31.     //set the online/offline flags
  32.     forceExisting     = parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"ForceExisting");
  33.     forceNew        = parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"ForceNew");
  34.     
  35.     if ((forceNew != null) && (forceNew != "") && (forceNew == "yes"))
  36.     {
  37.         setRadio(asFormName, "asmode", 0); 
  38.     }
  39.     else if ((forceExisting != null) && (forceExisting != "") && (forceExisting == "yes"))
  40.     {
  41.         setRadio(asFormName, "asmode", 1);
  42.     }
  43.     else
  44.     {
  45.         setRadio(asFormName, "asmode", 2);
  46.     }
  47.     //set the intlMode flag
  48.     setCheckBox(asFormName, "intmode", parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"IntlMode"));
  49.     
  50.     //set the two other options flags
  51.     setCheckBox(asFormName, "Show_Intro_Screens", parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"Show_Intro_Screens"));    
  52.     var Dialer_Idle_Time = parseInt(parent.parent.globals.GetNameValuePair(acctSetupFile,modeSectionName,"Dialer_Disconnect_After"));
  53.     
  54.     if (Dialer_Idle_Time == null || isNaN(Dialer_Idle_Time) || Dialer_Idle_Time == "null" || Dialer_Idle_Time == "" || Dialer_Idle_Time < 5)
  55.         Dialer_Idle_Time = 15;     //default idle time
  56.     
  57.     setText(asFormName, "Dialer_Disconnect_After", Dialer_Idle_Time);
  58.     
  59.     if (parent.controls.generateControls)    
  60.         parent.controls.generateControls();
  61.     
  62. }//function loadData()
  63.  
  64.  
  65. function fixIdleTime()
  66. {
  67.      var asFormName            =    "asglobals";
  68.     
  69.     var Dialer_Idle_Time = parseInt(getText(asFormName,"Dialer_Disconnect_After"));
  70.     
  71.     if (Dialer_Idle_Time.toString() == "NaN" || Dialer_Idle_Time > 99)
  72.     {
  73.         Dialer_Idle_Time = 15; // default dialer idle time
  74.     }
  75.     else if (Dialer_Idle_Time < 5)
  76.         Dialer_Idle_Time = 5; //minimum dialer idle time
  77.  
  78.     setText(asFormName, "Dialer_Disconnect_After", Dialer_Idle_Time);
  79. }
  80.  
  81. function checkData()
  82. {
  83.     fixIdleTime();
  84.     return true;
  85. }
  86.  
  87.  
  88. function saveData()
  89. {
  90.     var acctSetupFile        =    parent.parent.globals.getAcctSetupFilename(parent.parent.globals);
  91.      var asFormName            =    "asglobals";
  92.  
  93.      modeSectionName            =    "Mode Selection";
  94.      newSectionName            =    "New Acct Mode";
  95.      existingSectionName        =    "Existing Acct Mode";
  96.  
  97.     parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName,"IntlMode", getCheckBox(asFormName,"intmode"));
  98.  
  99.     var modeRadio = getRadio(asFormName, "asmode");
  100.     var modeRadioString = new String(modeRadio);
  101.     if (modeRadioString == "yes")
  102.     {
  103.         //debug("SaveData: Ext no, New yes");
  104.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceNew", "yes");
  105.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceExisting", "no");
  106.     }
  107.     else if (modeRadioString == "no")
  108.     {
  109.         //debug("SaveData: New no, Ext yes");
  110.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceNew", "no");
  111.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceExisting", "yes");    
  112.     }
  113.     else
  114.     {
  115.         //debug("SaveData: both no");
  116.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceNew", "no");
  117.         parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "ForceExisting", "no");    
  118.     }
  119.     
  120.     //set dialer idle time and show_intro screens
  121.     parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "Show_Intro_Screens", getCheckBox(asFormName, "Show_Intro_Screens"));
  122.     parent.parent.globals.SetNameValuePair(acctSetupFile, modeSectionName, "Dialer_Disconnect_After", getText(asFormName, "Dialer_Disconnect_After"));
  123.     
  124.  
  125. }
  126.  
  127. // end hiding contents from old browsers  -->
  128.