home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 July / PCpro_2004_07.ISO / docs / maxblast / maxblast3_files / thing_005.js < prev    next >
Encoding:
JavaScript  |  2004-03-07  |  1.1 KB  |  34 lines

  1. /********************************************************************************
  2.  
  3.     Detection Variables
  4.  
  5. ********************************************************************************/
  6. function Is(){
  7.     var appName = navigator.appName;
  8.     var version = navigator.appVersion;
  9.     
  10.     this.ns = ( appName == "Netscape" );
  11.     this.ns4 = this.ns && version.indexOf("4.")!=-1;
  12.     this.ns5 = this.ns && version.indexOf("5.")==0;
  13.     this.ns6 = ( this.ns5 || (this.ns && version.indexOf("6.")!=-1) );
  14.  
  15.     this.ie = ( appName == "Microsoft Internet Explorer" );
  16.     this.ie4 = this.ie && version.indexOf("MSIE 4.")!=-1;
  17.     this.ie5 = this.ie && version.indexOf("MSIE 5.")!=-1;
  18.     this.ie6 = this.ie && version.indexOf("MSIE 6.")!=-1;
  19.     
  20.     var userAgent = navigator.userAgent.toLowerCase();
  21.     this.mac = ( userAgent.indexOf( "mac" ) != -1 );
  22.     this.win = ( userAgent.indexOf( "windows" ) != -1 );
  23.     this.linux = ( userAgent.indexOf( "linux" ) != -1 );
  24. }
  25. Is.prototype.toString = function(){
  26.     var s = '';
  27.     for( var i in this ){
  28.         s += i + ': ' + this[i] + '\n';
  29.     }
  30.     return s;
  31. }
  32. var is = new Is();
  33.  
  34.