home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd2.bin / ruzne / painter / PAINTE~2.cab / _E0B724FD832B49E7A05C964E2889690F < prev    next >
Text File  |  2003-01-06  |  2KB  |  72 lines

  1. // Copyright (c) 2000-2001 Quadralay Corporation.  All rights reserved.
  2. // 
  3.  
  4. function  BrowserDetect_Object()
  5. {
  6.   var  Agent = "";
  7.   var  MajorVersion = 0;
  8.  
  9.  
  10.   // Determine browser
  11.   //
  12.   this.mBrowser = 0;      // Shorthand for Unknown
  13.   this.mbWindowIE40 = 0;  // Needed for special case handling
  14.  
  15.   Agent = navigator.userAgent.toLowerCase();
  16.   if ((Agent.indexOf("mozilla") != -1) &&
  17.       (Agent.indexOf("spoofer") == -1) &&
  18.       (Agent.indexOf("compatible") == -1))
  19.   {
  20.     MajorVersion = parseInt(navigator.appVersion)
  21.  
  22.     if (MajorVersion >= 5)
  23.     {
  24.       this.mBrowser = 4;  // Shorthand for Netscape 6.0
  25.     }
  26.     else if (MajorVersion >= 4)
  27.     {
  28.       this.mBrowser = 1;  // Shorthand for Netscape
  29.     }
  30.   }
  31.   else if (Agent.indexOf("msie") != -1)
  32.   {
  33.     MajorVersion = parseInt(navigator.appVersion)
  34.     if (MajorVersion >= 4)
  35.     {
  36.       var  VersionString;
  37.  
  38.  
  39.       this.mBrowser = 2;  // Shorthand for IE
  40.  
  41.       // Additional info needed for popups
  42.       //
  43.       VersionString = navigator.appVersion.toLowerCase();
  44.       MSIEVersionString = VersionString.substring(VersionString.indexOf("msie") + 4);
  45.       Version = parseFloat(MSIEVersionString);
  46.       if ((Version >= 4.0) &&
  47.           (Version < 4.1))
  48.       {
  49.         this.mbWindowsIE40 = true;
  50.       }
  51.     }
  52.   }
  53.   else if (Agent.indexOf("icab") != -1)
  54.   {
  55.     this.mBrowser = 3;  // Shorthand for iCab
  56.   }
  57.  
  58.   // Determine platform
  59.   //
  60.   this.mPlatform = 0;  // Shorthand for Unknown
  61.  
  62.   if ((Agent.indexOf("win") != -1) ||
  63.       (Agent.indexOf("16bit") != -1))
  64.   {
  65.     this.mPlatform = 1;  // Shorthand for Windows
  66.   }
  67.   else if (Agent.indexOf("mac") != -1)
  68.   {
  69.     this.mPlatform = 2;  // Shorthand for Macintosh
  70.   }
  71. }
  72.