Detect MacOS X or 9

Does anyone have a java script or jsp code snipplet that
can distinguish the difference between MacOSX and <=MacOS9?

I know how to detect a MACINTOSH computer, but not
the different mac operating systems...

String strAgentOS = request.getHeader("ua-os");
String strAgent = request.getHeader("user-agent");
if (strAgentOS != null && strAgentOS.indexOf("MacOS") != -1)
{ bMac = true; }
else if (strAgent != null && strAgent.indexOf("Macintosh") != -1)
{ bMac = true; }
[516 byte] By [Mousey] at [2007-11-17 17:05:04]