// JavaScript Document www.muessmann-umweltschutz.de

////////////// Keep in view
KeepInView = function(KIV_id){
	var KIV_getPageY=function(KIV_el){
		return(KIV_el==null)?0:KIV_el.offsetTop+KIV_getPageY(KIV_el.offsetParent);
	}
	
	var KIV_getScrollTop=function(){
		return document.body.scrollTop||document.documentElement.scrollTop
	}
	
	var KIV_el=document.getElementById(KIV_id);
	
	if(KIV_el==null){
		return;
	}
	
	if(KIV_el.style.position=="absolute"){
		KIV_el.startPageTop=-KIV_el.offsetTop;
		KIV_el.currentX=KIV_el.offsetLeft;
		KIV_el.currentY=KIV_el.offsetTop;
	} else{
		KIV_el.style.position="relative";
		KIV_el.startPageTop=KIV_getPageY(KIV_el);
		KIV_el.currentX=KIV_el.currentY=0;
	}
	
	KIV_el.KIV_floatInView=function(){
		var KIV_targetY=(KIV_getScrollTop()>this.startPageTop)?KIV_getScrollTop()-this.startPageTop:0;
		this.currentY+=(KIV_targetY-this.currentY)/4;
		this.style.top=this.currentY+"px";
	};
	
	setInterval('document.getElementById("'+KIV_id+'").KIV_floatInView()',40);
}
////////////////
