home *** CD-ROM | disk | FTP | other *** search
-
- function BrowserType()
- {
- if ((navigator.appVersion.indexOf("Mac")!=-1)
- && (navigator.userAgent.indexOf("MSIE")!=-1)
- && (parseInt(navigator.appVersion)==3))
- this.ie3Mac = true;
- else {
- // convert all characters to lowercase to simplify testing
- var agt=navigator.userAgent.toLowerCase();
-
- // Note: On IE5, these return 4, so use is.ie5up to detect IE5.
- this.major = parseInt(navigator.appVersion);
- this.minor = parseFloat(navigator.appVersion);
- this.opera = (agt.indexOf("opera") != -1);
-
- this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
- && (agt.indexOf('compatible') == -1) && (! this.opera)
- && (agt.indexOf('webtv')==-1));
- this.nav2 = (this.nav && (this.major == 2));
- this.nav3 = (this.nav && (this.major == 3));
- this.nav4 = (this.nav && (this.major == 4));
- this.nav4up = (this.nav && (this.major >= 4));
- this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) ||
- (agt.indexOf("; nav") != -1)) );
- this.nav5 = (this.nav && (this.major == 5));
- this.nav5up = (this.nav && (this.major >= 5));
-
- this.ie = (agt.indexOf("msie") != -1);
- this.ie3 = (this.ie && (this.major < 4));
- this.ie4 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")==-1) );
- this.ie4up = (this.ie && (this.major >= 4));
- this.ie5 = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
- this.ie5up = (this.ie && !this.ie3 && !this.ie4);
- }
- }
-
- var isBrowser;
- isBrowser = new BrowserType();
-