home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / clayer1.js < prev    next >
Text File  |  1998-10-15  |  31KB  |  969 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.  
  21.  
  22. compromisePrincipals();
  23.  
  24.  
  25. function page( file, section, variable )
  26. {
  27.     this.type = "INFO";
  28.     this.file = file;
  29.     this.section = section;
  30.     this.variable = variable;
  31.  
  32.     this.fullhistory = false;
  33.     this.top = false;
  34. }
  35.  
  36. // the following three functions make sense if you go look at the "Next" clause in the function
  37. // "go" below
  38.  
  39. // * a "condition" is read from the Account Setup init file (typically "Config\ACCTSET.INI"),
  40. // from the section "[section]" and the given variable name, and if the given "value" matches,
  41. // the "file" gets loaded
  42. function condition( file, section, variable, value )
  43. {
  44.     this.type = "CONDITION";
  45.     this.file = file;
  46.     this.section = section;
  47.     this.variable = variable;
  48.     this.value = value;
  49. }
  50.  
  51. // * a "method" is given in "method" (a JavaScript method), and if when evaluated, it's value
  52. // is "value", the given "file" gets loaded
  53. function method( file, method, value )
  54. {
  55.     this.type = "METHOD";
  56.     this.file = file;
  57.     this.method = method;
  58.     this.value = value;
  59. }
  60.  
  61. // * an "action" simply loads the given "file"
  62. function action( file )
  63. {
  64.     this.type = "ACTION";
  65.     this.file = file;
  66. }
  67.  
  68. function checkEditMode()
  69. {
  70.     if ( parent.parent && parent.parent.globals && parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes" )
  71.         return true;
  72.     else
  73.         return false;
  74. }
  75.  
  76.  
  77.  
  78. pages = new Array();
  79.  
  80. pages[ 0 ] = new Array();
  81. pages[ 0 ][ 0 ] = new page( "main.htm",null,null);
  82. pages[ 0 ][ 1 ] = new method( "ipreview/inpvw1.htm", "parent.content.go( 'Internet Preview' )", true );
  83. pages[ 0 ][ 2 ] = new method( "preview/duepvw1.htm", "parent.content.go( 'Preview' )", true );
  84. pages[ 0 ][ 3 ] = new method( "intro/intro1.htm", "parent.controls.checkShowIntroFlag( '' )", true );
  85. //pages[0][4]=new condition("intro/intro1.htm","Mode Selection","Show_Intro_Screens","yes");
  86. //pages[0][5]=new condition("needs1.htm","Mode Selection","ForceNew","yes");
  87. //pages[0][6]=new condition("useAcct.htm","Mode Selection","ForceExisting","yes");
  88. //pages[0][7]=new action("accounts.htm");
  89.  
  90. pages[ 1 ] = new Array();
  91. pages[ 1 ][ 0 ] = new page( "accounts.htm", null, null);
  92. pages[ 1 ][ 1 ] = new method( "needs1.htm", "parent.content.go( 'New Path' )", true );
  93. pages[ 1 ][ 2 ] = new method( "useAcct.htm", "parent.content.go( 'Existing Path' )", true );
  94.  
  95. // New Account Path
  96.  
  97. pages[ 2 ] = new Array();
  98. pages[ 2 ][ 0 ] = new page( "needs1.htm", "New Acct Mode", "ShowNewPathInfo" );
  99. pages[ 2 ][ 1 ] = new condition( "newAcct.htm", "New Acct Mode", "ShowNewPathInfo", "no" );
  100. pages[ 2 ][ 2 ] = new method( "newAcct.htm", "parent.content.go('')", true );
  101.  
  102. pages[ 3 ] = new Array();
  103. pages[ 3 ][ 0 ] = new page( "newAcct.htm", "New Acct Mode", "AskPersonalInfo" );
  104. pages[ 3 ][ 1 ] = new condition( "billing.htm", "New Acct Mode", "AskPersonalInfo", "no" );
  105. pages[ 3 ][ 2 ] = new method( "billing.htm", "parent.content.go( '' )", true );
  106.  
  107. pages[ 4 ] = new Array();
  108. pages[ 4 ][ 0 ] = new page( "billing.htm", "New Acct Mode", "AskBillingInfo" );
  109. pages[ 4 ][ 1 ] = new condition( "modem1.htm", "New Acct Mode", "AskBillingInfo", "no" );
  110. pages[ 4 ][ 2 ] = new method( "modem1.htm", "parent.content.go( '' )", true );
  111.  
  112. pages[ 5 ] = new Array();
  113. pages[ 5 ][ 0 ] = new page( "modem1.htm", null, null );
  114. pages[ 5 ][ 1 ] = new method( "dialinf1.htm", "parent.content.go( '' )", true );
  115.  
  116. // 1step and 2 step modes functionally differ at this point. Defaults to 2 step mode.
  117. pages[ 6 ] = new Array();
  118. pages[ 6 ][ 0 ] = new page( "dialinf1.htm", null, null );
  119. pages[ 6 ][ 1 ] = new method( "dial2stp.htm", "parent.content.go( '2step' )", true );
  120. pages[ 6 ][ 2 ] = new method( "dial1stp.htm", "parent.content.go( '1step' )", true );
  121.  
  122. // Takes 2 step path.
  123. pages[ 60 ] = new Array();
  124. pages[ 60 ][ 0 ] = new page( "dial2stp.htm", null, null);
  125. pages[ 60 ][ 1 ] = new method( "download.htm", "parent.content.go( 'New Path' )", true );
  126. pages[ 60 ][ 2 ] = new method( "connect2.htm", "parent.content.go( 'Existing Path' )", true );
  127.  
  128. // Takes 1 step path.
  129. pages[ 7 ] = new Array();
  130. pages[ 7 ][ 0 ] = new page( "dial1stp.htm", null, null );
  131. pages[ 7 ][ 1 ] = new method( "connect1.htm", "parent.content.go( 'New Path' )", true );
  132. pages[ 7 ][ 2 ] = new method( "connect2.htm", "parent.content.go( 'Existing Path' )", true );
  133.  
  134. pages[ 53 ] = new Array();
  135. pages[ 53 ][ 0 ] = new page( "download.htm", null, null );
  136. pages[ 53 ][ 1 ] = new method( "1step.htm", "parent.content.go( '' )", true );
  137.  
  138. pages[ 54 ] = new Array();
  139. pages[ 54 ][ 0 ] = new page( "1step.htm", null, null );
  140.  
  141. pages[ 55 ] = new Array();
  142. pages[ 55 ][ 0 ] = new page( "compwrap.htm", null, null );
  143. pages[ 55 ][ 1 ] = new method( "moreinfo.htm", "parent.content.go( '' )", true );
  144.  
  145. pages[ 56 ] = new Array();
  146. pages[ 56 ][ 0 ] = new page( "moreinfo.htm", null, null );
  147. pages[ 56 ][ 1 ] = new method( "2step.htm", "parent.content.go( '' )", true );
  148.  
  149. pages[ 57 ] = new Array();
  150. pages[ 57 ][ 0 ] = new page( "2step.htm", null, null );
  151. pages[ 57 ][ 1 ] = new method( "reg2stp.htm", "parent.content.go( '' )", true );
  152.  
  153. pages[ 8 ] = new Array();
  154. pages[ 8 ][ 0 ] = new page( "connect1.htm", null, null );
  155. pages[ 8 ][ 1 ] = new method( "editfour.htm", "checkEditMode('')", true );
  156. pages[ 8 ][ 2 ] = new method( "reg1stp.htm", "parent.content.go('')", true );
  157.  
  158. pages[ 9 ] = new Array();
  159. pages[ 9 ][ 0 ] = new page( "reg1stp.htm", null, null );
  160.  
  161. pages[ 61 ] = new Array();
  162. pages[ 61 ][ 0 ] = new page( "reg2stp.htm", null, null );
  163.  
  164. // Existing Account Path
  165.  
  166. pages[10]=new Array();
  167. pages[10][0]=new page("useAcct.htm",null,null);
  168. pages[10][1]=new condition("needs2.htm","Mode Selection","ExistingSRFile","...");
  169. pages[10][2]=new method("needs2.htm","parent.content.go('')",true);
  170.  
  171. pages[11]=new Array();
  172. pages[11][0]=new page("needs2.htm","Existing Acct Mode","ShowExistingPathInfo");
  173. pages[11][1]=new condition("acctInfo.htm","Existing Acct Mode","ShowExistingPathInfo","no");
  174. pages[11][2]=new method("acctInfo.htm","parent.content.go('')",true);
  175.  
  176. pages[12]=new Array();
  177. pages[12][0]=new page("acctInfo.htm","Existing Acct Mode","AskName");
  178. pages[12][1]=new condition("dial.htm","Existing Acct Mode","AskName","no");
  179. pages[12][2]=new method("dial.htm","parent.content.go('')",true);
  180.  
  181. pages[13]=new Array();
  182. pages[13][0]=new page("dial.htm","Existing Acct Mode","AskPhone");
  183. pages[13][1]=new condition("namepw.htm","Existing Acct Mode","AskPhone","no");
  184. pages[13][2]=new method("namepw.htm","parent.content.go('')",true);
  185.  
  186. pages[14]=new Array();
  187. pages[14][0]=new page("namepw.htm","Existing Acct Mode","AskLogin");
  188. pages[14][1]=new condition("email.htm","Existing Acct Mode","AskLogin","no");
  189. pages[14][2]=new method("email.htm","parent.content.go('')",true);
  190.  
  191. pages[15]=new Array();
  192. pages[15][0]=new page("email.htm","Existing Acct Mode","AskEmail");
  193. pages[15][1]=new condition("servers.htm","Existing Acct Mode","AskEmail","no");
  194. pages[15][2]=new method("servers.htm","parent.content.go('')",true);
  195.  
  196. pages[16]=new Array();
  197. pages[16][0]=new page("servers.htm","Existing Acct Mode","AskHosts");
  198. pages[16][1]=new condition("dns.htm","Existing Acct Mode","AskHosts","no");
  199. pages[16][2]=new method("dns.htm","parent.content.go('')",true);
  200.  
  201. pages[17]=new Array();
  202. pages[17][0]=new page("dns.htm","Existing Acct Mode","AskDNS");
  203. pages[17][1]=new condition("publish.htm","Existing Acct Mode","AskDNS","no");
  204. pages[17][2]=new method("publish.htm","parent.content.go('')",true);
  205.  
  206. pages[18]=new Array();
  207. pages[18][0]=new page("publish.htm","Existing Acct Mode","AskPublishing");
  208. pages[18][1]=new condition("modem1.htm","Existing Acct Mode","AskPublishing","no");
  209. pages[18][2]=new method("modem1.htm","parent.content.go('')",true);
  210.  
  211. pages[19]=new Array();
  212. pages[19][0]=new page("connect2.htm",null,null);
  213. pages[19][1]=new method(null,"parent.content.go('Connect Now')",true);
  214. pages[19][2]=new method("error.htm","parent.content.go('error.htm')",true);
  215.  
  216. // Final Screens
  217.  
  218. pages[ 20 ] = new Array();
  219. pages[ 20 ][ 0 ] = new page( "ok.htm", null, null );
  220.  
  221. pages[ 21 ] = new Array();
  222. pages[ 21 ][ 0 ] = new page( "okreboot.htm", null, null );
  223.  
  224. pages[ 22 ] = new Array();
  225. pages[ 22 ][ 0 ] = new page( "error.htm", null, null );
  226. pages[ 22 ][ 1 ] = new method( "reg1stp.htm", "parent.content.go( '1step' )", true );
  227. pages[ 22 ][ 2 ] = new method( "reg2stp.htm", "parent.content.go( '2step' )", true );
  228. pages[ 22 ][ 3 ] = new method( "connect2.htm", "parent.content.go( 'Existing Path' )", true );
  229.  
  230. pages[ 23 ] = new Array();
  231. pages[ 23 ][ 0 ] = new page( "later.htm", null, null );
  232. pages[ 23 ][ 1 ] = new method( "later.htm", "parent.content.go( 'Done' )", true );
  233.  
  234. pages[ 59 ] = new Array();
  235. pages[ 59 ][ 0 ] = new page( "error2.htm", null, null );
  236. pages[ 59 ][ 1 ] = new method( "1step.htm", "parent.content.go( '' )", true );
  237.  
  238. // Settings
  239.  
  240. pages[24]=new Array();
  241. pages[24][0]=new page("settings.htm",null,null);
  242.  
  243. // About Box
  244.  
  245. pages[25]=new Array();
  246. pages[25][0]=new page("aboutbox.htm",null,null);
  247.  
  248. // Manage IAS Servers
  249.  
  250. pages[26]=new Array();
  251. pages[26][0]=new page("addias.htm",null,null);
  252.  
  253. // Manage NCI Servers
  254.  
  255. pages[27]=new Array();
  256. pages[27][0]=new page("addnci.htm",null,null);
  257.  
  258. // Dialup Edition Preview Screens
  259.  
  260. pages[28]=new Array();
  261. pages[28][0]=new page("preview/duepvw1.htm",null,null);
  262. //pages[28][0].fullhistory=true;
  263. pages[28][1]=new method("preview/duepvw2.htm","parent.content.go('')",true);
  264.  
  265. pages[29]=new Array();
  266. pages[29][0]=new page("preview/duepvw2.htm",null,null);
  267. pages[29][1]=new method("preview/duepvw3.htm","parent.content.go('')",true);
  268.  
  269. pages[30]=new Array();
  270. pages[30][0]=new page("preview/duepvw3.htm",null,null);
  271. pages[30][1]=new method("preview/duepvw4.htm","parent.content.go('')",true);
  272.  
  273. pages[31]=new Array();
  274. pages[31][0]=new page("preview/duepvw4.htm",null,null);
  275. pages[31][1]=new method("preview/duepvw5.htm","parent.content.go('')",true);
  276.  
  277. pages[32]=new Array();
  278. pages[32][0]=new page("preview/duepvw5.htm",null,null);
  279. pages[32][1]=new method("preview/duepvw7a.htm","parent.content.go('')",true);
  280.  
  281. //The following array is ignored as reference to Conference feature is removed
  282. pages[33]=new Array();
  283. pages[33][0]=new page("preview/duepvw6.htm",null,null);
  284. pages[33][1]=new method("preview/duepvw7.htm","parent.content.go('')",true);
  285.  
  286. //The following array is ignored as reference to Netcaster feature is removed
  287. pages[34]=new Array();
  288. pages[34][0]=new page("preview/duepvw7.htm",null,null);
  289. pages[34][1]=new method("preview/duepvw7a.htm","parent.content.go('')",true);
  290.  
  291. pages[35]=new Array();
  292. pages[35][0]=new page("preview/duepvw7a.htm",null,null);
  293. pages[35][1]=new method("preview/duepvw8.htm","parent.content.go('')",true);
  294.  
  295. pages[36]=new Array();
  296. pages[36][0]=new page("preview/duepvw8.htm",null,null);
  297. //pages[36][1]=new method("main.htm","parent.content.go('')",true);
  298. pages[36][1]=new action("main.htm");
  299.  
  300. // Internet Preview Screens
  301.  
  302. pages[37]=new Array();
  303. pages[37][0]=new page("ipreview/inpvw1.htm",null,null);
  304. //pages[37][0].fullhistory=true;
  305. pages[37][1]=new method("ipreview/inpvw2.htm","parent.content.go('')",true);
  306.  
  307. pages[38]=new Array();
  308. pages[38][0]=new page("ipreview/inpvw2.htm",null,null);
  309. pages[38][1]=new method("ipreview/inpvw3.htm","parent.content.go('')",true);
  310.  
  311. pages[39]=new Array();
  312. pages[39][0]=new page("ipreview/inpvw3.htm",null,null);
  313. pages[39][1]=new method("ipreview/inpvw4.htm","parent.content.go('')",true);
  314.  
  315. pages[40]=new Array();
  316. pages[40][0]=new page("ipreview/inpvw4.htm",null,null);
  317. pages[40][1]=new method("ipreview/inpvw5.htm","parent.content.go('')",true);
  318.  
  319. pages[41]=new Array();
  320. pages[41][0]=new page("ipreview/inpvw5.htm",null,null);
  321. pages[41][1]=new method("ipreview/inpvw5a.htm","parent.content.go('')",true);
  322.  
  323. pages[42]=new Array();
  324. pages[42][0]=new page("ipreview/inpvw6.htm",null,null);
  325. pages[42][1]=new method("ipreview/inpvw7.htm","parent.content.go('')",true);
  326.  
  327. pages[43]=new Array();
  328. pages[43][0]=new page("ipreview/ipreview/inpvw7.htm",null,null);
  329. //pages[43][1]=new method("main.htm","parent.content.go('')",true);    
  330. pages[43][1]=new action("main.htm");                                    // XXX For Deluxe, change "main.htm" to "ipreview/inpvw8.htm"
  331.  
  332. pages[44]=new Array();
  333. pages[44][0]=new page("ipreview/inpvw8.htm",null,null);
  334. //pages[44][1]=new method("main.htm","parent.content.go('')",true);
  335. pages[44][1]=new action("main.htm");
  336.  
  337. // start screen
  338.  
  339. pages[45]=new Array();
  340. pages[45][0]=new page("start.htm",null,null);
  341. //pages[45][0].top=true;
  342.  
  343. // intro screens
  344.  
  345. pages[46]=new Array();
  346. pages[46][0]=new page("intro/intro1.htm",null,null);
  347. //pages[46][0].fullhistory=true;
  348. pages[46][1]=new method("intro/intro2.htm","parent.content.go('')",true);
  349.  
  350. pages[47]=new Array();
  351. pages[47][0]=new page("intro/intro2.htm",null,null);
  352. pages[47][1]=new method("intro/intro3.htm","parent.content.go('')",true);
  353.  
  354. pages[48]=new Array();
  355. pages[48][0]=new page("intro/intro3.htm",null,null);
  356. pages[48][1]=new method("intro/intro4.htm","parent.content.go('')",true);
  357.  
  358. pages[49]=new Array();
  359. pages[49][0]=new page("intro/intro4.htm",null,null);
  360. pages[49][1]=new method("intro/intro5.htm","parent.content.go('')",true);
  361.  
  362. pages[50]=new Array();
  363. pages[50][0]=new page("intro/intro5.htm",null,null);
  364. pages[50][1]=new method("intro/intro6.htm","parent.content.go('')",true);
  365.  
  366. pages[51]=new Array();
  367. pages[51][0]=new page("intro/intro6.htm",null,null);
  368. //pages[51][1]=new condition("needs1.htm","Mode Selection","ForceNew","yes");
  369. //pages[51][2]=new condition("useAcct.htm","Mode Selection","ForceExisting","yes");
  370. pages[51][1]=new action("main.htm");
  371.  
  372. pages[52]=new Array();
  373. pages[52][0]=new page("editfour.htm",null,null);
  374. pages[52][1]=new method("reg1stp.htm","parent.content.go('register.htm')",true);
  375. pages[52][2]=new method("ok.htm","parent.content.go('ok.htm')",true);
  376. pages[52][3]=new method("okreboot.htm","parent.content.go('okreboot.htm')",true);
  377. pages[52][4]=new method("error.htm","parent.content.go('error.htm')",true);
  378.  
  379. // 53 - 57 are used in the New Account path
  380.  
  381. // Added to accommodate Netcenter Screen
  382. pages[58]=new Array();
  383. pages[58][0]=new page("ipreview/inpvw5a.htm",null,null);
  384. pages[58][1]=new method("ipreview/inpvw6.htm","parent.content.go('')",true);
  385.  
  386.  
  387. // NB: if you add new pages here, make sure that the array indices are not already
  388. // being used
  389.  
  390.  
  391. function checkShowIntroFlag()
  392. {
  393.     if ( parent && parent.parent && parent.parent.globals )
  394.     {
  395.         var theFile = parent.parent.globals.getAcctSetupFilename( self );    
  396.  
  397.         var theFlag = parent.parent.globals.GetNameValuePair( theFile, "Mode Selection", "Show_Intro_Screens" );
  398.         if ( theFlag != null )
  399.         {
  400.             theFlag = theFlag.toLowerCase();
  401.         }
  402.         return ( theFlag == "yes" );
  403.     }
  404.     else
  405.     {
  406.         return false;
  407.     }
  408. }
  409.  
  410.  
  411. // return the page number (according to ordinals along the path taken) of "file"
  412. function findPageOffset( file )
  413. {
  414.     // * take off any path information preceeding file name
  415.     if ( ( slashPos = file.lastIndexOf( "/" ) ) > 0 )
  416.     {
  417.         file = file.substring( slashPos + 1, file.length );
  418.     }
  419.  
  420.     // * loop through all the page information and attempt to find a page name matching
  421.     // "file"
  422.     var    pageNum = -1;
  423.     for ( var x = 0; x < pages.length; x++ )
  424.     {
  425.         for ( var y = 0; y < pages[ x ].length; y++ )
  426.         {
  427.             if ( pages[ x ][ y ].type== "INFO" )
  428.             {
  429.                 var theName = pages[ x ][ y ].file;
  430.  
  431.                 // * again, remove any path
  432.                 if ( ( slashPos = theName.lastIndexOf( "/" ) ) > 0 )
  433.                 {
  434.                     theName = theName.substring( slashPos + 1, theName.length );
  435.                 }
  436.         
  437.                 // * pages[ x ][ y ].file
  438.                 if ( theName == file )
  439.                 {
  440.                     // * found it
  441.                     pageNum = x;
  442.                 }
  443.             
  444.                 // * break here so we don't keep testing all the rest of the array entries after
  445.                 // we've found the "INFO" entry    
  446.                 break;
  447.             }
  448.         }
  449.         
  450.         // * break if we've found it
  451.         if ( pageNum >= 0 )
  452.             break;
  453.     }
  454.  
  455.     if ( parent && parent.parent && parent.parent.globals )
  456.     {
  457.         parent.parent.globals.debug( "\tfindPageOffset: '" +file+ "' is " + pageNum );
  458.     }
  459.  
  460.     return pageNum;
  461. }
  462.  
  463.  
  464. // main navigational function in Account Setup, "msg" is typically the name of a button
  465. // that was pressed
  466. function go( msg )
  467. {
  468.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  469.  
  470.     var editMode = false;
  471.     var globals = null;
  472.     
  473.     if ( parent && parent.parent && parent.parent.globals )
  474.         globals = parent.parent.globals;
  475.     
  476.     if ( globals != null )
  477.         editMode = ( globals.document.vars.editMode.value.toLowerCase() == "yes" ) ? true : false;
  478.  
  479. //    var formName = new String(parent.content.location);
  480.     var formName = "" + parent.content.location;
  481.  
  482.     if ( ( x = formName.lastIndexOf( "/" ) ) > 0 )
  483.         formName = formName.substring( x + 1, formName.length );
  484.     
  485.     var pageNum = findPageOffset( formName );
  486.     if ( pageNum >= 0 )
  487.         formName = pages[ pageNum ][ 0 ].file;
  488.  
  489. //    var startingPageName = parent.content.document.forms[0].name;
  490.     var startingPageName = formName;
  491.     var thePlatform = globals.getPlatform();
  492.     var separatorString = ",";
  493.  
  494.     // process messages
  495.  
  496.     if ( msg == "Next" )
  497.     {
  498.         // * if something is wrong with the current page content, don't do anything
  499.         if ( !parent || !parent.content )
  500.             return;
  501.             
  502.         // * if we're currently loading, don't do anything
  503.         if ( parent.content.loading )
  504.             return;
  505.             
  506.         if ( editMode != true )
  507.         {
  508.             if ( parent.content.checkData && ( parent.content.checkData() == false ) )
  509.                 return;
  510.  
  511.             // workaround for onunload handler bugs in 4.0b2; no longer using onunload handler
  512.             if ( parent.content.saveData != null )
  513.                 parent.content.saveData();
  514.         }
  515.  
  516.         var pageName = startingPageName;
  517.  
  518.         if ( globals != null )
  519.             globals.debug("\ngo: Starting at page " +pageName);
  520.  
  521.         var acctSetupFile = "";
  522.         if ( globals != null )
  523.             acctSetupFile = globals.getAcctSetupFilename( self );
  524.  
  525.         var moved = false;
  526.         var active = true;
  527.  
  528.         while ( active )
  529.         {
  530.             active = false;            
  531.             var pageNum = findPageOffset( pageName );
  532.             if ( pageNum < 0 )
  533.             {
  534.                 alert( "The file '" + pageName + "' is unknown to Account Setup." );
  535.                 return;
  536.             }
  537.  
  538.             for ( var x = 0; x < pages[ pageNum ].length; x++ )
  539.             {
  540.                 if ( editMode == false && pages[ pageNum ][ x ].type == "CONDITION" )
  541.                 {
  542.                     var theFlag = globals.GetNameValuePair( acctSetupFile, pages[ pageNum ][ x ].section, 
  543.                                                                             pages[ pageNum ][ x ].variable );
  544.                     theFlag = theFlag.toLowerCase();
  545.                     
  546.                     if ( pages[ pageNum ][ x ].value == "..." )
  547.                     {
  548.                         if ( theFlag != null && theFlag != "" )
  549.                         {
  550.                             active = moved = true;
  551.                             pageName = pages[ pageNum ][ x ].file;
  552.                             break;
  553.                         }
  554.                     }
  555.                     else if ( theFlag == pages[ pageNum ][ x ].value )
  556.                     {
  557.                         active = moved = true;
  558.                         pageName = pages[ pageNum ][ x ].file;
  559.                         break;
  560.                     }
  561.                 }
  562.     
  563.                 else if ( moved == false && pages[ pageNum ][ x ].type == "METHOD" )
  564.                 {
  565.                     var val = eval( pages[ pageNum ][ x ].method );
  566.                         
  567.                     if ( globals != null )
  568.                     {
  569.                         globals.debug( "\tMethod: " + pages[ pageNum ][ x ].method );
  570.                         globals.debug( "\tReturned: " + val );
  571.                     }
  572.  
  573.                     if ( val == pages[ pageNum ][ x ].value )
  574.                     {
  575.                         active = moved = true;
  576.                         pageName = pages[ pageNum ][ x ].file;
  577.                         break;
  578.                     }
  579.                 }
  580.  
  581.                 else if ( moved == false && pages[ pageNum ][ x ].type == "ACTION" )
  582.                 {
  583.                     globals.debug( "\tAction: " + pages[ pageNum ][ x ].file );
  584.                     active = false;
  585.                     moved = true;
  586.                     pageName = pages[ pageNum ][ x ].file;
  587.                     break;
  588.                 }
  589.                 
  590.             }
  591.         }
  592.         
  593.         
  594.         if ( pageName != startingPageName )
  595.         {
  596.             if ( globals != null )
  597.             {
  598.                 if ( globals.document.setupPlugin.NeedReboot() == true )
  599.                     globals.forceReboot( pageName );
  600.                 else
  601.                 {
  602.                     if ( pageName == "main.htm" )
  603.                         globals.document.vars.pageHistory.value = "";
  604.                     else
  605.                         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  606.     
  607.                     globals.debug( "go: Moving to page " + pageName );
  608.     
  609.                     pages.current = pageName;
  610.                     parent.content.location.replace( pageName );
  611.  
  612.                     if ( helpWindow && helpWindow != null )
  613.                     {
  614.                         if ( helpWindow.closed == false )
  615.                         {
  616.                             doHelp( pageName );
  617.                         }
  618.                     }
  619.                 }
  620.             }
  621.             else
  622.             {
  623.                 pages.current = pageName;
  624.  
  625.                 if ( pages[ pageNum ][ 0 ].top == true )
  626.                 {
  627.                     parent.location.replace( pageName );
  628.                 }
  629.                 else
  630.                 {
  631.                     var theLoc = "" + parent.content.location;
  632.                     if ( ( x = theLoc.lastIndexOf( "/" ) ) > 0 )
  633.                     {
  634.                         pageName = theLoc.substring( 0, x + 1 ) + pageName;
  635.                     }
  636.                     
  637.                     parent.content.location.replace( pageName );
  638.                 }
  639.             }
  640.         }
  641.     }
  642.  
  643.     else if ( msg == "Back" )
  644.     {
  645.         if ( parent.content.loading )
  646.             return;
  647.  
  648.         // workaround for onunload handler bugs in 4.0b2; no longer using onunload handler
  649.         if ( parent.content.saveData !=null )
  650.             parent.content.saveData();
  651.  
  652. //        parent.content.history.back();
  653.  
  654.         if ( parent.content.verifyData )
  655.         {
  656.             var verifyFlag = parent.content.verifyData();
  657.             if ( verifyFlag != true )
  658.             {
  659.                 generateControls();
  660.                 return;
  661.             }
  662.         }
  663.  
  664.         if ( globals != null )
  665.         {
  666.             var historyCleanup = true;
  667.             while ( historyCleanup == true )
  668.             {
  669.                 historyCleanup = false;
  670.  
  671.                 var pageHistory = globals.document.vars.pageHistory.value;
  672.                 if ( pageHistory!="" )
  673.                 {            
  674.                     var pageName="";
  675.                     x = pageHistory.lastIndexOf( separatorString );
  676.                     pageHistory = pageHistory.substring( 0, x );
  677.                     x = pageHistory.lastIndexOf( separatorString );
  678.                     if ( x >= 0 )
  679.                     {
  680.                         pageName = pageHistory.substring( x + 1, pageHistory.length );
  681.                         globals.document.vars.pageHistory.value = pageHistory.substring( 0, x + 1 );
  682.                         if ( ( pageName == "reg1stp.htm" ) || ( pageName == "error.htm" ) ||
  683.                             ( pageName == "error2.htm" ) || ( pageName == "reg2stp.htm" ) )
  684.                             historyCleanup = true;
  685.                     }
  686.                     else
  687.                     {
  688.                         pageName=pageHistory;
  689.                         globals.document.vars.pageHistory.value="";
  690.                     }
  691.                 }
  692.             }
  693.             globals.debug("go: Moving back to page " + pageName );
  694.             
  695.             if ( pageName == "undefined" )
  696.                 return;
  697.  
  698.             pages.current = pageName;
  699.             if ( pageNum >= 0 && pages[ pageNum ][ 0 ].fullhistory == true )
  700.                 parent.parent.history.back();
  701.             else
  702.                 parent.content.location.replace( pageName );
  703.  
  704.             if ( helpWindow && helpWindow != null )
  705.             {
  706.                 if ( helpWindow.closed == false )
  707.                     doHelp( pageName );
  708.             }
  709.         }
  710.         else
  711.         {
  712.             if ( pages[ pageNum ][ 0 ].fullhistory == true )
  713.                 parent.parent.history.back();
  714.             else
  715.                 parent.content.history.back();
  716.         }
  717.     }
  718.     else if ( msg == "Help" )
  719.     {
  720.         doHelp( formName );
  721.     }
  722.     else if ( msg == "Show Screen" )
  723.     {
  724.         var pageNum = findPageOffset( formName );
  725.         if ( pageNum>=0 )
  726.         {
  727.             var section = pages[ pageNum ][ 0 ].section;
  728.             var variable = pages[ pageNum ][ 0 ].variable;
  729.             if ( section != null && section!="" && variable != null && variable!="" )
  730.             {
  731.                 showScreenToggle = true;
  732.                 var acctSetupFile = globals.getAcctSetupFilename( self );
  733.                 var theFlag = globals.GetNameValuePair( acctSetupFile, section, variable);
  734.                 theFlag = theFlag.toLowerCase();
  735.                 if ( theFlag == "no" )
  736.                     theFlag="yes";
  737.                 else
  738.                     theFlag="no";
  739.                 
  740.                 parent.parent.SetNameValuePair( acctSetupFile, section, variable, theFlag);
  741.             }
  742.         }
  743.     }
  744.     else if ( msg == "Later" )
  745.     {
  746.         if ( parent.content.go( "Later" ) == true )
  747.         {
  748.  
  749.             if ( ( globals.document.vars.editMode.value.toLowerCase() != "yes") || 
  750.                     ( confirm( "Normally, this would complete the Account Setup process and quit Communicator.  Would you like to quit now?" ) == true ) )
  751.             {
  752. //                parent.content.location.href = "later.htm";
  753.                 if ( globals != null )
  754.                 {
  755.                     if ( globals.document.vars.editMode.value.toLowerCase() != "yes")
  756.                         globals.saveGlobalData();
  757.                     globals.document.setupPlugin.QuitNavigator();
  758.                 }
  759.                 window.close();
  760.             }
  761.         }
  762.     }
  763.     else if ( msg == "Done" )
  764.     {
  765.         if ( globals != null )
  766.         {
  767.             if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )
  768.                 globals.saveGlobalData();
  769.             if ( ( globals.document.vars.editMode.value.toLowerCase() != "yes") || 
  770.                     ( confirm( "Normally, this would complete the Account Setup process and quit Communicator.  Would you like to quit now?") == true ) )
  771.             {
  772.                 globals.document.setupPlugin.QuitNavigator();
  773.                 window.close();
  774.             }
  775.         }
  776.     }
  777.     else if ( msg == "Exit" )
  778.     {
  779.         var    longMsgFlag = true;
  780.         var confirmFlag = false;
  781.         
  782.         if ( formName.indexOf( "main.htm" ) >= 0 )
  783.             longMsgFlag = false;
  784.         else if ( formName.indexOf( "aboutbox.htm" ) >= 0 )
  785.             longMsgFlag = false;
  786.         else if ( formName.indexOf( "error.htm" ) >= 0 )
  787.             longMsgFlag = false;
  788.         else if ( formName.indexOf( "error2.htm" ) >= 0 )
  789.             longMsgFlag = false;
  790.         else if ( formName.indexOf( "intro/" ) >= 0 )
  791.             longMsgFlag = false;
  792.         else if ( formName.indexOf( "ipreview/" ) >= 0 )
  793.             longMsgFlag = false;
  794.         else if ( formName.indexOf( "preview/" ) >= 0 )
  795.             longMsgFlag = false;
  796.  
  797.         if ( longMsgFlag == true )
  798.         {
  799.             if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )    
  800.                 confirmFlag = confirm( "You haven't finished setting up your account. Are you sure you want to quit Account Setup?" );
  801.             else    // this is for the account setup editor
  802.                 confirmFlag = confirm( "Are you sure you want to quit the Account Setup Editor?" );
  803.         }
  804.         else
  805.             confirmFlag = confirm( "Quit Account Setup?" );
  806.         
  807.         if ( confirmFlag == true )
  808.         {
  809.             if ( globals != null )
  810.             {
  811.                 globals.saveGlobalData();
  812.                 globals.document.setupPlugin.QuitNavigator();
  813.             }
  814.             window.close();
  815.         }
  816.     }
  817.     else if ( msg == "Restart" )
  818.     {
  819.         if ( globals.document.vars.editMode.value.toLowerCase() != "yes" )
  820.         {
  821.             globals.saveGlobalData();
  822.             globals.document.setupPlugin.Reboot( null );
  823.             window.close();
  824.         }
  825.         else
  826.             alert( "Cannot reboot in edit mode." );
  827.     }
  828.     else if ( msg == "About" )
  829.     {
  830.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  831.         pages.current = "aboutbox.htm";
  832.         parent.content.location.replace( "aboutbox.htm" );
  833.     }
  834.     else if ( msg == "Setup" )
  835.     {
  836.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  837.  
  838.         var acctSetupFile = globals.getAcctSetupFilename( self );
  839.         var newPathFlag = globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceNew" );
  840.         newPathFlag = newPathFlag.toLowerCase();
  841.         var existingPathFlag = globals.GetNameValuePair( acctSetupFile, "Mode Selection", "ForceExisting" );
  842.         existingPathFlag = existingPathFlag.toLowerCase();
  843.  
  844.         var pageName="";
  845.         if ( newPathFlag == "yes" && existingPathFlag != "yes")
  846.             pageName = "needs1.htm";
  847.         else if ( existingPathFlag == "yes" && newPathFlag != "yes" )
  848.             pageName = "useAcct.htm";
  849.         else
  850.             pageName = "accounts.htm";
  851.         parent.content.location.replace( pageName );
  852.         if ( helpWindow && helpWindow != null )
  853.         {
  854.             if ( helpWindow.closed == false )
  855.                 doHelp( pageName );
  856.         }
  857.     }
  858.     else if ( msg == "Edit Settings" )
  859.     {
  860.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  861.         pages.current = "settings.htm";
  862.         parent.content.location.replace( "../CG/docs/settings.htm" );
  863.     }
  864.     else if ( msg == "Manage Servers" )
  865.     {
  866.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  867.         pages.current = "editregs.htm";
  868.         parent.content.location.replace( "../CG/docs/editregs.htm" );
  869.     }
  870.     else if ( msg == "Manage Accounts" )
  871.     {
  872.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  873.         pages.current = "editisps.htm";
  874.         parent.content.location.replace( "../CG/docs/editisps.htm" );
  875.     }
  876.     else if ( msg == "Edit IAS" )
  877.     {
  878.         if ( thePlatform == "Macintosh" )
  879.             globals.document.vars.pageHistory.value += "../../Tools/CG/docs/" + startingPageName + separatorString;
  880.         else
  881.             globals.document.vars.pageHistory.value += "../../../AccountSetupTools/CG/docs/" + startingPageName + separatorString;
  882.             
  883.         pages.current = "addias.htm";
  884.         parent.content.location.replace("ias/addias.htm");
  885.     }
  886.     else if ( msg == "Edit NCI" )
  887.     {
  888.         if (thePlatform == "Macintosh")
  889.             globals.document.vars.pageHistory.value += "../../Tools/CG/docs/" + startingPageName + separatorString;
  890.         else
  891.             globals.document.vars.pageHistory.value += "../../../AccountSetupTools/CG/docs/" + startingPageName + separatorString;
  892.         pages.current = "addnci.htm";
  893.         parent.content.location.replace( "nci/addnci.htm" );
  894.     }    
  895.     else if ( msg == "Screen Options" )
  896.     {
  897.         globals.document.vars.pageHistory.value += startingPageName + separatorString;
  898.             
  899.         if ( formName == "namepw.htm" )
  900.         {
  901.             pages.current = "asktty.htm";
  902.             parent.content.location.replace( "../CG/docs/asktty.htm" );
  903.         }
  904.         //else if (formName == "servers.htm")    {
  905.         //        pages.current = "askserv.htm";
  906.         //        parent.content.location.replace("../CG/docs/askserv.htm");
  907.         //        }
  908.         else if ( formName == "ok.htm" )
  909.         {
  910.             pages.current = "asksvinf.htm";
  911.             parent.content.location.replace( "../CG/docs/asksvinf.htm" );
  912.         }
  913.         else if ( formName == "okreboot.htm" )
  914.         {
  915.             pages.current = "asksvinf.htm";
  916.             parent.content.location.replace( "../CG/docs/asksvinf.htm" );
  917.         }
  918.         else if ( formName == "billing.htm" )
  919.         {
  920.             pages.current = "editcc.htm";
  921.             parent.content.location.replace( "../CG/docs/editcc.htm" );
  922.         }
  923.         else if ( formName == "main.htm" )
  924.         {
  925.             pages.current = "settings.htm";
  926.             parent.content.location.replace( "../CG/docs/settings.htm" );
  927.         }
  928.         else if ( formName == "useAcct.htm" )
  929.         {
  930.             pages.current = "editisps.htm";
  931.             parent.content.location.replace( "../CG/docs/editisps.htm" );
  932.         }
  933.         else if ( formName == "connect1.htm" )
  934.         {
  935.             pages.current = "editregs.htm";
  936.             parent.content.location.replace( "../CG/docs/editregs.htm" );
  937.         }        
  938.  
  939.     }    //end screen options special casing
  940.         
  941.     else    
  942.         parent.content.go( msg );
  943. //    generateControls();
  944. }
  945.  
  946.  
  947.  
  948. function loadData()
  949. {
  950.     var file="";
  951.         
  952. //    preLoadImages();
  953.  
  954.     if (parent && parent.parent && parent.parent.globals)    {
  955.         file = parent.parent.globals.document.vars.startupFile.value;
  956.         }
  957.     if (file != null && file != "")    {
  958.         if (parent && parent.parent && parent.parent.globals)    {
  959.             parent.parent.globals.document.vars.startupFile.value = "";
  960.             }
  961.         parent.content.location.replace(file);
  962.         }
  963.     generateControls();
  964. }
  965.  
  966.  
  967.  
  968. // end hiding contents from old browsers  -->
  969.