home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / start.js < prev    next >
Text File  |  1998-10-15  |  3KB  |  90 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. var debugFlag = false;
  21.  
  22. function loadData()
  23. {
  24.     if (navigator.javaEnabled() == false)    {
  25.         document.layers["needJava"].visibility = "show";
  26.         }
  27.     else    {
  28.         netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  29.     
  30.         // check browser version
  31.         var theAgent=navigator.userAgent;
  32.         var x=theAgent.indexOf("/");
  33.         if (x>=0)    {
  34.             theVersion=theAgent.substring(x+1,theAgent.length);
  35.             x=theVersion.indexOf(".");
  36.             if (x>0)    {
  37.                 theVersion=theVersion.substring(0,x);
  38.                 }            
  39.             if (parseInt(theVersion)>=4)    {
  40.                 top.toolbar.visible=false;
  41.                 top.menubar.visible=false;
  42.                 top.locationbar.visible=false;
  43.                 top.personalbar.visible=false;
  44.                 top.statusbar.visible=false;
  45.                 top.scrollbars.visible=false;
  46.     
  47.                 var screenWidth = screen.width;
  48.                 var screenHeight = screen.height;
  49.                 var windowTitleHeight=20;
  50.                 var windowFrameWidth=(7*2);
  51.                 var windowFrameHeight=(15*2);
  52.                 var menuBarHeight = 0;
  53.     
  54.                 var thePlatform = new String(navigator.userAgent);
  55.                 var x=thePlatform.indexOf("(")+1;
  56.                 var y=thePlatform.indexOf(";",x+1);
  57.                 thePlatform=thePlatform.substring(x,y);
  58.                 if (thePlatform == "Macintosh")    {        // Macintosh support
  59.                     menuBarHeight = 20;                    // adjust for menubar size
  60.                     screenHeight = screenHeight - menuBarHeight;
  61.                     }
  62.     
  63.                 var ourWidth = 640 - windowFrameWidth;
  64.                 var ourHeight = 480 - menuBarHeight - windowFrameHeight;                    
  65.                 var x = (screenWidth/2) - (ourWidth/2) - windowFrameWidth;
  66.                 var y = (screenHeight/2) - (ourHeight/2) - windowTitleHeight - windowFrameHeight;
  67.     
  68.                 if (x<-3)    x=-3;
  69.                 if (y<0)    y=0;
  70.                 moveTo(x,y);
  71.                 if (ourWidth > screenWidth)        ourWidth = screenWidth;
  72.                 if (ourHeight > screenHeight)    ourHeight = screenHeight;
  73.                 resizeTo(ourWidth,ourHeight);
  74.     
  75.                 window.setHotkeys(false);
  76.                 window.setResizable(false);
  77.     
  78.                 navigator.preference("general.always_load_images", true);
  79.                 navigator.preference("browser.enable_style_sheets", true);
  80.                 navigator.preference("browser.mac.show_tool_tips", false);
  81.                 }
  82.             }
  83.         window.location.replace("setup.htm");
  84.         }
  85. }
  86.  
  87.  
  88.  
  89. // end hiding contents from old browsers  -->
  90.