I'm trying to writ a browser detection script and it seems to work but I was wondering if there is an easier way and/or if this was right.

Code:
<!--
//let's see what browser we have first (firefox test)
if (navigator.appName != "Netscape" || navigator.appVersion <= "5.0") {
	//let's see what IE browser they are running
	if(navigator.userAgent.indexOf("MSIE 6.0") < 6.0) {
	// show CSS header on page to display message and browser links
	window.alert("browser out of date!") //testing message;
		}
	}
}
-->

The line in question is

Code:
if(navigator.userAgent.indexOf("MSIE 6.0") < 6.0) {
-->
What I would like to do is show a message for IE older than 6.0 but all other attempts have failed with a syntax errors. It doesn't seem to be right because it only will test for 6.0 and ignore all others.

I'm working with a guy that has a client that still uses 5.2 on a mac, and they have several client using old browsers who say the page doesn't display properly. If that helps i any way.

I know there are several browser scripts out there but I am new to javascript and to copy and paste wouldn't help me understand the language so I decided to write my own instead so please excuse the neophyte question.

Thank you all in advance.