/**
 * File: WhatPlatform.js
 *
 * Copyright 2003 by GraphOn Corporation
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of GraphOn Corporation ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with GraphOn.
 *
 * @author Jean-Claude Cote
 *     603.225.3525
 *     Jean-Claude@macadamian.com
 *     4/03/2001
 *
 * @version 1.00
 *
 * Determines which platform and which browser is executing this script.
 */

function whatPlatform()
{
   // Browser name string, major version, and agent string

	var name     = navigator.appName;
	var ver      = parseInt( navigator.appVersion );
	var agent    = navigator.userAgent;
	var platform = navigator.platform;

	// Microsoft Internet Explorer and version
	this.msie     = ( agent.indexOf("MSIE") != -1 );
	this.msie4up  = ( this.msie && (ver >= 4) );  

	// Netscape Navigator and version
	this.ns = ( name.indexOf("Netscape") != -1 );
	this.ns4up = ( this.ns && (ver >= 4) );

	// Netscape 6 version is actually version 5.0 when getting the appVersion proterty.	
	this.ns6up = ( this.ns && (ver >= 5) );

	this.ff3   = (agent.toLowerCase().indexOf("firefox/3") != -1);

	// Operating system, test both Netscape agent or MSIE agent strings.
	this.win95 = ((agent.indexOf("Win95")!=-1) || (agent.indexOf("Windows 95")!=-1));
	this.win98 = ((agent.indexOf("Win98")!=-1) || (agent.indexOf("Windows 98")!=-1));
	this.winnt = ((agent.indexOf("WinNT")!=-1) || (agent.indexOf("Windows NT")!=-1));
	
	this.win   = (agent.indexOf("Win") != -1);
		
	this.mac   = (agent.indexOf("Mac") != -1);
	this.sun   = (agent.indexOf("SunOS") != -1);
	this.linux = (agent.indexOf("Linux") != -1);
	this.os2   = (agent.indexOf("OS2") != -1) || (agent.indexOf("OS/2") != -1);
	
	this.ce    = (platform.indexOf("CE") != -1);
	this.ppc   = (agent.indexOf("PPC") != -1);

	// Look for the MRJ Plugin in Macintosh Netscape
	this.mrjPlugin = false;
	
	if ( this.mac && this.ns4up )
	{
		this.mrjPlugin = navigator.plugins["MRJ Java Plugin"] ? true : false;
	}
}
