//browser testen
function browserDetector(){ 
    this.version = navigator.appVersion;
    this.dom = document.getElementById ? 1 : 0;
    this.ie5 = (this.version.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0; 
    this.ie4 = (document.all && !this.dom) ? 1 : 0; 
    this.ns5 = (this.dom && parseInt(this.version) >= 5) ? 1 : 0; 
    this.ns4 = (document.layers && !this.dom) ? 1 : 0; 
    this.browser = (this.ie5 || this.ie4 || this.ns4 || this.ns5);
	this.mac = ((this.version.indexOf("MAC") > -1) || (this.version.indexOf("Macintosh") > -1) || (this.version.indexOf("PPC") > -1)) ? 1 : 0;
	this.pc = !this.mac;
    return this;
} 

bd = new browserDetector();
var speed=5;
var loop, timer;
var initialised;


function MakeObject(obj,nest){ 
    nest = (!nest) ? '' : 'document.' + nest + '.'; 
    this.element = bd.dom ? document.getElementById(obj) : bd.ie4 ? document.all[obj] : bd.ns4 ? eval(nest+'document.'+obj) : 0; 
    this.css = bd.dom ? document.getElementById(obj).style : bd.ie4 ? document.all[obj].style : bd.ns4 ? eval(nest+'document.'+obj) : 0; 
    this.scrollHeight = bd.ns4 ? this.css.document.height : this.element.offsetHeight;
    this.clipHeight = bd.ns4 ? this.css.clip.height : this.element.offsetHeight;
	this.up = MoveAreaUp;
	this.down = MoveAreaDown; 
    this.MoveArea = MoveArea; 
	this.x; 
	this.y; 
    this.obj = obj + "Object";
    eval(this.obj + "=this"); 
    return this;
}

function MoveArea(x,y){ 
    this.x = x;
	this.y = y; 
    this.css.left = this.x; 
    this.css.top = this.y; 
} 
 
function MoveAreaDown(move, height){ 
	if(this.y > -this.scrollHeight + height){ 
	    this.MoveArea(0,this.y - move);
   		if(loop) setTimeout(this.obj + ".down(" + move + ", " + height + ")", speed);
	} 
} 

function MoveAreaUp(move){ 
	if(this.y < 0){ 
		this.MoveArea(0, this.y - move); 
   		if(loop) setTimeout(this.obj + ".up(" + move + ")", speed);
	} 
} 

function MoveAreaDownOnce(move, who){ 
	CeaseScroll();
	if(who.y < 0){ 
		if (who.y - move>0){
			who.MoveArea(0,0);
		}
	    else{
			who.MoveArea(0,who.y - move);
			}
	} 
} 

function MoveAreaUpOnce(move,who,container){ 
	CeaseScroll();
	if((who.y < 0)&&(who.y > -who.clipHeight+ container.clipHeight)){ 
		if(who.y-move < -who.clipHeight+ container.clipHeight){
			who.MoveArea(0, -who.clipHeight+ container.clipHeight);
		}
		else{
		who.MoveArea(0, who.y - move); 
		}
	} 
}
 
function PerformScroll(speed, who, container){ 
	if(initialised){ 
		loop = true; 
		if(speed > 0) who.down(speed,container.clipHeight);
		else who.up(speed);
	} 
} 
 
function CeaseScroll(){ 
    loop = false;
    if(timer) clearTimeout(timer); 
} 

function invisibleCheck (obj1,obj2,container,content){
	if (container.clipHeight>content.clipHeight){
		obj1.css.visibility = 'hidden';
		obj2.css.visibility = 'hidden';
	}
}
/* DHTML ENDE */