home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / globals1.js < prev    next >
Text File  |  1998-10-15  |  29KB  |  705 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. <!--  to hide script contents from old browsers
  19.  
  20. compromisePrincipals();
  21. enableExternalCapture();                                                 // This requires UniversalBrowserWrite access
  22. parent.captureEvents( Event.MOUSEDOWN | Event.MOUSEUP | Event.DRAGDROP | Event.DBLCLICK );
  23. parent.onmousedown = cancelEvent;
  24. parent.onmouseup = cancelEvent;
  25. parent.ondragdrop = cancelEvent;
  26. parent.ondblclick = cancelEvent;
  27.  
  28. var oneStepSemaphore = false;
  29. var selectedISP = null;
  30. var supportWindow = null;
  31. var currentProfileDirectory = null;
  32.  
  33. function getSelectedISPName()
  34. {
  35.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  36.  
  37.     var        ispDisplayName = document.setupPlugin.GetISPDisplayName( selectedISP );                
  38.     
  39.     return ispDisplayName;
  40. }
  41.  
  42. function forceReboot(pageName)
  43. {
  44.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  45.     debug( "go: Reboot needed before move to page " + pageName );
  46.     alert( "A reboot is needed. Account Setup will continue after the reboot." );
  47.     navigator.preference( "mail.check_new_mail", false );
  48.     document.vars.startupFile.value = pageName;
  49.     saveGlobalData();
  50.  
  51.     // if rebooting and using magic profile, rename it so that it won't be automatically deleted at next launch
  52.     var profileName = parent.parent.globals.document.setupPlugin.GetCurrentProfileName();
  53.     if ( profileName != null && profileName != "" )
  54.     {
  55.         profileName = profileName.toUpperCase();
  56.         if ( profileName == '911' || profileName == 'USER1' )
  57.             parent.parent.globals.document.setupPlugin.SetCurrentProfileName( "912" );
  58.     }
  59.  
  60.     parent.parent.globals.document.setupPlugin.Reboot( getFolder( self ) + "start.htm" );
  61. }
  62.  
  63. function findVariable( theVar )
  64. {
  65.     var theValue = "";
  66.     var regData = parent.parent.globals.document.vars.regData.value;
  67.     var x = regData.indexOf( theVar + "=" );
  68.     if ( x >= 0 )
  69.     {
  70.         x = x + theVar.length + 1;
  71.         var y = regData.indexOf( "\r", x );
  72.         if ( y > x )
  73.         {
  74.             theValue = regData.substring( x, y );
  75.             debug( "findVariable: " + theVar + "=" + theValue );
  76.         }
  77.     }
  78.     return theValue;
  79. }
  80.  
  81. //    contentFile = "main.htm";
  82. function getContentPage()
  83. {
  84. //    var file = contentFile;
  85. //    contentFile = null;
  86.     var file = parent.parent.globals.document.vars.startupFile.value;
  87.     parent.parent.globals.document.vars.startupFile.value = "";
  88.     return file;
  89. }
  90.  
  91. function setContentPage( file )
  92. {
  93. //    contentFile = file;
  94.     parent.parent.globals.document.vars.startupFile.value = file;
  95. }
  96.  
  97.  
  98. function loadUserInput()
  99. {
  100.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  101.  
  102.     if (document.vars.inited.value != "yes")    {
  103.         document.vars.inited.value = "yes";
  104.  
  105.         var cookieWarning = navigator.preference("network.cookie.warnAboutCookies");
  106.         if (cookieWarning == true)    {
  107.             document.vars.cookieWarning.value = "yes";
  108.             }
  109.         else    {
  110.             document.vars.cookieWarning.value = "no";
  111.             }
  112.         navigator.preference("network.cookie.warnAboutCookies", false);
  113.  
  114.         document.vars.offlineMode.value = navigator.preference("offline.startup_mode");
  115.         navigator.preference("offline.startup_mode", 0);        // online
  116.         navigator.preference("network.online", true);
  117.  
  118.         var acctSetupFile = getAcctSetupFilename(self);
  119.         if (acctSetupFile != null && acctSetupFile != "")    {
  120.             var intlMode = parent.parent.globals.GetNameValuePair(acctSetupFile,"Mode Selection","IntlMode");
  121.             if (intlMode != null && intlMode != "")    {
  122.                 intlMode = intlMode.toLowerCase();
  123.                 }
  124.             }
  125.     
  126.         userInputFile = currentProfileDirectory;
  127.         if (userInputFile != null && userInputFile != "")    {
  128.             userInputFile = userInputFile + "ACCTSET.DAT";
  129.             var theSection="Account Setup User Input";
  130.         
  131.             var regServer = GetNameValuePair(userInputFile,theSection,"regServer");
  132.             if (regServer != null && regServer != "")    {
  133.                 document.vars.regServer.value = regServer;
  134.                 SetNameValuePair(userInputFile,theSection,"regServer", "");
  135.                 }
  136.             document.vars.first.value = GetNameValuePair(userInputFile,theSection,"first");
  137.             document.vars.last.value = GetNameValuePair(userInputFile,theSection,"last");
  138.             document.vars.company.value = GetNameValuePair(userInputFile,theSection,"company");
  139.             document.vars.address1.value = GetNameValuePair(userInputFile,theSection,"address1");
  140.             document.vars.address2.value = GetNameValuePair(userInputFile,theSection,"address2");
  141.             if (intlMode=="yes")    {
  142.                 document.vars.address3.value = GetNameValuePair(userInputFile,theSection,"address3");
  143.                 document.vars.city.value="";
  144.                 document.vars.state.value="";
  145.                 document.vars.zip.value="";
  146.                 document.vars.areaCode.value="";
  147.                 }
  148.             else    {
  149.                 document.vars.address3.value="";
  150.                 document.vars.city.value = GetNameValuePair(userInputFile,theSection,"city");
  151.                 document.vars.state.value = GetNameValuePair(userInputFile,theSection,"state");
  152.                 document.vars.zip.value = GetNameValuePair(userInputFile,theSection,"zip");
  153.                 document.vars.areaCode.value = GetNameValuePair(userInputFile,theSection,"areaCode");
  154.                 }
  155.             document.vars.phoneNumber.value = GetNameValuePair(userInputFile,theSection,"phoneNumber");
  156.             document.vars.country.value = GetNameValuePair(userInputFile,theSection,"country");
  157.             document.vars.countryCode.value = GetNameValuePair(userInputFile,theSection,"countryCode");
  158.                 
  159.             document.vars.cardname.value = GetNameValuePair(userInputFile,theSection,"cardname");
  160.             document.vars.cardtype.value = GetNameValuePair(userInputFile,theSection,"cardtype");
  161.             document.vars.cardcode.value = GetNameValuePair(userInputFile,theSection,"cardcode");
  162.             document.vars.cardnumber.value = GetNameValuePair(userInputFile,theSection,"cardnumber");
  163.             SetNameValuePair(userInputFile,theSection,"cardnumber", "");
  164.     
  165.             document.vars.month.value = GetNameValuePair(userInputFile,theSection,"month");
  166.             document.vars.year.value = GetNameValuePair(userInputFile,theSection,"year");
  167.     
  168.             document.vars.modem.value = GetNameValuePair(userInputFile,theSection,"modem");
  169.             document.vars.manufacturer.value = GetNameValuePair(userInputFile,theSection,"manufacturer");
  170.             document.vars.model.value = GetNameValuePair(userInputFile,theSection,"model");
  171.     
  172.     
  173.             document.vars.externalEditor.value = GetNameValuePair(userInputFile,theSection,"externalEditor");
  174.     
  175.     
  176.             if (intlMode=="yes")    {
  177.                 document.vars.modemAreaCode.value="";
  178.                 }
  179.             else    {
  180.                 document.vars.modemAreaCode.value = GetNameValuePair(userInputFile,theSection,"modemAreaCode");
  181.                 }
  182.             document.vars.modemPhoneNumber.value = GetNameValuePair(userInputFile,theSection,"modemPhoneNumber");
  183.             
  184.             document.vars.altAreaCode1.value = GetNameValuePair( userInputFile, theSection, "altAreaCode1" );
  185.             document.vars.altAreaCode2.value = GetNameValuePair( userInputFile, theSection, "altAreaCode2" );
  186.             document.vars.altAreaCode3.value = GetNameValuePair( userInputFile, theSection, "altAreaCode3" );
  187.             
  188.             document.vars.cwData.value = GetNameValuePair(userInputFile,theSection,"cwData");
  189.             if (document.vars.cwData.value != null && document.vars.cwData.value != "")
  190.             {
  191. //                document.vars.prefix.cwOFF=1;
  192.             }
  193.             else
  194.             {
  195. //                document.vars.prefix.cwOFF=0;
  196.             }
  197.             document.vars.prefixData.value = GetNameValuePair(userInputFile,theSection,"prefixData");
  198.             if (document.vars.prefixData.value != null && document.vars.prefixData.value != "")
  199.             {
  200. //                document.vars.prefix.checked=1;
  201.             }
  202.             else
  203.             {
  204. //                document.vars.prefix.checked=0;
  205.             }
  206.             document.vars.dialMethod.value = GetNameValuePair(userInputFile,theSection,"dialMethod");
  207.     
  208.             document.vars.providername.value = GetNameValuePair(userInputFile,theSection,"providername");
  209.             if (intlMode=="yes")
  210.             {
  211.                 document.vars.accountAreaCode.value="";
  212.             }
  213.             else
  214.             {
  215.                 document.vars.accountAreaCode.value = GetNameValuePair(userInputFile,theSection,"accountAreaCode");
  216.             }
  217.             document.vars.accountPhoneNumber.value = GetNameValuePair(userInputFile,theSection,"accountPhoneNumber");
  218.     
  219.             document.vars.accountName.value = GetNameValuePair(userInputFile,theSection,"accountName");
  220.             document.vars.emailName.value = GetNameValuePair(userInputFile,theSection,"emailName");
  221.             document.vars.publishURL.value = GetNameValuePair(userInputFile,theSection,"publishURL");
  222.             document.vars.viewURL.value = GetNameValuePair(userInputFile,theSection,"viewURL");
  223.  
  224.             document.vars.accountPassword.value = GetNameValuePair(userInputFile,theSection,"accountPassword");        // existing path
  225.             document.vars.accountPasswordCheck.value = GetNameValuePair(userInputFile,theSection,"accountPasswordCheck");
  226.             document.vars.emailPassword.value = GetNameValuePair(userInputFile,theSection,"emailPassword");
  227.             document.vars.emailPasswordCheck.value = GetNameValuePair(userInputFile,theSection,"emailPasswordCheck");
  228.             document.vars.publishPassword.value = GetNameValuePair(userInputFile,theSection,"publishPassword");
  229.             document.vars.publishPasswordCheck.value = GetNameValuePair(userInputFile,theSection,"publishPasswordCheck");
  230.             document.vars.SMTP.value = GetNameValuePair(userInputFile,theSection,"SMTP");
  231.             document.vars.mailServer.value = GetNameValuePair(userInputFile,theSection,"mailServer");
  232.             document.vars.mailProtocol.value = GetNameValuePair(userInputFile,theSection,"mailProtocol");
  233.             document.vars.NNTP.value = GetNameValuePair(userInputFile,theSection,"NNTP");
  234.             document.vars.domainName.value = GetNameValuePair(userInputFile,theSection,"domainName");
  235.             document.vars.primaryDNS.value = GetNameValuePair(userInputFile,theSection,"primaryDNS");
  236.             document.vars.secondaryDNS.value = GetNameValuePair(userInputFile,theSection,"secondaryDNS");
  237.             document.vars.ipAddress.value = GetNameValuePair(userInputFile,theSection,"ipAddress");
  238.             document.vars.scriptEnabled.value = GetNameValuePair(userInputFile,theSection,"scriptEnabled");
  239.             document.vars.scriptFile.value = GetNameValuePair(userInputFile,theSection,"scriptFile");
  240.             document.vars.lckFilename.value = GetNameValuePair(userInputFile,theSection,"lckFilename");
  241.  
  242.             SetNameValuePair(userInputFile,theSection,"accountPassword", "");                                        // existing path
  243.             SetNameValuePair(userInputFile,theSection,"accountPasswordCheck", "");
  244.             SetNameValuePair(userInputFile,theSection,"emailPassword", "");
  245.             SetNameValuePair(userInputFile,theSection,"emailPasswordCheck", "");
  246.             SetNameValuePair(userInputFile,theSection,"publishPassword", "");
  247.             SetNameValuePair(userInputFile,theSection,"publishPasswordCheck", "");
  248.             }
  249.         }
  250. }
  251.  
  252.  
  253.  
  254. /*
  255.     loadGlobalData:        checks for the plugin; reads in any saved user input from a previous session
  256. */
  257.  
  258. function loadGlobalData()
  259. {
  260.     if (document.vars.debugMode.value.toLowerCase() != "yes")
  261.     {
  262.         debug ("debugMode Flag is OFF");
  263.     }
  264.     else
  265.     {
  266.         debug ("debugMode Flag is ON");
  267.         top.debugFlag = true;
  268.     }
  269.  
  270.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  271.  
  272.     if ( document.setupPlugin == null )
  273.         return;
  274.  
  275.     if ( document.vars.inited.value != "yes" )
  276.     {
  277.  
  278.         // load globals here
  279.     
  280.         var acctSetupFile = getAcctSetupFilename( self );
  281.         if ( acctSetupFile != null && acctSetupFile != "" )
  282.         {
  283.             var intlMode = parent.parent.globals.GetNameValuePair( acctSetupFile, "Mode Selection", "IntlMode" );
  284.             if ( intlMode != null && intlMode != "" )
  285.             {
  286.                 intlMode = intlMode.toLowerCase();
  287.                 document.vars.intlMode.value = intlMode;
  288.             }
  289.             
  290.             var editMode = parent.parent.globals.GetNameValuePair( acctSetupFile, "Mode Selection", "EditMode" );
  291.             if ( editMode != null && editMode != "" )
  292.             {
  293.                 editMode = editMode.toLowerCase();
  294.                 document.vars.editMode.value = editMode;
  295.                 SetNameValuePair( acctSetupFile, "Mode Selection", "EditMode", "no" );
  296.             }
  297.  
  298.             // if not in editMode, ensure that OS support is available (networking,dialer,etc)
  299.             if ( editMode != "yes" )
  300.             {
  301.                 var installedFlag = document.setupPlugin.CheckEnvironment();
  302.                 if ( installedFlag != true )
  303.                 {
  304.                     document.setupPlugin.QuitNavigator();
  305.                     return;
  306.                 }
  307.             }
  308.  
  309.             // set appropriate path info (if not prompting user)
  310.     
  311.             document.vars.path.value = "";
  312.             var newPathFlag = parent.parent.globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceNew" );
  313.             newPathFlag = newPathFlag.toLowerCase();
  314.             var existingPathFlag = parent.parent.globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceExisting" );
  315.             existingPathFlag = existingPathFlag.toLowerCase();
  316.     
  317.             if ( newPathFlag == "yes" && existingPathFlag != "yes" )
  318.                 document.vars.path.value = "New Path";
  319.             else if ( existingPathFlag == "yes" && newPathFlag != "yes" )
  320.                 document.vars.path.value = "Existing Path";
  321.  
  322.             // debug("***PATH VALUE = " + document.vars.path.value);
  323.  
  324.             document.vars.oneStepMode.value = "";
  325.             var oneStepModeFlag = parent.parent.globals.GetNameValuePair( acctSetupFile, "Mode Selection", "OneStepMode" );
  326.             oneStepModeFlag = oneStepModeFlag.toLowerCase();
  327.             if ( oneStepModeFlag == "yes" )
  328.                 document.vars.oneStepMode.value = "yes";
  329.                         
  330.             if ( document.vars.debugMode.value.toLowerCase() != "yes" && ( document.vars.editMode.value.toLowerCase() != "yes" ) )
  331.                 if (checkPluginExists( "application/x-netscape-autoconfigure-dialer", false ) )
  332.                     document.setupPlugin.SetKiosk( true );
  333.         }
  334.         
  335.         
  336.         // load in user input (if any)
  337.         currentProfileDirectory = document.setupPlugin.GetCurrentProfileDirectory();
  338.         var userInputFile = currentProfileDirectory;
  339.         if ( userInputFile != null && userInputFile != "" )
  340.         {
  341.  
  342.             userInputFile = userInputFile + "ACCTSET.DAT";
  343.             var theSection = "Account Setup User Input";
  344.     
  345.             document.vars.externalEditor.value = GetNameValuePair( userInputFile, theSection, "externalEditor" );
  346.  
  347.             var startupFile = GetNameValuePair( userInputFile, theSection, "startupFile" );
  348.             if ( startupFile != null && startupFile != "" )
  349.             {
  350.                 document.vars.startupFile.value = startupFile;
  351.                 document.vars.path.value = GetNameValuePair( userInputFile, theSection, "path" );
  352.                 document.vars.pageHistory.value = GetNameValuePair( userInputFile, theSection, "pageHistory" );
  353.  
  354.                 SetNameValuePair( userInputFile, theSection, "startupFile", "" );
  355.                 SetNameValuePair( userInputFile, theSection, "path", "" );
  356.                 SetNameValuePair( userInputFile, theSection, "pageHistory", "" );
  357.  
  358.                 // if coming out of a reboot and using magic profile, rename it so that it won't be automatically deleted at next launch
  359.             
  360.                 var profileName = document.setupPlugin.GetCurrentProfileName();
  361.                 if ( profileName != null && profileName != "" )
  362.                 {
  363.                     profileName = profileName.toUpperCase();
  364.                     if ( profileName == '912' )
  365.                         document.setupPlugin.SetCurrentProfileName( "USER1" );
  366.                 }
  367.                 loadUserInput();
  368.             }
  369.             else
  370.             {
  371.                 document.vars.startupFile.value = "main.htm";
  372.                 // defer loading user input until after main screen has loaded (faster speedup)
  373.             }
  374.             parent.screen.location.replace( "screen.htm" );
  375.         }
  376.  
  377.         // QA support
  378.  
  379.         var qaMode = document.vars.qaMode.value;
  380.         if ( qaMode != null && qaMode != "" )
  381.         {
  382.             qaMode = qaMode.toLowerCase();
  383.             if ( qaMode == "yes" )
  384.             {
  385.                 if ( confirm( "Would you like to use a Milan data file to configure Communicator?" ) == true )
  386.                 {
  387.                     if ( document.setupPlugin.Milan( null, null, true, false ) == true )
  388.                         document.vars.regMode.value = "yes";
  389.                 }
  390.             }
  391.         }
  392.     }
  393.     
  394.     if ( document.vars.regMode.value == "yes" )
  395.         setRegisterMode( 1 );
  396. }
  397.  
  398. function saveExternalEditor()
  399. {
  400.     // Since we don't do a saveGlobalData in editMode, we need an alternate way to save the externalEditor
  401.     // as a preference in ACCTSET.DAT.  This is it.
  402.     
  403.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  404.     var userInputFile = currentProfileDirectory;
  405.     if ( userInputFile != null && userInputFile != "" )
  406.     {
  407.         userInputFile = userInputFile + "ACCTSET.DAT";
  408.         var theSection = "Account Setup User Input";
  409.         SetNameValuePair( userInputFile, theSection, "externalEditor", document.vars.externalEditor.value );
  410.     }
  411. }
  412.  
  413. function saveGlobalData()
  414. {
  415.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  416.  
  417.     if ( document.vars.editMode.value.toLowerCase() == "yes" )
  418.         return;
  419.  
  420.     if ( document.setupPlugin == null )
  421.         return;
  422. /*
  423.     if (document.vars.debugMode.value.toLowerCase() != "yes" && (document.vars.editMode.value.toLowerCase() != "yes"))    {
  424.         if (checkPluginExists("application/x-netscape-autoconfigure-dialer",false))    {
  425.             document.setupPlugin.SetKiosk(false);
  426.             }
  427.         }
  428.     top.statusbar.visible=true;
  429.     top.scrollbars.visible=true;
  430.     top.toolbar.visible=true;
  431.     top.menubar.visible=true;
  432.     top.locationbar.visible=true;
  433.     top.personalbar.visible=true;                // was directory
  434. */
  435.         
  436.     if (document.vars.cookieWarning.value == "yes")
  437.     {
  438.         navigator.preference("network.cookie.warnAboutCookies", true);
  439.     }
  440.     else
  441.     {
  442.         navigator.preference("network.cookie.warnAboutCookies", false);
  443.     }
  444.  
  445.     if (document.vars.offlineMode.value != "undefined")
  446.     {
  447.         navigator.preference("offline.startup_mode", document.vars.offlineMode.value);
  448.     }
  449.  
  450.  
  451.     // save user input (if any)
  452.     var userInputFile = currentProfileDirectory;
  453.     if (userInputFile != null && userInputFile != "")
  454.     {
  455.         userInputFile = userInputFile + "ACCTSET.DAT";
  456.         var theSection="Account Setup User Input";
  457.     
  458.         SetNameValuePair(userInputFile,theSection,"startupFile", document.vars.startupFile.value);
  459.         SetNameValuePair(userInputFile,theSection,"regServer", document.vars.regServer.value);
  460.  
  461.         SetNameValuePair(userInputFile,theSection,"first", document.vars.first.value);
  462.         SetNameValuePair(userInputFile,theSection,"last", document.vars.last.value);
  463.         SetNameValuePair(userInputFile,theSection,"company", document.vars.company.value);
  464.         SetNameValuePair(userInputFile,theSection,"address1", document.vars.address1.value);
  465.         SetNameValuePair(userInputFile,theSection,"address2", document.vars.address2.value);
  466.         SetNameValuePair(userInputFile,theSection,"address3", document.vars.address3.value);
  467.         SetNameValuePair(userInputFile,theSection,"city", document.vars.city.value);
  468.         SetNameValuePair(userInputFile,theSection,"state", document.vars.state.value);
  469.         SetNameValuePair(userInputFile,theSection,"zip", document.vars.zip.value);
  470.         SetNameValuePair(userInputFile,theSection,"areaCode", document.vars.areaCode.value);
  471.         SetNameValuePair(userInputFile,theSection,"phoneNumber", document.vars.phoneNumber.value);
  472.         SetNameValuePair(userInputFile,theSection,"country", document.vars.country.value);
  473.         SetNameValuePair(userInputFile,theSection,"countryCode", document.vars.countryCode.value);
  474.         
  475.         SetNameValuePair(userInputFile,theSection,"cardname", document.vars.cardname.value);
  476.         SetNameValuePair(userInputFile,theSection,"cardtype", document.vars.cardtype.value);
  477.         SetNameValuePair(userInputFile,theSection,"cardcode", document.vars.cardcode.value);
  478.         if (document.setupPlugin.NeedReboot() == true)    {
  479.             SetNameValuePair(userInputFile,theSection,"cardnumber", document.vars.cardnumber.value);
  480.             SetNameValuePair(userInputFile,theSection,"path", document.vars.path.value);
  481.             SetNameValuePair(userInputFile,theSection,"pageHistory", document.vars.pageHistory.value);
  482.  
  483.             SetNameValuePair(userInputFile,theSection,"accountPassword", document.vars.accountPassword.value);        // existing path
  484.             SetNameValuePair(userInputFile,theSection,"accountPasswordCheck", document.vars.accountPasswordCheck.value);
  485.             SetNameValuePair(userInputFile,theSection,"emailPassword", document.vars.emailPassword.value);
  486.             SetNameValuePair(userInputFile,theSection,"emailPasswordCheck", document.vars.emailPasswordCheck.value);
  487.             SetNameValuePair(userInputFile,theSection,"publishPassword", document.vars.publishPassword.value);
  488.             SetNameValuePair(userInputFile,theSection,"publishPasswordCheck", document.vars.publishPasswordCheck.value);
  489.             SetNameValuePair(userInputFile,theSection,"SMTP", document.vars.SMTP.value);
  490.             SetNameValuePair(userInputFile,theSection,"mailServer", document.vars.mailServer.value);
  491.             SetNameValuePair(userInputFile,theSection,"mailProtocol", document.vars.mailProtocol.value);
  492.             SetNameValuePair(userInputFile,theSection,"NNTP", document.vars.NNTP.value);
  493.             SetNameValuePair(userInputFile,theSection,"domainName", document.vars.domainName.value);
  494.             SetNameValuePair(userInputFile,theSection,"primaryDNS", document.vars.primaryDNS.value);
  495.             SetNameValuePair(userInputFile,theSection,"secondaryDNS", document.vars.secondaryDNS.value);
  496.             SetNameValuePair(userInputFile,theSection,"ipAddress", document.vars.ipAddress.value);
  497.             SetNameValuePair(userInputFile,theSection,"scriptEnabled", document.vars.scriptEnabled.value);
  498.             SetNameValuePair(userInputFile,theSection,"scriptFile", document.vars.scriptFile.value);
  499.             SetNameValuePair(userInputFile,theSection,"lckFilename", document.vars.lckFilename.value);
  500.         }
  501.         else
  502.         {
  503.             SetNameValuePair(userInputFile,theSection,"cardnumber", "");
  504.             SetNameValuePair(userInputFile,theSection,"path", "");
  505.             SetNameValuePair(userInputFile,theSection,"pageHistory", "");
  506.  
  507.             SetNameValuePair(userInputFile,theSection,"accountPassword", "");                                        // existing path
  508.             SetNameValuePair(userInputFile,theSection,"accountPasswordCheck", "");
  509.             SetNameValuePair(userInputFile,theSection,"emailPassword", "");
  510.             SetNameValuePair(userInputFile,theSection,"emailPasswordCheck", "");
  511.             SetNameValuePair(userInputFile,theSection,"publishPassword", "");
  512.             SetNameValuePair(userInputFile,theSection,"publishPasswordCheck", "");
  513.         }
  514.         SetNameValuePair(userInputFile,theSection,"month", document.vars.month.value);
  515.         SetNameValuePair(userInputFile,theSection,"year", document.vars.year.value);
  516.  
  517.         SetNameValuePair(userInputFile,theSection,"modem", document.vars.modem.value);
  518.         SetNameValuePair(userInputFile,theSection,"manufacturer", document.vars.manufacturer.value);
  519.         SetNameValuePair(userInputFile,theSection,"model", document.vars.model.value);
  520.  
  521.         SetNameValuePair(userInputFile,theSection,"modemAreaCode", document.vars.modemAreaCode.value);
  522.         SetNameValuePair(userInputFile,theSection,"modemPhoneNumber", document.vars.modemPhoneNumber.value);
  523.         SetNameValuePair(userInputFile,theSection,"altAreaCode1", document.vars.altAreaCode1.value);
  524.         SetNameValuePair(userInputFile,theSection,"altAreaCode2", document.vars.altAreaCode2.value);
  525.         SetNameValuePair(userInputFile,theSection,"altAreaCode3", document.vars.altAreaCode3.value);
  526.  
  527.         SetNameValuePair(userInputFile,theSection,"cwData", document.vars.cwData.value);
  528.         SetNameValuePair(userInputFile,theSection,"prefixData", document.vars.prefixData.value);
  529.         SetNameValuePair(userInputFile,theSection,"dialMethod", document.vars.dialMethod.value);
  530.  
  531.         SetNameValuePair(userInputFile,theSection,"providername", document.vars.providername.value);
  532.         SetNameValuePair(userInputFile,theSection,"providerFilename", document.vars.providerFilename.value);        // existing path
  533.         SetNameValuePair(userInputFile,theSection,"accountAreaCode", document.vars.accountAreaCode.value);
  534.         SetNameValuePair(userInputFile,theSection,"accountPhoneNumber", document.vars.accountPhoneNumber.value);
  535.  
  536.         SetNameValuePair(userInputFile,theSection,"accountName", document.vars.accountName.value);
  537.         SetNameValuePair(userInputFile,theSection,"emailName", document.vars.emailName.value);
  538.         SetNameValuePair(userInputFile,theSection,"publishURL", document.vars.publishURL.value);
  539.         SetNameValuePair(userInputFile,theSection,"viewURL", document.vars.viewURL.value);
  540.         SetNameValuePair(userInputFile,theSection,"externalEditor", document.vars.externalEditor.value);
  541.         }
  542. }
  543.  
  544. /*
  545. function monitorDialupConnection( numSecondsElapsed, monitorFunction,
  546.     monitorEndpointSuccessFunction, monitorEndpointFailureFunction )
  547. {
  548.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  549.  
  550.     var        connectStatusFlag = document.setupPlugin.IsDialerConnected();
  551.     
  552.     // * give us 10 seconds to before we start to check the connection status
  553.     if ( ( numSecondsElapsed < 10 ) || ( connectStatusFlag == true ) )
  554.     {
  555.         numSecondsElapsed = numSecondsElapsed + 1;
  556.         
  557.         if ( eval ( monitorFunction ) == null )
  558.             setTimeout( "setRegisterMode(" + numSecondsElapsed + ")", 1000 );
  559.         else
  560.             eval( monitorEndpointSuccessFunction );
  561.     }
  562.     else
  563.     {
  564.         // hang up (even if already disconnected, this will delete
  565.         // the dialer's reference to the Registration Server)
  566.         document.setupPlugin.DialerHangup();
  567.         eval( monitorEndpointFailureFunction );
  568.     }
  569. }
  570. */
  571.  
  572. function set1StepMode( numSecondsElapsed )
  573. {
  574.     
  575.     debug( "set1StepMode: " + numSecondsElapsed );
  576.     
  577.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  578.  
  579.     var            connectStatusFlag = document.setupPlugin.IsDialerConnected();
  580.  
  581.     if ( ( numSecondsElapsed < 10 ) || ( connectStatusFlag == true ) )
  582.     {
  583.         //debug( "still connected" );
  584.         numSecondsElapsed = numSecondsElapsed + 1;
  585.  
  586.         if ( oneStepSemaphore == false )
  587.         {
  588.             setTimeout( "set1StepMode(" + numSecondsElapsed + ")", 1000 );
  589.         }
  590.         else
  591.         {
  592.             oneStepSemphore = false;
  593.         }
  594.     }
  595.     else
  596.     {
  597.         document.setupPlugin.DialerHangup();
  598.  
  599.         // go to error screen
  600.         setContentPage( "error.htm" );
  601.         parent.screen.location.replace( "screen.htm" );
  602.     }
  603. }
  604.             
  605.         
  606.         
  607. function setRegisterMode( numSecondsElapsed )
  608. {
  609.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  610.  
  611.     var            connectStatusFlag = document.setupPlugin.IsDialerConnected();
  612.     document.vars.regMode.value = "yes";
  613.     var            regData = document.setupPlugin.GetRegInfo( false );
  614.  
  615.     if ( ( numSecondsElapsed < 10 ) || ( connectStatusFlag == true ) )
  616.     {
  617.         numSecondsElapsed = numSecondsElapsed + 1;
  618.  
  619.         if ( regData == null )
  620.             setTimeout( "setRegisterMode(" + numSecondsElapsed + ")", 1000 );    // check every second
  621.         else
  622.         {
  623.             // handle multi-line data differently
  624.  
  625.             var bookmarkTag = "BOOKMARK_FILE=";
  626.             var bookmarkTagLen = bookmarkTag.length;
  627.  
  628.             document.vars.regMode.value = "no";
  629.             document.vars.regData.value = "";
  630.             debug( "\nRegistration Complete: " + regData.length + " item(s)" );
  631.             
  632.             for ( var x = 0; x < regData.length; x++ )
  633.             {
  634.                 var data = "" + regData[ x ];
  635.                 var dataLen = data.length;
  636.  
  637.                 if ( data.indexOf( bookmarkTag ) ==0 )
  638.                 {
  639.                     data = data.substring( bookmarkTagLen, dataLen );
  640.                     document.vars.regBookmark.value = data;
  641.                 }
  642.                 else
  643.                     document.vars.regData.value = document.vars.regData.value + regData[ x ] + "\r";
  644.  
  645.                 debug( "        " + x + ": " + regData[ x ] );
  646.             }
  647.             
  648.             document.setupPlugin.GetRegInfo( true );
  649.  
  650.             // hang up (this will delete the dialer's
  651.             // reference to the Registration Server)
  652.             document.setupPlugin.DialerHangup();
  653.  
  654.             // check status and go to appropriate screen
  655.  
  656.             var status = findVariable( "STATUS" );
  657.             if ( status == "OK" )
  658.             {
  659.                 configureNewAccount();
  660.  
  661.                 var rebootFlag = document.setupPlugin.NeedReboot();
  662.                 if ( rebootFlag == true )
  663.                     setContentPage( "okreboot.htm" );
  664.                 else
  665.                     setContentPage( "ok.htm" );
  666.  
  667.             }
  668.             else if ( status == "EXIT" )
  669.             {
  670.                 saveGlobalData();
  671.                 document.setupPlugin.QuitNavigator();
  672.             }
  673.             else
  674.                 setContentPage( "error.htm" );
  675.                 
  676.             parent.frames[ 0 ].location.replace( "screen.htm" );
  677.  
  678.             navigator.preference( "security.warn_submit_insecure", true );
  679.             navigator.preference( "security.warn_entering_secure", true );
  680.             navigator.preference( "security.warn_leaving_secure", true );
  681.         }
  682.     }
  683.  
  684.     // * we've lost the connection
  685.     else
  686.     {
  687.         document.vars.regMode.value = "no";
  688.  
  689.         // hang up (even if already disconnected, this will delete
  690.         // the dialer's reference to the Registration Server)
  691.         document.setupPlugin.DialerHangup();
  692.  
  693.         // go to error screen
  694.         document.setupPlugin.GetRegInfo( true );
  695.         setContentPage( "error.htm" );
  696.         parent.screen.location.replace( "screen.htm" );
  697.  
  698.         navigator.preference( "security.warn_submit_insecure", true );
  699.         navigator.preference( "security.warn_entering_secure", true );
  700.         navigator.preference( "security.warn_leaving_secure", true );
  701.     }
  702. }
  703.  
  704. // end hiding contents from old browsers  -->
  705.