function systemdetect()
{
systemname=navigator.platform;
if (systemname.indexOf("Linux armv6l")!=-1) {
systemname="pi"
document.write("<p>this is a test.</P>")
}
else {if (systemname.indexOf("Win32")!=-1) {
systemname="MS 32"
document.write("<p>this is a Win32 tes.</P>")
}
else {systemname="N/A"}};
}
is what i ended up using to test for PI