home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / INSTBLDR.Z / asw.jar / connect1.js < prev    next >
Encoding:
Text File  |  1998-02-27  |  3.8 KB  |  118 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3.  
  4.  
  5. function go(msg)
  6. {
  7.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  8.  
  9.     if (parent.parent.globals.document.vars.editMode.value != "yes")    {
  10.         // if RegServer specified in ACCTSET.INI, use it
  11.     
  12.         var theFile = parent.parent.globals.getAcctSetupFilename(self);
  13.         var intlFlag = parent.parent.globals.GetNameValuePair(theFile,"Mode Selection","IntlMode");
  14.         intlFlag = intlFlag.toLowerCase();
  15.     
  16.         var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
  17.         
  18.         if (theRegFile != null && theRegFile != "")    {
  19.             parent.parent.globals.document.vars.regServer.value = theRegFile;
  20.             }
  21.         else    {
  22.             // otherwise, if multiple .IAS files exist, get list selection and determine appropriate .IAS file
  23.     
  24.             var pathName = parent.parent.globals.getConfigFolder(self);
  25.             var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
  26.             if (theList != null)    {
  27.                 if (theList.length >1)    {
  28.                     if (document.forms[0].regServerList.selectedIndex<0)    {
  29.                         alert("Please select an Internet account server.");
  30.                         return(false);
  31.                         }
  32.                     for (var x=0; x<theList.length; x++)    {
  33.                         var file = parent.parent.globals.getConfigFolder(self) + theList[x];
  34.                         var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
  35.     
  36.                         if (name == document.forms[0].regServerList.options[document.forms[0].regServerList.selectedIndex].text)    {
  37.                             parent.parent.globals.document.vars.regServer.value = theList[x];
  38.                             break;
  39.                             }
  40.                         }
  41.                     if (parent.parent.globals.document.vars.regServer.value == "")    {
  42.                         alert("Internal problem locating appropriate registration server file.");
  43.                         return(false);
  44.                         }
  45.                     }
  46.                 else if (theList.length==1)    {
  47.                     parent.parent.globals.document.vars.regServer.value = theList[0];
  48.                     }
  49.                 else    {
  50.                     alert("Internal problem locating a registration server file.");
  51.                     return(false);
  52.                     }
  53.                 }
  54.             else    {
  55.                 alert("Internal problem locating appropriate registration server file.");
  56.                 return(false);
  57.                 }
  58.             }
  59.         return(true);
  60.         }
  61.     else    {
  62.         return(false);
  63.         }
  64. }
  65.  
  66.  
  67.  
  68. function checkData()
  69. {
  70.     return(true);
  71. }
  72.  
  73.  
  74.  
  75. function loadData()
  76. {
  77.     if (parent.controls.generateControls)    parent.controls.generateControls();
  78. }
  79.  
  80.  
  81.  
  82. function saveData()
  83. {
  84. }
  85.  
  86.  
  87.  
  88. function generateRegServerList()
  89. {
  90.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  91.  
  92.     // if RegServer is not specified in ACCTSET.INI and multiple .IAS files exist, build list
  93.  
  94.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  95.     var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
  96.     
  97.     if (theRegFile == null || theRegFile == "")    {
  98.         var pathName = parent.parent.globals.getConfigFolder(self);
  99.         var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
  100.         if (theList != null)    {
  101.             if (theList.length >1)    {
  102.                 document.writeln("<TABLE CELLPADDING=2 CELLSPACING=0 ID='minspace'><TR><TD ALIGN=LEFT VALIGN=TOP HEIGHT=25><spacer type=vertical size=2><B>Select an Internet account server:</B></TD><TD ALIGN=LEFT VALIGN=TOP><FORM><SELECT NAME='regServerList'>");
  103.                 for (var x=0; x<theList.length; x++)    {
  104.                     var file = parent.parent.globals.getConfigFolder(self) + theList[x];
  105.                     var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
  106.                     var selected=(x==0) ? " SELECTED":"";
  107.                     document.writeln("<OPTION VALUE='" + name + "'" + selected + ">" + name);
  108.                     }
  109.                 document.writeln("</SELECT></FORM></TD></TR></TABLE>");
  110.                 }
  111.             }
  112.         }
  113. }
  114.  
  115.  
  116.  
  117. // end hiding contents from old browsers  -->
  118.