// Copyright plan_b media 2000
// ALL RIGHTS RESERVED
// platform object

function platformclass() 
{
	// Browser
	var b = navigator.appName
	var ua = navigator.userAgent.toLowerCase()
	var netscapebrowser = (ua.indexOf("mozilla") >-1 && ua.indexOf("compatible")==-1 && ua.indexOf("opera")==-1)
	var iebrowser = (ua.indexOf("msie")>-1)
   this.internetexplorer = false
	this.netscape = false

	if (netscapebrowser)
	{
		this.b = "ns";
		this.netscape = true;
	   this.doc = "document.";
    	this.sty = "";
		this.show = "show";
		this.hide = "hide";
	}
	else if (iebrowser)
	{
		this.b = "ie"
		this.internetexplorer = true;
		this.doc = "document.all.";
    	this.sty = ".style";
		this.show = "visible";
		this.hide = "hidden";
	}
	else
	{
		this.b = b
		this.doc = null;
		this.sty = null;
		this.show = null;
		this.hide = null;
	}

	// Version
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
	this.win9X = ((navigator.appVersion.indexOf("Win9") != -1) || (navigator.appVersion.indexOf("Windows 9") != -1))
	this.winnt = ((navigator.appVersion.indexOf("WinNT") != -1) || (navigator.appVersion.indexOf("Windows NT") != -1))
	this.windows = (this.win9X || this.winnt || (navigator.appVersion.indexOf("Windows") != -1))
	this.macintosh = (navigator.appVersion.indexOf("Macintosh") != -1)

	// Funktionen
	this.accessObject = accessObject;
	this.showObject = showObject;
	this.hideObject = hideObject;
	this.writeMessage = writeMessage;
}

function accessObject(objname)
{
	return this.doc + objname + this.sty;
}

function showObject(obj) 
{
	eval(this.accessObject(obj) + '.visibility = "' + this.show + '"');
}

function hideObject(obj) 
{
	eval(this.accessObject(obj) + '.visibility = "' + this.hide + '"');
}

function writeMessage(layername, message)
{
	if (this.ns)
	{
//document.layers["anzeige"].document.open()
//document.layers["anzeige"].document.write("my text here")
//document.layers["anzeige"].document.close()
  		eval('document.' + layername + '.document.open()');
  		eval('document.' + layername + '.document.write("' + message + '")');
  		eval('document.' + layername + '.document.close()');
//document.write("test");
	
	}
	else
	{
		if (eval('document.all.' + layername + ' != null'))
			eval('document.all.' + layername + '.innerHTML = "' + message + '"')
	}	
}


// "automatically" create the "is" object
is = new platformclass()

