userAgent = window.navigator.userAgent;
browserVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);

function Is() {
	var agent   = navigator.userAgent.toLowerCase();
	this.major  = parseInt(navigator.appVersion);
	this.minor  = parseFloat(navigator.appVersion);
	this.ns     =	((agent.indexOf('mozilla')   != -1) &&
								(agent.indexOf('spoofer')    == -1) &&
								(agent.indexOf('compatible') == -1) &&
								(agent.indexOf('opera')      == -1) &&
								(agent.indexOf('webtv')      == -1));
	this.ns4		=	(this.ns && (this.major      ==  4));
	this.ns6		=	(this.ns && (this.major      >=  5));
	this.ie			=	(agent.indexOf("msie")       != -1);
	this.ie3		=	(this.ie && (this.major      <   4));
	this.ie4		=	(this.ie && (this.major      >= 4));
	this.ie5		=	(this.ie && (this.major      ==  4) &&
								(agent.indexOf("msie 5.0")   != -1));
	this.ieX		=	(this.ie && !this.ie3 && !this.ie4);
}

var is = new Is();

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function findElement(n,ly) {
	if (browserVers < 4)		return document[n];
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (!elem) {
		for (var i=0;i<curDoc.layers.length;i++) {
			elem = findElement(n,curDoc.layers[i]);
			if (elem) return elem;
		}
	}
	return elem;
}

function changeImages() {
	if (document.images /* && (preloadFlag == true)*/) {
		var img;
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			img = null;
			if (document.layers) {
				img = findElement(changeImages.arguments[i],0);
			}
			else {
				img = document.images[changeImages.arguments[i]];
			}
			if (img) {
				img.src = changeImages.arguments[i+1];
			}
		}
	}
}

function showId(id) {
	if (id) {
		if (is.ie5||is.ns6){
			obj = document.getElementById(id).style;
			obj.visibility = "visible";
		} else if(is.ie4) {
			obj = document.all[id].style;
			obj.visibility = "visible";
		} else if(is.ns4) {
			obj = document.layers[id];
			obj.visibility = "show";
		}
	}
}

function hideId(id) {
	if (id) {
		if (is.ie5||is.ns6){
			obj = document.getElementById(id).style;
			obj.visibility = "hidden";
		} else if(is.ie4) {
			obj = document.all[id].style;
			obj.visibility = "hidden";
		} else if(is.ns4) {
			obj = document.layers[id];
			obj.visibility = "hide";
		}
	}
}

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) {
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}


function reload() {
	url = window.self.document.location;
	window.top.document.location = url;
}

function loadUrl(framename, url) {
/*	for(i in window.parent.statusleiste) {
		window.parent.content.document.write(i);
		window.parent.content.document.write("<BR>");
	}
*/
	if((parent.frames.length != 0) && (window.parent[framename].document.location != url)) {
	window.parent[framename].document.location = url;
	}
}
