/**
 * $Id: detect.js 323 2004-11-22 02:46:52Z eofredj $
 * Oxygen v1.1.3 © 2002-2004 Oxygen Development Team
 * http://www.o2php.com
 *
 * Please see GPL.txt in the docs/ directory of this distribution.
 *
 * File Last Updated: Sun, 28 Nov 2004 02:58:48 +0100
 */
// Ultimate client-side JavaScript client sniff. 
// (C) Netscape Communications 1999.  Permission granted to reuse and distribute. 
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below). 
// Everything you always wanted to know about your JavaScript client 
// but were afraid to ask. Creates "is_" variables indicating: 
// (1) browser vendor: 
//     is_nav, is_ie, is_opera 
// (2) browser version number: 
//     is_major (integer indicating major version number: 2, 3, 4 ...) 
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...) 
// (3) browser vendor AND major version number 
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, is_ie3, is_ie4, is_ie4up 
// convert all characters to lowercase to simplify testing 
var agt = navigator.userAgent.toLowerCase(); 

// *** BROWSER VERSION *** 
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

// Note: Opera and WebTV spoof Navigator.  We do strict client detection. 
// If you want to allow spoofing, take out the tests for opera and webtv. 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
			&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
			&& (agt.indexOf('webtv')==-1)); 
var is_nav2 = (is_nav && (is_major == 2)); 
var is_nav3 = (is_nav && (is_major == 3)); 
var is_nav4 = (is_nav && (is_major == 4)); 
var is_nav4up = (is_nav && (is_major >= 4)); 
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) || 
					  (agt.indexOf("; nav") != -1)) ); 
var is_nav5 = (is_nav && (is_major == 5)); 
var is_nav5up = (is_nav && (is_major >= 5)); 

var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); 
var is_ie4up  = (is_ie  && (is_major >= 4)); 
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); 

var is_opera = (agt.indexOf("opera") != -1); 

function FindID(id) {
	if(document.layers) return document.layers[id];
	if(document.all && !document.getElementById) return document.all[id];
	if(document.all && document.getElementById) return document.getElementById(id);
	if(!document.all && document.getElementById) return document.getElementById(id);
}

function FindForm(name, id) {
	return document.forms[name][id];
}