// Copyright 2000 by Thomas Otto

dom=document.getElementById?1:0
ie5=(document.all && dom)?1:0;
ie4=(document.all && !dom)?1:0;
ns5=(dom && !document.all) ?1:0;
ns4=(document.layers && !dom)?1:0;

function createLayer(obj,nest){
	nest = (!nest)?'':'document.'+nest+'.';
	this.el=dom?document.getElementById(obj):ns4?eval(nest+'document.'+obj):ie4?document.all[obj]:0;
	this.css=(!ns4)?this.el.style:this.el;
	this.height=(!ns4)?this.el.offsetHeight:this.css.document.height;
	this.clipHeight=(!ns4)?this.el.offsetHeight:this.css.clip.height;
	this.x=(ns4||ns5)?this.css.left:this.css.pixelLeft;
	this.y=(ns4||ns5)?this.css.top:this.css.pixelTop;
	this.moveBy = layer_moveBy;
	this.top = gettop;
}

var active=0;
var timer=50;
var src;
var oben;

function layer_moveBy(x, y) {
	this.x = parseInt(this.x) + x;
	this.y = parseInt(this.y) + y;
	this.css.left = this.x;
	this.css.top = this.y;
}

function gettop(){
	oben = eval(parseInt(this.y));
	return oben;
}
 
function scroll(speed){
	src = setTimeout("scroll("+speed+")",timer);
	if (speed>0 && text[active].top()>=0){
	stop();
	}
	else text[active].moveBy(0,speed);
	if (speed<0 && text[active].top()<=-parseInt(text[active].height-container.clipHeight)) {
	stop();
	text[active].moveBy(0,Math.abs(speed));
	}  
}

function stop(){
	clearTimeout(src)
}

function swap(num){
	text[active].css.visibility='hidden';
	active=num;
	text[active].y=0;
	text[active].css.top=0;
	text[active].css.visibility='visible';
}