home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / clayer2.js < prev    next >
Text File  |  1998-10-15  |  25KB  |  883 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. // globals
  23. var theToolBar = null;                     // a global pointer to our toolbar - should it exist
  24. var helpWindow = null;
  25. var preLoaded = false;
  26.  
  27. var backImages         = null;
  28. var helpImages        = null;
  29. var exitImages        = null;
  30. var nextImages        = null;
  31. var connectImages    = null;
  32. var doneImages        = null;
  33. var ffImages        = null;
  34. var rebootImages    = null;
  35.  
  36.  
  37. compromisePrincipals();
  38.  
  39.  
  40. function preLoadImages()
  41. {
  42.     if ( preLoaded == false )
  43.     {
  44.         //img[0] is the normal image
  45.         //img[1] is the mouseover
  46.         //img[2] is the mousedown
  47.          
  48.         backImages        = new Array;
  49.         helpImages        = new Array;
  50.         exitImages        = new Array;
  51.         nextImages        = new Array;
  52.         connectImages    = new Array;
  53.         doneImages        = new Array;
  54.         ffImages        = new Array;
  55.         rebootImages    = new Array;
  56.  
  57.         backImages[0] = new Image(32,32);
  58.         backImages[0].src = "images/bk_up.gif";
  59.         backImages[1] = new Image(32,32);
  60.         backImages[1].src = "images/bk_mo.gif";
  61.         backImages[2] = new Image(32,32);
  62.         backImages[2].src = "images/bk_down.gif";
  63.  
  64.         helpImages[0] = new Image(32,32);
  65.         helpImages[0].src = "images/hlp_up.gif";
  66.         helpImages[1] = new Image(32,32);
  67.         helpImages[1].src = "images/hlp_mo.gif";
  68.         helpImages[2] = new Image(32,32);
  69.         helpImages[2].src = "images/hlp_down.gif";
  70.  
  71.         exitImages[0] = new Image(32,32);
  72.         exitImages[0].src = "images/ext_up.gif";
  73.         exitImages[1] = new Image(32,32);
  74.         exitImages[1].src = "images/ext_mo.gif";
  75.         exitImages[2] = new Image(32,32);
  76.         exitImages[2].src = "images/ext_down.gif";
  77.  
  78.         nextImages[0] = new Image(32,32);
  79.         nextImages[0].src = "images/nxt_up.gif";
  80.         nextImages[1] = new Image(32,32);
  81.         nextImages[1].src = "images/nxt_mo.gif";
  82.         nextImages[2] = new Image(32,32);
  83.         nextImages[2].src = "images/nxt_down.gif";
  84.  
  85.         rebootImages[0] = new Image(32,32);
  86.         rebootImages[0].src = "images/rb_up.gif";
  87.         rebootImages[1] = new Image(32,32);
  88.         rebootImages[1].src = "images/rb_mo.gif";
  89.         rebootImages[2] = new Image(32,32);
  90.         rebootImages[2].src = "images/rb_down.gif";
  91.  
  92.         connectImages[0] = new Image(32,32);
  93.         connectImages[0].src = "images/cn_up.gif";
  94.         connectImages[1] = new Image(32,32);
  95.         connectImages[1].src = "images/cn_mo.gif";
  96.         connectImages[2] = new Image(32,32);
  97.         connectImages[2].src = "images/cn_down.gif";
  98.  
  99.         doneImages[0] = new Image(32,32);
  100.         doneImages[0].src = "images/dn_up.gif";
  101.         doneImages[1] = new Image(32,32);
  102.         doneImages[1].src = "images/dn_mo.gif";
  103.         doneImages[2] = new Image(32,32);
  104.         doneImages[2].src = "images/dn_down.gif";
  105.  
  106.         ffImages[0] = new Image(32,32);
  107.         ffImages[0].src = "images/ff_up.gif";
  108.         ffImages[1] = new Image(32,32);
  109.         ffImages[1].src = "images/ff_mo.gif";
  110.         ffImages[2] = new Image(32,32);
  111.         ffImages[2].src = "images/ff_down.gif";
  112.  
  113.         preLoaded = true;
  114.         }
  115. }
  116.  
  117. // Generating Controls for navigation
  118. // showConnectRegServer is introduced to display differebt text on 1 step path
  119. function generateControls()
  120. {
  121.     var    editMode                =    false;
  122.     var    showAcctsetEdit            =    false;
  123.     var    showRegFileEdit            =    false;
  124.     var    showISPFileEdit            =    false;
  125.     var showExit                =    true;
  126.     var    showHelp                =    true;
  127.     var    showBack                =    true;
  128.     var    showNext                =    true;
  129.     var    showConnectServer        =    false;
  130.     var    showConnectRegServer        =    false;
  131.     var    showConnectISP            =    false;
  132.     var    showConnectNow            =    false;
  133.     var showDownload            =    false;
  134.     var    showConnectLater        =    false;
  135.     var    showAgain                =    false;
  136.     var    showDone                =    false;
  137.     var    showRestart                =    false;
  138.     var showSetupShortcut        =    false;
  139.     var    showInternet            =    false;
  140.     var    showScreenToggle        =    false;
  141.     var    screenVisible            =    true;
  142.     var showScreenOptions        =    false;
  143.  
  144.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  145.  
  146.     if ( parent && parent.parent && parent.parent.globals )
  147.     {
  148.         editMode = ( parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes" ) ? true : false;
  149.     }
  150.  
  151. //    var formName = parent.content.location.toString();
  152.     var formName = "" + parent.content.location;
  153.     if ( formName != null && formName != "" && formName != "about:blank" )
  154.     {
  155.         if ( ( x = formName.lastIndexOf( "/" ) ) > 0 )
  156.             formName = formName.substring( x + 1, formName.length );
  157.  
  158.         if ( editMode == true )
  159.         {
  160.             var section = null;
  161.             var variable = null;
  162.             var pageNum = findPageOffset( formName );
  163.             if ( pageNum >= 0 )
  164.             {
  165.                 section = pages[ pageNum ][ 0 ].section;
  166.                 variable = pages[ pageNum ][ 0 ].variable;
  167.                 if ( section!=null && section!="" && variable!=null && variable!="" )
  168.                 {
  169.                     showScreenToggle = true;
  170.                     var theFile = parent.parent.globals.getAcctSetupFilename( self );
  171.                     var theFlag = parent.parent.globals.GetNameValuePair( theFile, section, variable );
  172.                     theFlag = theFlag.toLowerCase();
  173.                     if ( theFlag == "no" )
  174.                         screenVisible = false;
  175.                 }
  176.             }
  177.         }
  178.  
  179.         if ( formName == "main.htm" )
  180.         {
  181.             showBack = false;
  182.             showNext = false;
  183.             if ( navigator.javaEnabled() == false )
  184.             {
  185.                 showNext = false;
  186.                 editMode = false;
  187.                 showAcctsetEdit = false;
  188.                 showISPFileEdit = false;
  189.                 showRegFileEdit = false;
  190.                 document.writeln( "<CENTER><STRONG>Java support is disabled!<P>\n" );
  191.                 document.writeln( "Choose Options | Network Preferences and enable Java, then try again.</STRONG></CENTER>\n" );
  192.             }
  193.             else if ( !navigator.mimeTypes[ "application/x-netscape-autoconfigure-dialer" ] ) 
  194.             {
  195.                 showNext = false;
  196.                 editMode = false;
  197.                 showAcctsetEdit = false;
  198.                 showISPFileEdit = false;
  199.                 showRegFileEdit = false;
  200.                 document.writeln( "<CENTER><STRONG>The 'Account Setup Plugin' is not installed!<P>\n" );
  201.                 document.writeln( "Please install the plugin, then run 'Account Setup' again.</STRONG></CENTER>\n" );
  202.             }
  203.             else if ( parent.parent.globals.document.setupPlugin == null )
  204.             {
  205.                 showNext = false;
  206.                 editMode = false;
  207.             }
  208.             if ( editMode == true )
  209.             {
  210.                 showAcctsetEdit = true;
  211.                 showScreenOptions = true;
  212.             }
  213.         }
  214.         else if ( editMode == true && formName == "useAcct.htm" )
  215.         {
  216.             showScreenOptions = true;
  217.         } 
  218.         else if ( editMode == true && formName == "servers.htm" )
  219.         {
  220.             showScreenOptions = false;
  221.         }
  222.         else if ( editMode == true && formName == "billing.htm" )
  223.         {
  224.             showScreenOptions = true;
  225.         }
  226.         else if ( formName == "accounts.htm" )
  227.         {
  228.             showNext = false;
  229.         }
  230.         else if ( formName == "compare.htm" )
  231.         {
  232.         }
  233.         else if ( formName == "connect1.htm" )
  234.         {
  235.             showNext = false;
  236.             showConnectRegServer = true;
  237.             if ( editMode == true )
  238.                 showScreenOptions = true;
  239.         }
  240.         else if ( formName == "download.htm" )
  241.         {
  242.             showNext = false;
  243.             showConnectServer = true;
  244.             if ( editMode == true )
  245.                 showScreenOptions = true;
  246.         }
  247.         else if ( formName == "connect2.htm" )
  248.         {
  249.             showNext = false;
  250.             showExit = false;
  251.             showConnectNow = true;
  252.             showConnectLater = true;
  253.         }
  254.         else if ( formName == "1step.htm" )
  255.         {
  256.             showNext = false;
  257.             showExit = false;
  258.             showHelp = false;
  259.             if ( editMode == true )
  260.                 showBack = true;
  261.         }
  262.         //else if ( formName == "2stpwrap.htm" )
  263.         else if ( formName == "2step.htm" )
  264.         {
  265.             showNext = false;
  266.             showConnectISP = true;
  267.             if ( editMode == true )
  268.                 showScreenOptions = true;
  269.         }
  270.         else if ( formName == "reg1stp.htm" || formName == "reg2stp.htm" )
  271.         {
  272.             showHelp = false;
  273.             showBack = false;
  274.             showNext = false;
  275.             if ( editMode == true )
  276.                 showBack = true;
  277.         }
  278.         else if ( formName == "ok.htm" )
  279.         {
  280.             showScreenOptions = true;
  281.             showBack = false;
  282.             showExit = false;
  283.             showNext = false;
  284.             showInternet = true;
  285.             showDone = true;
  286.             if ( editMode == true )
  287.                 showBack = true;
  288.         }
  289.         else if ( formName == "okreboot.htm" )
  290.         {
  291.             showScreenOptions = true;
  292.             showBack = false;
  293.             showNext = false;
  294.             showExit = false;
  295.             showDone = false;
  296.             showRestart = true;
  297.             if ( editMode == true )
  298.                 showBack = true;
  299.         }
  300.         else if ( formName == "error.htm" )
  301.         {
  302.             showBack = true;
  303.             showExit = true;
  304.             showNext = false;
  305.             showAgain = true;
  306.             showDone = false;
  307.             if ( editMode == true )
  308.                 showBack = true;
  309.         }
  310.         else if ( formName == "error2.htm" )
  311.         {
  312.                    showBack = true;
  313.                 showExit = true;
  314.                 showNext = false;
  315.                 showAgain = true;
  316.                 showDone = false;
  317.                 if ( editMode == true )
  318.                         showBack = true;
  319.         }
  320.         else if ( formName == "later.htm" )
  321.         {
  322.             showBack = false;
  323.             showExit = false;
  324.             showNext = false;
  325.             showDone = true;
  326.             if ( editMode == true )
  327.                 showBack = true;
  328.         }
  329.         else if ( formName == "intro1.htm" )
  330.         {
  331.             showSetupShortcut = false;
  332.         }
  333.         else if ( formName == "settings.htm" )
  334.         {
  335.             showBack = true;
  336.             showNext = false;
  337.             editMode = false;
  338.         }
  339.         else if ( formName == "editregs.htm" )
  340.         {
  341.             showBack = true;
  342.             showNext = false;
  343.             editMode = false;
  344.         }
  345.         else if ( formName == "editisps.htm" )
  346.         {
  347.             showBack = true;
  348.             showNext = false;
  349.             editMode = false;
  350.         }
  351.         else if ( formName == "aboutbox.htm" )
  352.         {
  353.             showHelp = false;
  354.             showNext = false;
  355.             showBack = true;
  356.         }
  357.         else if ( formName == "namepw.htm" )
  358.         {
  359.             showScreenOptions = true;
  360.         }
  361.         else if ( formName == "asktty.htm" )
  362.         {
  363.             showScreenOptions = false;
  364.             showBack = true;
  365.             showNext = false;
  366.             editMode = false;
  367.         }
  368.         else if ( formName == "askserv.htm" )
  369.         {
  370.             showScreenOptions = false;
  371.             showBack = true;
  372.             showNext = false;
  373.             editMode = false;
  374.         }
  375.         else if ( formName == "asksvinf.htm" )
  376.         {
  377.             showScreenOptions = false;
  378.             showBack = true;
  379.             showNext = false;
  380.             editMode = false;
  381.         }
  382.         else if ( formName == "showphon.htm" )
  383.         {
  384.             showScreenOptions = false;
  385.             showBack = true;
  386.             showNext = false;
  387.             editMode = false;
  388.         }
  389.         else if ( formName == "editcc.htm" )
  390.         {
  391.             showBack = true;
  392.             showNext = false;
  393.             editMode = false;
  394.         }
  395.         else if ( formName == "addnci.htm" )
  396.         {
  397.             showBack = true;
  398.             showNext = false;
  399.             editMode = false;
  400.         }
  401.         else if ( formName == "addias.htm" )
  402.         {
  403.             showBack = true;
  404.             showNext = false;
  405.             editMode = false;
  406.         }
  407.         else if ( formName == "editfour.htm" )
  408.         {
  409.             showBack = true;
  410.             showNext = false;
  411.             editMode = false;
  412.         }
  413.  
  414.         if ( document && document.layers && document.layers[ "controls" ] &&
  415.                 document.layers[ "controls" ].document &&
  416.                 document.layers[ "controls" ].document.layers &&
  417.                 document.layers[ "controls" ].document.layers.length > 0 )
  418.         {
  419.             document.layers[ "controls" ].layers[ "help" ].visibility = ( ( showHelp == true ) ? "show" : "hide" );            
  420.             document.layers[ "controls" ].layers[ "exit" ].visibility = ( ( showExit == true ) ? "show" : "hide" );            
  421.             document.layers[ "controls" ].layers[ "back" ].visibility = ( ( showBack == true ) ? "show" : "hide" );            
  422.             document.layers[ "controls" ].layers[ "next" ].visibility = ( ( showNext == true ) ? "show" : "hide" );            
  423.             document.layers[ "controls" ].layers[ "connectnow" ].visibility = ( ( showConnectNow == true ) ? "show" : "hide" );
  424.             document.layers[ "controls" ].layers[ "download" ].visibility = ( ( showDownload == true ) ? "show" : "hide" ); 
  425.             document.layers[ "controls" ].layers[ "connectserver" ].visibility = ( ( showConnectServer == true ) ? "show" : "hide" );            
  426.             document.layers[ "controls" ].layers[ "connectregserver" ].visibility = ( ( showConnectRegServer == true ) ? "show" : "hide" );            
  427.             document.layers[ "controls" ].layers[ "connectisp" ].visibility = ( ( showConnectISP == true ) ? "show" : "hide" );
  428.             document.layers[ "controls" ].layers[ "connectagain" ].visibility = ( ( showAgain == true ) ? "show" : "hide" );            
  429.             document.layers[ "controls" ].layers[ "done" ].visibility = ( ( showDone == true) ? "show" : "hide" );            
  430.             document.layers[ "controls" ].layers[ "restart" ].visibility = ( ( showRestart == true ) ? "show" : "hide" );            
  431.             document.layers[ "controls" ].layers[ "connectlater" ].visibility = ( ( showConnectLater == true ) ? "show" : "hide" );            
  432.             document.layers[ "controls" ].layers[ "setup" ].visibility = ( ( showSetupShortcut == true ) ? "show" : "hide" );            
  433.  
  434.             //NEW - Generate the controls for the toolbar, if it exists
  435.             if ( ( !theToolBar ) || ( theToolBar == null ) || ( !theToolBar.location ) || ( theToolBar.closed ) )
  436.             {
  437.                 //alert("opening toolbar");
  438.                 theToolBar = openToolBar();
  439.             }
  440.             else
  441.             {
  442.                 //alert("toolbar open, generating controls" + theToolBar);
  443.                 generateToolBarControls();    
  444.             }
  445.         }
  446.         else
  447.         {
  448.             setTimeout( "generateControls()", 1000 );
  449.         }
  450.         
  451.  
  452.         }
  453.     else
  454.     {
  455.         setTimeout( "generateControls()", 1000 );
  456.     }
  457. }
  458.  
  459.  
  460.  
  461. function doHelp(formName)
  462. {
  463.     var thePlatform;
  464.  
  465.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  466.  
  467.     helpFile = "./help/ashelp.htm";
  468.  
  469.     var helpPath = "";
  470.     if ( parent && parent.parent && parent.parent.globals )
  471.     {
  472.         helpPath = "" + parent.parent.globals.getFolder( self );
  473.  
  474.         thePlatform = parent.parent.globals.getPlatform();
  475.         if ( thePlatform == "Macintosh" )
  476.             helpPath = helpPath + "help:";    // Macintosh support
  477.         else
  478.             helpPath = helpPath + "help/";    // Windows support
  479.  
  480.         if ( thePlatform != "Macintosh" )
  481.         {
  482.  
  483.             var hpath=unescape(location.pathname);
  484.             hpath = hpath.substring(0, hpath.lastIndexOf('/'));
  485.             helpFile = hpath + "/help/ashelp.htm";
  486.  
  487.             // get rid of the return char at the end of .htm
  488.             formName = formName.substring(0, formName.indexOf('.htm')+4);
  489.             // next, get rid of sub folders in formName
  490.             while (formName.indexOf('/') > 0)
  491.                 formName = formName.substring(formName.indexOf('/')+1, formName.length);
  492.         }
  493.  
  494.         var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(helpPath,".htm");
  495.         if ( theList != null )
  496.         {
  497.             for ( var i = 0; i < theList.length; i++ )
  498.             {
  499.                 if ( formName == theList[ i ] )
  500.                 {
  501.                     if ( thePlatform != "Macintosh" )
  502.                     {
  503.                         var currentpath = unescape( location.pathname );
  504.                         currentpath = currentpath.substring( 0, currentpath.lastIndexOf( '/' ) );
  505.                         helpFile = currentpath + "/help/" + formName;
  506.                     }
  507.                     else
  508.                         helpFile = "./help/" + formName;
  509.                     break;
  510.                 }
  511.             }
  512.         }
  513.     }
  514.  
  515.     if ( helpFile != null && helpFile != "" )
  516.     {
  517.         if ( helpWindow == null || helpWindow.closed )
  518.             helpWindow = window.open( "about:blank","Documentation","width=328,height=328,alwaysRaised=yes,dependent=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes" );
  519.         if ( helpWindow && helpWindow != null )
  520.         {
  521.             helpWindow.focus();
  522.             helpWindow.location = helpFile;
  523.         }
  524.     }    
  525. }
  526.  
  527.  
  528.  
  529. //here are a bunch of functions for the floating toolbar
  530.  
  531.  
  532.  
  533. function openToolBar()
  534. {
  535.  
  536.     var thePlatform = parent.parent.globals.getPlatform();
  537.     var    editMode = false;
  538.  
  539.     if ( parent && parent.parent && parent.parent.globals )
  540.         editMode = ( parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes" ) ? true : false;
  541.  
  542.     if ( editMode == true )    
  543.     {
  544.         if ( !(theToolBar) || (theToolBar == null) || !( theToolBar.location ) ) 
  545.         {
  546.             if ( thePlatform == "Macintosh" )    
  547.                 theToolBar = top.open( "../../Tools/Kit/config.htm","Configurator","width=400,height=104,dependent=yes,alwaysraised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no" );
  548.             else
  549.                 theToolBar = top.open( "../../../AccountSetupTools/Kit/config.htm","Configurator","width=400,height=104,dependent=yes,alwaysraised=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no" );                
  550.         }
  551.     }
  552.     else
  553.         theToolBar = null;
  554.     return theToolBar;
  555. }
  556.  
  557.  
  558.  
  559. function showLayer(layerName, showIfTrue)
  560. {    
  561.     //alert("showLayer "+showIfTrue);
  562.     //parent.parent.globals.debug("showing layer: " + layerName + " " + showIfTrue + " layers: " + theToolBar.document.layers.length + " " + theToolBar.document.layers[layerName]);
  563.     if ((theToolBar) && (theToolBar!=null)  && (theToolBar.location) && (theToolBar.finishedLoading()))
  564.     {
  565.                 var gLayerName = "g_" + layerName;
  566.                 //var theLayer = eval("theToolBar.document.layers." + layerName);
  567.                 //parent.parent.globals.debug("theLayer: "+theLayer+ " but t.d.l.l: " + theToolBar.document.layers[layerName]);
  568.                 //var gLayer = eval("theToolBar.document.layers.g_" + layerName);
  569.                 
  570.                 //if (theLayer)
  571.                 {
  572.                     if (showIfTrue == true)
  573.                     {
  574.                         //theToolBar.document.layers[layerName].visibility ="show";
  575.                         theToolBar.showlayer(layerName);
  576.                         theToolBar.hidelayer(gLayerName);
  577.                         //theLayer.visibility="show";
  578.                         //if (gLayer) gLayer.visibility="hide";
  579.                     }
  580.                     else
  581.                     {
  582.                         theToolBar.hidelayer(layerName);
  583.                         theToolBar.showlayer(gLayerName);
  584.                         //theToolBar.document.layers[layerName].visibility ="hide";    
  585.                         //theLayer.visibility="hide";
  586.                         //if (gLayer) gLayer.visibility="show";
  587.                     }
  588.                 }
  589.                 //else
  590.                     //theToolBar.history.go(0);
  591.  
  592.     }
  593. }
  594.  
  595. function screenVisible()
  596. {
  597.     var isVisible = true;
  598.     var formName = parent.content.location.toString();
  599.     if (formName!=null && formName!="")    {
  600.         if ((x=formName.lastIndexOf("/"))>0)    {
  601.             formName=formName.substring(x+1,formName.length);
  602.             }
  603.             var section=null;
  604.             var variable=null;
  605.             var pageNum=findPageOffset(formName);
  606.             if (pageNum>=0)    {
  607.                 section=pages[pageNum][0].section;
  608.                 variable=pages[pageNum][0].variable;
  609.                 if (section!=null && section!="" && variable!=null && variable!="")    {
  610.                     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  611.                     var theFlag = parent.parent.globals.GetNameValuePair(theFile,section, variable);
  612.                     theFlag = theFlag.toLowerCase();
  613.                     if (theFlag == "no")    
  614.                         isVisible=false;    
  615.                     }
  616.                 }
  617.     //alert("clayer: screenVisible = : " + isVisible + "flag (" + variable + ") = " + theFlag);
  618.     }
  619.     return isVisible;
  620. }
  621.  
  622. function showScreen(inValue)
  623. {
  624.     //alert("in showscreen");
  625.     var formName = parent.content.location.toString();
  626.     
  627.     if (formName!=null && formName!="")    
  628.     {
  629.         if ((x=formName.lastIndexOf("/"))>0)    {
  630.         formName=formName.substring(x+1,formName.length);
  631.         }
  632.  
  633.         //alert("formName: " + formName);
  634.         var pageNum=findPageOffset(formName);
  635.         if (pageNum>=0)    
  636.         {
  637.             var section=pages[pageNum][0].section;
  638.             var variable=pages[pageNum][0].variable;
  639.             //alert("sec: " + section + " var: "+variable); 
  640.             if (section!=null && section!="" && variable!=null && variable!="")    {
  641.                 var theFile = parent.parent.globals.getAcctSetupFilename(self);
  642.                 var theFlag; // = parent.parent.globals.GetNameValuePair(theFile,section, variable);
  643.  
  644.  
  645.                 //theFlag = theFlag.toLowerCase();
  646.                 //if (theFlag == "no")    theFlag="yes";
  647.                 //else            theFlag="no";
  648.                 
  649.                 if (inValue == false)
  650.                     theFlag = "no";
  651.                 else
  652.                     theFlag = "yes";
  653.                 
  654.                 //alert("Setting flag " + variable + " to " + theFlag + " invalue: " + inValue);
  655.                 parent.parent.globals.SetNameValuePair(theFile,section, variable,theFlag);
  656.                 return (theFlag == "yes");
  657.                 }
  658.         }        
  659.         else
  660.         {
  661.             alert("This screen cannot be suppressed");
  662.             return true;    //forces the checkbox back on
  663.         }
  664.     }
  665. }
  666.  
  667.  
  668. function generateToolBarControls()
  669. {
  670.     var editMode                =    false;
  671. //    var    editMode                =    parent.parent.editMode();
  672.     var    showScreenToggle        =    false;    
  673.     var showScreenOptions        =    false;
  674.     var isScreenVisible            =    true;
  675.     var showEditHelp            =     true;
  676.     
  677.     //var    showAcctsetEdit            =    false;
  678.     //var    showRegFileEdit            =    false;
  679.     //var    showISPFileEdit            =    false;
  680.  
  681.     if (parent && parent.parent && parent.parent.globals)    {
  682.         editMode=(parent.parent.globals.document.vars.editMode.value.toLowerCase() == "yes") ? true:false;
  683.         }
  684.  
  685. //    var formName = parent.content.location.toString();
  686.     var formName = "" + parent.content.location;
  687.  
  688.     if (formName!=null && formName!="")    
  689.     {
  690.         if ((x=formName.lastIndexOf("/"))>0)    {
  691.             formName=formName.substring(x+1,formName.length);
  692.             }
  693.  
  694.         // this decides whether we should show the checkbox
  695.         var pageNum=findPageOffset(formName);
  696.         if (pageNum>=0)    
  697.         {
  698.             section=pages[pageNum][0].section;
  699.             variable=pages[pageNum][0].variable;
  700.             if (section!=null && section!="" && variable!=null && variable!="")    {
  701.                 showScreenToggle=true;
  702.                 //var theFile = parent.parent.globals.getAcctSetupFilename(self);
  703.                 //var theFlag = parent.parent.globals.GetNameValuePair(theFile,section, variable);
  704.                 //theFlag = theFlag.toLowerCase();
  705.                 //if (theFlag == "no")    screenVisible=false;
  706.                 }
  707.         }
  708.  
  709.  
  710.         if (formName == "main.htm")
  711.             showScreenOptions=true;
  712.         else if (formName == "useAcct.htm")
  713.             showScreenOptions=true;
  714.         else if (formName == "servers.htm")
  715.             showScreenOptions=false;
  716.         else if (formName == "billing.htm")
  717.             showScreenOptions=true;
  718.         else if (formName == "connect1.htm")
  719.                 showScreenOptions=true;
  720.         else if (formName == "connect2.htm")
  721.             ;
  722.         else if (formName == "reg1stp.htm" || formName == "reg2stp.htm" )
  723.             ;
  724.         else if (formName == "ok.htm")
  725.             showScreenOptions=true;
  726.         else if (formName == "okreboot.htm")
  727.             showScreenOptions=true;
  728.         else if (formName == "error.htm")
  729.             ;
  730.         else if (formName == "later.htm")
  731.             ;
  732.         else if (formName == "settings.htm")
  733.             editMode = false;
  734.         else if (formName == "editregs.htm")
  735.             editMode=false;
  736.         else if (formName == "editisps.htm")
  737.             editMode=false;
  738.         else if (formName == "aboutbox.htm")
  739.             ;
  740.         else if (formName == "namepw.htm")
  741.             showScreenOptions=true;
  742.  
  743.         else if (formName == "asktty.htm")
  744.         {
  745.             showScreenOptions=false;
  746.             editMode=false;
  747.         }
  748.         else if (formName == "askserv.htm")
  749.         {
  750.             showScreenOptions=false;
  751.             editMode=false;
  752.         }
  753.         else if (formName == "asksvinf.htm")
  754.         {
  755.             showScreenOptions=false;
  756.             editMode=false;
  757.         }
  758.         else if (formName == "showphon.htm")
  759.         {
  760.             showScreenOptions=false;
  761.             editMode=false;
  762.         }
  763.         else if (formName == "editcc.htm")
  764.         {
  765.             showScreenOptions=false;
  766.             editMode=false;
  767.         }
  768.         else if (formName == "addnci.htm")
  769.         {
  770.             showScreenOptions=false;
  771.             editMode=false;
  772.         }
  773.         else if (formName == "addias.htm")
  774.         {
  775.             showScreenOptions=false;
  776.             editMode=false;
  777.         }
  778.         else if (formName == "editfour.htm")
  779.         {
  780.             showScreenOptions=false;
  781.             editMode=false;
  782.         }
  783.  
  784.  
  785.         if (theToolBar && theToolBar != null && (theToolBar.location) && (theToolBar.document.layers) && !(theToolBar.closed)
  786.             && (theToolBar.ready) && (theToolBar.ready == true))
  787.         {
  788.  
  789.             if (theToolBar.finishedLoading())
  790.             {
  791.                 showLayer("reload", editMode);
  792.                 showLayer("edit", editMode);
  793.                 showLayer("chooseed", editMode);
  794.                 showLayer("edithelp", editMode);
  795.                 showLayer("options", showScreenOptions);
  796.                 showLayer("showscreen", showScreenToggle);
  797.                 if (showScreenToggle == true)
  798.                     theToolBar.setShowScreenBox();
  799.                 
  800.                 theToolBar.updateLayersLayer();
  801.                 //alert("found toolbar! - setting help location");
  802.                 theToolBar.setHelpLocation();
  803.                 
  804.             }
  805.             else
  806.             {
  807.                 //alert("Found toolbar, without reloadlayer!");
  808.                 theToolBar.history.go(0);    
  809.             }
  810.         }
  811.         //else
  812.             //alert("warning: toolbar not found");
  813.     }
  814. }
  815.  
  816. function showDocumentLayer(inLayerName, inDoShow)
  817. {
  818.     if (inDoShow == "hide")
  819.         inDoShow = false;
  820.     else if (inDoShow != false)
  821.         inDoShow = true;
  822.     
  823.     if (parent.content && parent.content.document.layers[inLayerName])
  824.     {
  825.         if (inDoShow == true)
  826.         {
  827.             parent.content.document.layers[inLayerName].visibility = "show";
  828.             //alert("showing layer: " + inLayerName);
  829.         }
  830.         else
  831.         {
  832.             parent.content.document.layers[inLayerName].visibility = "hide";
  833.             //alert("hiding layer: " + inLayerName);
  834.         }
  835.     }
  836.  
  837. }
  838.  
  839.  
  840. function countDocumentLayers()
  841. {
  842.     if (parent.content.document.layers)
  843.         return parent.content.document.layers.length;
  844.     else
  845.         return 0;
  846. }
  847.  
  848. function getLayerName(inIndex)
  849. {
  850.     if (parent.content.document.layers && parent.content.document.layers[inIndex])
  851.         return parent.content.document.layers[inIndex].name;
  852.     return null;
  853. }
  854.  
  855. function getLayerSrc(inIndex)
  856. {
  857.     if (parent.content.document.layers && parent.content.document.layers[inIndex])
  858.         return parent.content.document.layers[inIndex].src;
  859.     return null;
  860. }
  861.  
  862. function getDocumentLocation()
  863. {
  864.     return parent.content.document.location;
  865. }
  866.  
  867. function getDocumentLayerVisibility(inLayerName)
  868. {
  869.     if (parent.content.document.layers && parent.content.document.layers[inLayerName])
  870.         return parent.content.document.layers[inLayerName].visibility;
  871.     else 
  872.         return null;
  873.  
  874. }
  875.  
  876. function reloadDocument()
  877. {
  878.     top.globals.debug("RELOADING DOCUMENT!!!!" + parent.content.history);
  879.     if (parent.content.history)
  880.         parent.content.history.go(0);
  881. }
  882. // end hiding contents from old browsers  -->
  883.