// Browser-Sniffer
function Is () {
	var agt = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.nav  = ((agt.indexOf('mozilla') != -1) && (agt.indexOf('spoofer') == -1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera') == -1) && (agt.indexOf('webtv') == -1) && (agt.indexOf('hotjava') == -1));
	this.nav4 = (this.nav && (this.major == 4));
	this.nav6up = (this.nav && (this.major >= 5));
    this.ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie4up = (this.ie && (this.major >= 4));
    this.ie5 = (this.ie && agt.indexOf("msie 5") != -1);
    this.ie6 = (this.ie && agt.indexOf("msie 6") != -1);
    this.win = ((agt.indexOf("win") != -1));
    this.mac = (agt.indexOf("mac") != -1);
    this.opera = (agt.indexOf("opera") != -1);
    this.opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1);
	// todo: Flash!!!
}
var is = new Is();
if (!is.nav6up && !is.opera7 && (!is.ie4up || (is.mac && !(is.ie5 || is.ie6)))) top.location.href = "sorry.html";

// XBrowser-Funktionen
function getDocumentWidth(){
	if (is.ie4up) return document.body.offsetWidth;
	else return window.innerWidth;
}
function getDocumentHeight(){
	if (is.ie4up) return document.body.offsetHeight;
	else return window.innerHeight;
}
function getObject(objectId){
	if (is.nav4) return document[objectId].document;
	else if (is.ie4up) return window[objectId];
	else return document.getElementById(objectId); 
}
function getStyle(objectId){
	if (is.nav4) return document[objectId];
	else if (is.ie4up) return document.all(objectId).style;
	else return document.getElementById(objectId).style;
}
function getImage(layerId, name){
	if (is.nav4) return document[layerId].document[name];
	else if (is.ie4up) return window[name];
	else return document.images[name]; 
}
function toggleLayer(layerId, state){
	var visible = (is.nav4)?"show":"visible";
	var hidden = (is.nav4)?"hide":"hidden";
	if (state == 0) getStyle(layerId).visibility = hidden;
	if (state == 1) getStyle(layerId).visibility = visible;
}
function fillLayer(layerId, content){
	if (is.nav4){
		with (getObject(layerId)){
			open();
			write(content);
			close();
		}
	} else {
		getObject(layerId).innerHTML = content;
	}
}
