function whatPlatform()
{

	plat="other"

	thisAgent = navigator.userAgent.toLowerCase()

	// the order of the names is important, since these are not nested ifs

	if (thisAgent.indexOf("win") != -1)
	{
		plat="win"
	}
	if (thisAgent.indexOf("95") != -1)
	{
		plat="win"
	}
	if (thisAgent.indexOf("98") != -1)
	{
		plat="win"
	}
	if (thisAgent.indexOf("nt") != -1)
	{
		plat="win"
	}


	if (thisAgent.indexOf("mac") != -1)
	{
		var MacOSXPlugIn = navigator.plugins["Default Plugin Carbon.cfm"];
		if (MacOSXPlugIn || thisAgent.indexOf("omniweb") != -1 )
		{
			//Change value to true to enable the applet for Mac OS X
			//This variable has been introduced to this page as the support for
			//applets on Mac OS X has been questionable.
			enableAppletForMacOSX = true
			plat="macosx"
		}
		if (thisAgent.indexOf("os x") != -1)
		{
			enableAppletForMacOSX = true
			plat="macosx"
		}
	}

	if (thisAgent.indexOf("sun") != -1)
	{
		plat="solaris"
	}
	if (thisAgent.indexOf("solaris") != -1)
	{
		plat="solaris"
	}
	if (thisAgent.indexOf("aix") != -1)
	{
		plat="aix"
	}
	if (thisAgent.indexOf("ibm") != -1)
	{
		plat="aix"
	}
	if (thisAgent.indexOf("dec") != -1)
	{
		plat="digitalunix"
	}
	if (thisAgent.indexOf("osf") != -1)
	{
		plat="digitalunix"
	}
	if (thisAgent.indexOf("windows") == -1 && thisAgent.indexOf("digital") != -1 )
	{
		plat="digitalunix"
	}
	if (thisAgent.indexOf("hp") != -1)
	{
		plat="hpux"
	}
	if (thisAgent.indexOf("unix") != -1)
	{
		plat="unix"
	}
	if (thisAgent.indexOf("sco") != -1)
	{
		plat="sco"
	}
	if (thisAgent.indexOf("bsd") != -1)
	{
		plat="bsd"
	}
	if (thisAgent.indexOf("free") != -1)
	{
		plat="freebsd"
	}
	if (thisAgent.indexOf("open") != -1)
	{
		plat="openbsd"
	}
	if (thisAgent.indexOf("netbsd") != -1)
	{
		plat="netbsd"
	}
	if (thisAgent.indexOf("linux") != -1)
	{
		plat="linux"
	}
	if (thisAgent.indexOf("reliant") != -1)
	{
		plat="reliant"
	}

	if (thisAgent.indexOf("sgi") != -1)
	{
		plat="irix"
	}
	if (thisAgent.indexOf("silicon") != -1)
	{
		plat="irix"
	}
	if (thisAgent.indexOf("irix") != -1)
	{
		plat="irix"
	}
	if (thisAgent.indexOf("os/390") != -1)
	{
		plat="os390"
	}


	// now determine what platforms are available, and reset the chosen platform based on whether the platform is available
	// if you want the user to get a message that the desired platform is NOT available, set the fallback "plat" to "notavailable"
	// the order is important, as it indicated the fallback order
	// every platform above, must have a fall back below

	platAvail="notavailable"


	platAvail="win"

	if ((plat=="win") && (platAvail!="win"))
	{
		plat="other"
	}


	platAvail="macosx"

	if ((plat=="macosx") && (platAvail!="macosx"))
	{
		plat="unix"
	}


	platAvail="solaris"

	if ((plat=="solaris") && (platAvail!="solaris"))
	{
		plat="unix"
	}


	if ((plat=="aix") && (platAvail!="aix"))
	{
		plat="unix"
	}


	if ((plat=="digitalunix") && (platAvail!="digitalunix"))
	{
		plat="unix"
	}


	if ((plat=="hpux") && (platAvail!="hpux"))
	{
		plat="unix"
	}


	if ((plat=="sco") && (platAvail!="sco"))
	{
		plat="unix"
	}


	if ((plat=="freebsd") && (platAvail!="freebsd"))
	{
		plat="bsd"
	}


	if ((plat=="openbsd") && (platAvail!="openbsd"))
	{
		plat="bsd"
	}


	if ((plat=="netbsd") && (platAvail!="netbsd"))
	{
		plat="bsd"
	}


	if ((plat=="bsd") && (platAvail!="bsd"))
	{
		plat="unix"
	}


	platAvail="linux"

	if ((plat=="linux") && (platAvail!="linux"))
	{
		plat="unix"
	}


	if ((plat=="reliant") && (platAvail!="reliant"))
	{
		plat="unix"
	}


	if ((plat=="irix") && (platAvail!="irix"))
	{
		plat="unix"
	}


	if ((plat=="os390") && (platAvail!="os390"))
	{
		plat="unix"
	}


	platAvail="unix"

	if ((plat=="unix") && (platAvail!="unix"))
	{
		plat="other"
	}


	if ((plat=="other") && (platAvail!="other"))
	{
		plat="notavailable"
	}

}


function platformButtons()
{
	document.writeln("<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\" size=\"3\">")
	
	if (plat=="win")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/Windows/VM/installSPT.exe\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (55.1M) for Windows (includes Java VM)\" >")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	
	if (plat=="macosx")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/MacOSX/installSPT.zip\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (30.1M) for Mac OS X (without Java VM)\" ><br>")
		//
		if( enableAppletForMacOSX )
		{
			document.writeln("<br></form>")
			document.writeln("Enable Java in your browser to install directly from the web.<br>")
		}
	}
	
	
	if (plat=="solaris")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/Solaris/VM/installSPT.bin\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (80.5M) for Solaris (includes Java VM)\" ><br>")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	if (plat=="solaris")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	if (plat=="linux")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/Linux/VM/installSPT.bin\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (82.1M) for Linux (includes Java VM)\" ><br>")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	if (plat=="linux")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	
	
	
	
	if (plat=="aix")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/UNIX_with_VM/VM/installSPT.bin\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (82.1M) for Unix (includes Java VM)\" ><br>")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	if (plat=="aix")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/UNIX_with_VM/NoVM/installSPT.bin\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (33.2M) for Unix\" ><br>")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	
	if (plat=="unix")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("InstData/GenericUnix/installSPT.bin\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer (33.2M) for Unix\" ><br>")
		//
		document.writeln("<br></form>")
		document.writeln("Enable Java in your browser to install directly from the web.<br>")
	}
	
	if (plat=="other")
	{
		document.writeln("<b>Recommended installer for your platform...</b><br>")
		document.write("<form method=\"get\" action=\"")
		
		document.write("\">")
		//
		
		document.writeln("<input type=\"SUBMIT\" value=\"Download Installer ()\" ><br>")
		//
		document.writeln("<br></form>")
	}
	if (plat=="notavailable")
	{
		document.writeln("<b>There is no installer available for your platform.<br>")
		document.writeln("Please select an alternate platform below.</b><br>")
	}

	document.writeln("</font>")
}

function setArchiveFile()
{
	if (plat!="macosx" || ( plat=="macosx" && enableAppletForMacOSX ))
	{		
		if (plat!="mac")
		{
			document.writeln("<applet codebase=\"InstData\" archive=\"WebInst.jar\" code=\"com.zerog.ia.download.WebInstallerApplet\" width=\"525\" height=\"85\">")
		}
		if (plat=="mac")
		{
			document.writeln("<applet codebase=\"InstData\" archive=\"WebInstMac.jar\" code=\"com.zerog.ia.download.WebInstallerApplet\" width=\"525\" height=\"85\">")
		}
	}
}

function displayMarker(whatPlat)
{
	if (whatPlat==plat)
	{
		document.write("<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\" color=\"green\"><b>&gt</b></font>")
	}
}


function setPlatFont(whatPlat)
{

	if (whatPlat==plat)
	{
		document.write("<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\" color=\"green\"><b>")
	}
	else
	{
		document.write("<font face=\"Arial,Helvetica,Geneva,Swiss,SunSans-Regular\">")
	}
}
