
//test for older browsers [ns<6 and ie<5]
//assumes browser is good
//sets is_ie5up and is_nav6up to false if tests fail
//sets is_mac
var agt, posIE, posNS1, posNS2, ver;
var is_ie5up=true, is_nav6up=true, is_mac=false;
agt = navigator.userAgent.toLowerCase();
//agt = "mozilla/4.8 [en] (windows nt 5.0; u)".toLowerCase();
posIE = agt.indexOf("msie");
posNS1 = agt.indexOf("mozilla");
posNS2 = agt.indexOf("netscape");
//test for 'msie'
if(posIE > -1){	//agt is reporting msie or compatable
	ver = parseFloat(agt.substring(posIE+5, agt.indexOf(';', posIE))); //alert("msie" + "\n" + ver);
	if(ver < 5){is_ie5up = false}
}else{is_ie5up = false}	//no 'msie' rules out ie
//test for 'netscape' first, then look for 'mozilla'
if(posNS2 > -1){	//agt is reporting netscape
	ver = parseFloat(agt.substr(posNS2+9)); //alert("netscape" + "\n" + ver);
	if(ver < 6){is_nav6up = false}	//'netscape' version below 6
	if(isNaN(ver)){		//format may be like 'netscape6/6.2.2'
		ver = parseFloat(agt.substr(posNS2+10)); //alert("nan netscape" + "\n" + ver);
		if(ver < 6){is_nav6up = false}	//'netscape' version below 6
	}
}
else if(posNS1 > -1){	//agt is reporting mozilla
	ver = parseFloat(agt.substr(posNS1+8)); //alert("mozilla" + "\n" + ver);
	if(ver < 5){is_nav6up = false}	//'mozilla' version below 5
}
//is browser a mac?
is_mac = (agt.indexOf("mac")!=-1);

//document.write("userAgent: " + agt + "<p>is_ie5up: " + is_ie5up + "<p>is_nav6up: " + is_nav6up + "<p>is_mac: " + is_mac);
//sample strings
//ns4:	mozilla/4.8 [en] (windows nt 5.0; u)
//		mozilla/4.0 (compatible; msie 6.0; windows nt 5.1)
//ie6:	Mozilla/4.0 (compatible; MSIE 6.0; Windows NT; MS Search 4.0 Robot)
//ie6:	Mozilla/4.0 (compatible; MSIE 6.0; AOL 8.0; Windows NT 5.1; .NET CLR 1.0.3705)
//		mozilla/5.0 (windows; u; windows nt 5.0; en-us; rv:0.9.4.1) gecko/20020314 netscape6/6.2.2
//		mozilla/5.0 (macintosh; u; ppc mac os x; en-us; rv:1.0.1) gecko/20020823 netscape/7.0
//		mozilla/5.0 (windows; u; windows nt 5.0; en-us; rv:1.4) gecko/20030624
//		Mozilla/9.876 (X11; U; Linux 2.2.12-20 i686, en) Gecko/25250101 Netscape/5.432b1 (C-MindSpring)
//		Netscape6/6.5 (Galeon/1.0.3 X11; U; FreeBSD i386; en-US; rv:0.9.8) Gecko/20020206
