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

  1. <!--  to hide script contents from old browsers
  2.  
  3.  
  4.  
  5. function loadData()
  6. {
  7.     if (navigator.javaEnabled() == false)    {
  8.         document.layers["needJava"].visibility = "show";
  9.         }
  10.     else    {
  11.         netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  12.     
  13.         // check browser version
  14.         var theAgent=navigator.userAgent;
  15.         var x=theAgent.indexOf("/");
  16.         if (x>=0)    {
  17.             theVersion=theAgent.substring(x+1,theAgent.length);
  18.             x=theVersion.indexOf(".");
  19.             if (x>0)    {
  20.                 theVersion=theVersion.substring(0,x);
  21.                 }            
  22.             if (parseInt(theVersion)>=4)    {
  23.                 top.toolbar.visible=false;
  24.                 top.menubar.visible=false;
  25.                 top.locationbar.visible=false;
  26.                 top.personalbar.visible=false;
  27.                 top.statusbar.visible=false;
  28.                 top.scrollbars.visible=false;
  29.     
  30.                 var screenWidth = screen.width;
  31.                 var screenHeight = screen.height;
  32.                 var windowTitleHeight=20;
  33.                 var windowFrameWidth=(7*2);
  34.                 var windowFrameHeight=(15*2);
  35.                 var menuBarHeight = 0;
  36.     
  37.                 var thePlatform = new String(navigator.userAgent);
  38.                 var x=thePlatform.indexOf("(")+1;
  39.                 var y=thePlatform.indexOf(";",x+1);
  40.                 thePlatform=thePlatform.substring(x,y);
  41.                 if (thePlatform == "Macintosh")    {        // Macintosh support
  42.                     menuBarHeight = 20;                    // adjust for menubar size
  43.                     screenHeight = screenHeight - menuBarHeight;
  44.                     }
  45.     
  46.                 var ourWidth = 640 - windowFrameWidth;
  47.                 var ourHeight = 480 - menuBarHeight - windowFrameHeight;                    
  48.                 var x = (screenWidth/2) - (ourWidth/2) - windowFrameWidth;
  49.                 var y = (screenHeight/2) - (ourHeight/2) - windowTitleHeight - windowFrameHeight;
  50.     
  51.                 if (x<-3)    x=-3;
  52.                 if (y<0)    y=0;
  53.                 moveTo(x,y);
  54.                 if (ourWidth > screenWidth)        ourWidth = screenWidth;
  55.                 if (ourHeight > screenHeight)    ourHeight = screenHeight;
  56.                 resizeTo(ourWidth,ourHeight);
  57.     
  58.                 window.setHotkeys(false);
  59.                 window.setResizable(false);
  60.     
  61.                 navigator.preference("general.always_load_images", true);
  62.                 navigator.preference("browser.enable_style_sheets", true);
  63.                 navigator.preference("browser.mac.show_tool_tips", false);
  64.                 }
  65.             }
  66.         window.location.replace("setup.htm");
  67.         }
  68. }
  69.  
  70.  
  71.  
  72. // end hiding contents from old browsers  -->
  73.