home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / doc / directx6.1 / directx.chm / dxmedia / foundation / d3drm / ver.js < prev   
Encoding:
Text File  |  1999-03-03  |  559 b   |  19 lines

  1. // common sniffing code  
  2. g_sUA = window.navigator.appVersion;
  3.  
  4. if (parseInt(g_sUA.indexOf("MSIE ")) >= 0) // Check if IE
  5. {
  6.     g_isIE = true;
  7.     g_iMaj = parseInt(g_sUA.substring(g_sUA.indexOf("MSIE ")+5,g_sUA.indexOf (".",g_sUA.indexOf("MSIE "))));
  8.     if (g_sUA.lastIndexOf("Win") >= 0)
  9.         g_sPlat = "Win";
  10. }
  11. else if(parseInt(navigator.appName.lastIndexOf("Netscape"))>=0)
  12. {
  13.     g_isNav = true;
  14.     g_iMaj = parseInt(g_sUA.substring(0, g_sUA.indexOf('.')));
  15. }
  16.  
  17. g_isMac = g_sUA.indexOf("Mac") != -1;
  18. g_isGB = (g_isIE && g_iMaj >= 4 && g_sPlat == "Win");
  19.