// 2002 (c) www.reizverstaerker.at

// author: christoph scheiblhofer



// browser functions

	function browserCheck() {

		this.ver=navigator.appVersion;

		this.agent=navigator.userAgent;

		this.dom=document.getElementById?1:0;

		this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0;

		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 

		this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

		this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

		this.ie=this.ie4||this.ie5||this.ie6;

		this.mac=this.agent.indexOf("Mac")>-1;

		this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 

		this.ns4=(document.layers && !this.dom)?1:0;

		this.enable=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);

		return this;

	} //browserCheck

	

	var browser=browserCheck();

	

	function newBrowserWindow(fileName, windowTitle, w, h) {

		this.window = open(fileName, windowTitle, "width="+w+", height="+h+", status=no, menubar=no, locationbar=no, resizeable=no, dependent=yes, scrollbars=yes");

	} //newBrowserWindow









// document functions

	function documentSize() {

		this.x=0;

		this.x2=browser.ie && document.body.offsetWidth-20||innerWidth||0;

		if (browser.ns6)

			this.x2-=2;

		this.y=0;

		this.y2=browser.ie && document.body.offsetHeight-5||innerHeight||0;

		if (browser.ns6)

			this.y2-=4;

		if (!this.x2 || !this.y2)

			return message('ERROR: This document has no width or height.');

		this.x50=this.x2/2;

		this.y50=this.y2/2;

		this.x10=(this.x2*10)/100;

		this.y10=(this.y2*10)/100;

		this.ytop=140*100/this.y2;

		this.avail=(this.y2*(100-this.ytop))/100;

		this.origy=this.y2;

		return this;

	} //documentSize







// error functions

	function message(alertString) {

		alert(alertString);

	} //message
