/*
Plugin Detector()

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Totaly Changed By: Jan-Willem Jonker for Eyefi interactive (c) 2001-2002

Functions: 	- createClientObject()
*/

/* browser check starts here */
function createClientObject(){
    this.ver = navigator.appVersion.toLowerCase();
    this.userAgent = navigator.userAgent.toLowerCase();
    this.appName = navigator.appName.toLowerCase();
    this.appCodeName = navigator.appCodeName.toLowerCase();
    this.dom = document.getElementById?1:0;
    this.tag = document.getElementsByTagName?1:0;

    this.ie6 = (this.ver.indexOf("msie 6")!=-1 && this.dom)?1:0;
    this.ie55 = (this.ver.indexOf("msie 5.5")!=-1 && this.dom)?1:0;
    this.ie5 = (!this.ie55 && this.ver.indexOf("msie 5")!=-1 && this.dom)?1:0;
    this.ie4 = (document.all && !this.dom && parseInt(this.ver) == 4 )?1:0;
    this.ie45 = null; //see below at this.mac
    this.ie3 = (document.all && !this.dom && parseInt(this.ver) == 3 )?1:0;
    this.ie = (this.ie3 || this.ie4 || this.ie5 || this.ie55 || this.ie6);

    this.op = (this.userAgent.indexOf("opera")!=-1)?1:0;
    this.op4 = (this.op && parseInt(this.ver) == 4)?1:0;
    this.op5 = (this.op && parseInt(this.ver) == 5)?1:0;

    this.ns3 = (document.layers && parseInt(this.ver) < 4)?1:0;
    this.ns6 = (this.dom && parseInt(this.ver) >= 5 && this.userAgent.indexOf("netscape6")!=-1)?1:0;
    this.ns4hi = (document.layers && parseFloat(this.ver) >= 4.07)?1:0;
    this.ns4low = (document.layers && !this.ns4hi && !this.ns3 )?1:0;
	this.ns4 = (this.ns4low || this.ns4hi)?1:0;
    this.mozilla = (this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns = (this.ns6 || this.ns4low || this.ns4hi || this.ns3)?1:0;

    this.platform = navigator.platform.toLowerCase(); 
    this.mac=(this.platform.indexOf('mac') !=-1 || this.platform.indexOf('ppc') !=-1)?1:0;
    if(this.mac) this.ie45 = (document.all && !this.dom && parseFloat(this.ver) == 4.5 )?1:0;
    this.win=(this.platform.indexOf('win') !=-1)?1:0;
	if(this.win) {
		this.win95=(this.win && this.ver.indexOf('windows 95') !=-1)?1:0;
		this.win98=(this.win && this.ver.indexOf('windows 98') !=-1)?1:0;
		this.winnt=(this.win && this.ver.indexOf('windows nt 4') !=-1)?1:0;
		this.winxp=(this.win && this.ver.indexOf('nt 5.1') !=-1)?1:0;
		this.win2k=(this.win && !this.winxp && this.ver.indexOf('nt 5')!=-1)?1:0;
	}
    this.unix= (this.platform.indexOf('unix') !=-1 || this.platform.indexOf('linux') != -1 || this.platform.indexOf('freebsd')!=-1 )?1:0;
	return this;
}
