
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie8=(this.ver.indexOf("MSIE 8")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie8 || this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()


/*** variables to configure... ***/

//var showDynPage_li = 0;
var numScrollPages_li = 1;       //Set the number of pages (layers) here. Add and remove the pages in the body too. The first layer is called dynPage0, the second is dynPage1, and so on.
var transitionOut_li = 0;       //The 'out' effect... 0= no effect, 1= fade
var transitionIn_li = 0;        //The 'in' effect... 0= no effect, 1= fade, 2= slide
var slideAcceleration = 0.2;   	//If you use the slide animation, set this somewhere between 0 and 1.
var transitionOnload_li = 0     //Use the 'in' transition when the page first loads? If you want the transition fx only when the links are clicked, you can set it to 0.

//var showDynPage_mi = 1;
var numScrollPages_mi = 1;       //Set the number of pages (layers) here. Add and remove the pages in the body too. The first layer is called dynPage0, the second is dynPage1, and so on.
var transitionOut_mi = 0;       //The 'out' effect... 0= no effect, 1= fade
var transitionIn_mi = 0;        //The 'in' effect... 0= no effect, 1= fade, 2= slide
var transitionOnload_mi = 1;     //Use the 'in' transition when the page first loads? If you want the transition fx only when the links are clicked, you can set it to 0.

//var showDynPage_re = 1;
var numScrollPages_re = 1;       //Set the number of pages (layers) here. Add and remove the pages in the body too. The first layer is called dynPage0, the second is dynPage1, and so on.
var transitionOut_re = 0;       //The 'out' effect... 0= no effect, 1= fade
var transitionIn_re = 0;        //The 'in' effect... 0= no effect, 1= fade, 2= slide
var transitionOnload_re = 0;     //Use the 'in' transition when the page first loads? If you want the transition fx only when the links are clicked, you can set it to 0.

// NOTE: if you change the position of divScroller1 from absolute to relative, you can put the scroller in a table.
// HOWEVER it will no longer work in netscape 4. If you wish to support netscape 4, you have to use absolute positioning.

// Please note that there are no effects available in ns4 and ie4, or explorers on the Mac!

/*** There should be no need to change anything beyond this. ***/ 

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

if(document.layers){ //NS4 resize fix...
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}

//object constructor...
function scrollerobj_li(obj,nest){
	nest = (!nest)?"":'document.'+nest+'.'
	this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)
	this.css = bw.ns4?this.elm:this.elm.style
	this.doc = bw.ns4?this.elm.document:document
	this.obj = obj+'scrollerobj_li'; eval(this.obj+'=this')
	this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft
	this.y = (bw.ns4||bw.opera5)?this.css.top:this.elm.offsetTop
	this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
	this.h = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetHeight:bw.ns4?this.elm.clip.height:bw.opera5?this.css.pixelHeight:0
}

function scrollerobj_mi(obj,nest){
	nest = (!nest)?"":'document.'+nest+'.'
	this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)
	this.css = bw.ns4?this.elm:this.elm.style
	this.doc = bw.ns4?this.elm.document:document
	this.obj = obj+'scrollerobj_mi'; eval(this.obj+'=this')
	this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft
	this.y = (bw.ns4||bw.opera5)?this.css.top:this.elm.offsetTop
	this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
	this.h = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetHeight:bw.ns4?this.elm.clip.height:bw.opera5?this.css.pixelHeight:0
}

function scrollerobj_re(obj,nest){
	nest = (!nest)?"":'document.'+nest+'.'
	this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)
	this.css = bw.ns4?this.elm:this.elm.style
	this.doc = bw.ns4?this.elm.document:document
	this.obj = obj+'scrollerobj_re'; eval(this.obj+'=this')
	this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft
	this.y = (bw.ns4||bw.opera5)?this.css.top:this.elm.offsetTop
	this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
	this.h = (bw.ie4||bw.ie5||bw.ie6||bw.ie7||bw.ie8||bw.ns6)?this.elm.offsetHeight:bw.ns4?this.elm.clip.height:bw.opera5?this.css.pixelHeight:0
}

//object methods...
scrollerobj_li.prototype.moveTo = function(x,y){
	if(x!=null){this.x=x; this.css.left=x+px}
	if(y!=null){this.y=y; this.css.top=y+px}
}
scrollerobj_li.prototype.moveBy = function(x,y){this.moveTo(this.x+x,this.y+y)}
scrollerobj_li.prototype.hideIt = function(){this.css.visibility='hidden'}
scrollerobj_li.prototype.showIt = function(){this.css.visibility='visible'}

scrollerobj_mi.prototype.moveTo = function(x,y){
	if(x!=null){this.x=x; this.css.left=x+px}
	if(y!=null){this.y=y; this.css.top=y+px}
}
scrollerobj_mi.prototype.moveBy = function(x,y){this.moveTo(this.x+x,this.y+y)}
scrollerobj_mi.prototype.hideIt = function(){this.css.visibility='hidden'}
scrollerobj_mi.prototype.showIt = function(){this.css.visibility='visible'}

scrollerobj_re.prototype.moveTo = function(x,y){
	if(x!=null){this.x=x; this.css.left=x+px}
	if(y!=null){this.y=y; this.css.top=y+px}
}
scrollerobj_re.prototype.moveBy = function(x,y){this.moveTo(this.x+x,this.y+y)}
scrollerobj_re.prototype.hideIt = function(){this.css.visibility='hidden'}
scrollerobj_re.prototype.showIt = function(){this.css.visibility='visible'}

/****************************************************************
scroll functions...
****************************************************************/
var scrollTimer_li = null;

function scroll_li_one(){
	if(event.wheelDelta < 1){
	scroll_li(-20);
	stopScroll_li();
	}
	else if(event.wheelDelta > 1){
	scroll_li(20);
	stopScroll_li();
	}
}

function scroll_li(step){
	clearTimeout(scrollTimer_li);
	if ( !busy && (step<0&&activePage_li.y+activePage_li.h>scroller1_li.h || step>0&&activePage_li.y<0) ){
		activePage_li.moveBy(0,step);
		scrollTimer_li = setTimeout('scroll_li('+step+')',40);
	}
}
function stopScroll_li(){
	clearTimeout(scrollTimer_li);
}

var scrollTimer_mi = null;
function scroll_mi(step){
	clearTimeout(scrollTimer_mi);
	if ( !busy && (step<0&&activePage_mi.y+activePage_mi.h>scroller1_mi.h || step>0&&activePage_mi.y<0) ){
		activePage_mi.moveBy(0,step);
		scrollTimer_mi = setTimeout('scroll_mi('+step+')',40);
	}
}
function stopScroll_mi(){
	clearTimeout(scrollTimer_mi);
}

var scrollTimer_re = null;
function scroll_re(step){
	clearTimeout(scrollTimer_re);
	if ( !busy && (step<0&&activePage_re.y+activePage_re.h>scroller1_re.h || step>0&&activePage_re.y<0) ){
		activePage_re.moveBy(0,step);
		scrollTimer_re = setTimeout('scroll_re('+step+')',40);
	}
}
function stopScroll_re(){
	clearTimeout(scrollTimer_re);
}

/****************************************************************
activating the correct layers...
****************************************************************/
var activePage_li = null;
var busy = 0;
function activate_li(num){
	if (activePage_li!=pages_li[num] && !busy){
		busy = 1;
		if (transitionOut_li==0 || !bw.opacity){ activePage_li.hideIt(); activateContinue_li(num); }
		else if (transitionOut_li==1) activePage_li.blend('hidden', 'activateContinue_li('+num+')');
	}
}
function activateContinue_li(num){
	busy = 1;
	activePage_li = pages_li[num];
	activePage_li.moveTo(0,0);
	if (transitionIn_li==0 || !bw.opacity){ activePage_li.showIt(); busy=0; }
	else if (transitionIn_li==1) activePage_li.blend('visible', 'busy=0');
	else if (transitionIn_li==2) activePage_li.slide(0, slideAcceleration, 40, 'busy=0');
}

var activePage_mi = null;
var busy = 0;
function activate_mi(num){
	if (activePage_mi!=pages_mi[num] && !busy){
		busy = 1;
		if (transitionOut_mi==0 || !bw.opacity){ activePage_mi.hideIt(); activateContinue_mi(num); }
		else if (transitionOut_mi==1) activePage_mi.blend('hidden', 'activateContinue_mi('+num+')');
	}
}
function activateContinue_mi(num){
	busy = 1;
	activePage_mi = pages_mi[num];
	activePage_mi.moveTo(0,0);
	if (transitionIn_mi==0 || !bw.opacity){ activePage_mi.showIt(); busy=0; }
	else if (transitionIn_mi==1) activePage_mi.blend('visible', 'busy=0');
	else if (transitionIn_mi==2) activePage_mi.slide(0, slideAcceleration, 40, 'busy=0');
}

var activePage_re = null;
var busy = 0;
function activate_re(num){
	if (activePage_re!=pages_re[num] && !busy){
		busy = 1;
		if (transitionOut_re==0 || !bw.opacity){ activePage_re.hideIt(); activateContinue_re(num); }
		else if (transitionOut_re==1) activePage_re.blend('hidden', 'activateContinue_re('+num+')');
	}
}
function activateContinue_re(num){
	busy = 1;
	activePage_re = pages_re[num];
	activePage_re.moveTo(0,0);
	if (transitionIn_re==0 || !bw.opacity){ activePage_re.showIt(); busy=0; }
	else if (transitionIn_re==1) activePage_re.blend('visible', 'busy=0');
	else if (transitionIn_re==2) activePage_re.slide(0, slideAcceleration, 40, 'busy=0');
}

/****************************************************************
Slide methods...
****************************************************************/
scrollerobj_li.prototype.slide = function(target, acceleration, time, fn){
	this.slideFn= fn?fn:null;
	this.moveTo(0,scroller1_li.h);
	if (bw.ie4&&!bw.mac) this.css.filter = 'alpha(opacity=100)';
	if (bw.ns6) this.css.MozOpacity = 1;
	this.showIt();
	this.doSlide(target, acceleration, time);
}
scrollerobj_li.prototype.doSlide = function(target, acceleration, time){
	this.step = Math.round(this.y*acceleration);
	if (this.step<1) this.step = 1;
	if (this.step>this.y) this.step = this.y;
	this.moveBy(0, -this.step);
	if (this.y>0) this.slideTim = setTimeout(this.obj+'.doSlide('+target+','+acceleration+','+time+')', time);
	else {	
		eval(this.slideFn);
		this.slideFn = null;
	}
}

scrollerobj_mi.prototype.slide = function(target, acceleration, time, fn){
	this.slideFn= fn?fn:null;
	this.moveTo(0,scroller1_mi.h);
	if (bw.ie4&&!bw.mac) this.css.filter = 'alpha(opacity=100)';
	if (bw.ns6) this.css.MozOpacity = 1;
	this.showIt();
	this.doSlide(target, acceleration, time);
}
scrollerobj_mi.prototype.doSlide = function(target, acceleration, time){
	this.step = Math.round(this.y*acceleration);
	if (this.step<1) this.step = 1;
	if (this.step>this.y) this.step = this.y;
	this.moveBy(0, -this.step);
	if (this.y>0) this.slideTim = setTimeout(this.obj+'.doSlide('+target+','+acceleration+','+time+')', time);
	else {	
		eval(this.slideFn);
		this.slideFn = null;
	}
}

scrollerobj_re.prototype.slide = function(target, acceleration, time, fn){
	this.slideFn= fn?fn:null;
	this.moveTo(0,scroller1_re.h);
	if (bw.ie4&&!bw.mac) this.css.filter = 'alpha(opacity=100)';
	if (bw.ns6) this.css.MozOpacity = 1;
	this.showIt();
	this.doSlide(target, acceleration, time);
}
scrollerobj_re.prototype.doSlide = function(target, acceleration, time){
	this.step = Math.round(this.y*acceleration);
	if (this.step<1) this.step = 1;
	if (this.step>this.y) this.step = this.y;
	this.moveBy(0, -this.step);
	if (this.y>0) this.slideTim = setTimeout(this.obj+'.doSlide('+target+','+acceleration+','+time+')', time);
	else {	
		eval(this.slideFn);
		this.slideFn = null;
	}
}

/****************************************************************
Opacity methods...
****************************************************************/
scrollerobj_li.prototype.blend= function(vis, fn){
	if (bw.ie5||bw.ie6||bw.ie7||bw.ie8 && !bw.mac) {
		if (vis=='visible') this.css.filter= 'blendTrans(duration=0.2)';//Geschwindigkeit Einblenden
		else this.css.filter= 'blendTrans(duration=0.1)';//Geschwindigkeit Ausblenden
		this.elm.onfilterchange = function(){ eval(fn); };
		this.elm.filters.blendTrans.apply();
		this.css.visibility= vis;
		this.elm.filters.blendTrans.play();
	}
	else if (bw.ns6 || bw.ie&&!bw.mac){
		this.css.visibility= 'visible';
		vis=='visible' ? this.fadeTo(100, 7, 40, fn) : this.fadeTo(0, 9, 40, fn);
	}
	else {
		this.css.visibility= vis;
		eval(fn);
	}
};

scrollerobj_li.prototype.op= 100;
scrollerobj_li.prototype.opacityTim= null;
scrollerobj_li.prototype.setOpacity= function(num){
	this.css.filter= 'alpha(opacity='+num+')';
	this.css.MozOpacity= num/100;
	this.op= num;
}
scrollerobj_li.prototype.fadeTo= function(target, step, time, fn){
	clearTimeout(this.opacityTim);
	this.opacityFn= fn?fn:null;
	this.op = target==100 ? 0 : 100;
	this.fade(target, step, time);
}
scrollerobj_li.prototype.fade= function(target, step, time){
	if (Math.abs(target-this.op)>step){
		target>this.op? this.setOpacity(this.op+step):this.setOpacity(this.op-step);
		this.opacityTim= setTimeout(this.obj+'.fade('+target+','+step+','+time+')', time);
	}
	else {
		this.setOpacity(target);
		eval(this.opacityFn);
		this.opacityFn= null;
	}
}

scrollerobj_mi.prototype.blend= function(vis, fn){
	if (bw.ie5||bw.ie6||bw.ie7||bw.ie8 && !bw.mac) {
		if (vis=='visible') this.css.filter= 'blendTrans(duration=0.2)';//Geschwindigkeit Einblenden
		else this.css.filter= 'blendTrans(duration=0.1)';//Geschwindigkeit Ausblenden
		this.elm.onfilterchange = function(){ eval(fn); };
		this.elm.filters.blendTrans.apply();
		this.css.visibility= vis;
		this.elm.filters.blendTrans.play();
	}
	else if (bw.ns6 || bw.ie&&!bw.mac){
		this.css.visibility= 'visible';
		vis=='visible' ? this.fadeTo(100, 7, 40, fn) : this.fadeTo(0, 9, 40, fn);
	}
	else {
		this.css.visibility= vis;
		eval(fn);
	}
};

scrollerobj_mi.prototype.op= 100;
scrollerobj_mi.prototype.opacityTim= null;
scrollerobj_mi.prototype.setOpacity= function(num){
	this.css.filter= 'alpha(opacity='+num+')';
	this.css.MozOpacity= num/100;
	this.op= num;
}
scrollerobj_mi.prototype.fadeTo= function(target, step, time, fn){
	clearTimeout(this.opacityTim);
	this.opacityFn= fn?fn:null;
	this.op = target==100 ? 0 : 100;
	this.fade(target, step, time);
}
scrollerobj_mi.prototype.fade= function(target, step, time){
	if (Math.abs(target-this.op)>step){
		target>this.op? this.setOpacity(this.op+step):this.setOpacity(this.op-step);
		this.opacityTim= setTimeout(this.obj+'.fade('+target+','+step+','+time+')', time);
	}
	else {
		this.setOpacity(target);
		eval(this.opacityFn);
		this.opacityFn= null;
	}
}

scrollerobj_re.prototype.blend= function(vis, fn){
	if (bw.ie5||bw.ie6||bw.ie7||bw.ie8 && !bw.mac) {
		if (vis=='visible') this.css.filter= 'blendTrans(duration=0.2)';//Geschwindigkeit Einblenden
		else this.css.filter= 'blendTrans(duration=0.1)';//Geschwindigkeit Ausblenden
		this.elm.onfilterchange = function(){ eval(fn); };
		this.elm.filters.blendTrans.apply();
		this.css.visibility= vis;
		this.elm.filters.blendTrans.play();
	}
	else if (bw.ns6 || bw.ie&&!bw.mac){
		this.css.visibility= 'visible';
		vis=='visible' ? this.fadeTo(100, 7, 40, fn) : this.fadeTo(0, 9, 40, fn);
	}
	else {
		this.css.visibility= vis;
		eval(fn);
	}
};

scrollerobj_re.prototype.op= 100;
scrollerobj_re.prototype.opacityTim= null;
scrollerobj_re.prototype.setOpacity= function(num){
	this.css.filter= 'alpha(opacity='+num+')';
	this.css.MozOpacity= num/100;
	this.op= num;
}
scrollerobj_re.prototype.fadeTo= function(target, step, time, fn){
	clearTimeout(this.opacityTim);
	this.opacityFn= fn?fn:null;
	this.op = target==100 ? 0 : 100;
	this.fade(target, step, time);
}
scrollerobj_re.prototype.fade= function(target, step, time){
	if (Math.abs(target-this.op)>step){
		target>this.op? this.setOpacity(this.op+step):this.setOpacity(this.op-step);
		this.opacityTim= setTimeout(this.obj+'.fade('+target+','+step+','+time+')', time);
	}
	else {
		this.setOpacity(target);
		eval(this.opacityFn);
		this.opacityFn= null;
	}
}

/**************************************************************
Init function...
**************************************************************/
var pageslidefadeLoaded = 0;
function initPageSlideFade(){
	if(showDynPage_li == 1) scroller1_li = new scrollerobj_li('divScroller_li');
	if(showDynPage_mi == 1) scroller1_mi = new scrollerobj_mi('divScroller_mi');//x
	if(showDynPage_re == 1) scroller1_re = new scrollerobj_re('divScroller_re');//x
	
	if(showDynPage_li == 1) {
		pages_li = new Array();
		for (var i=0; i<numScrollPages_li; i++){
			pages_li[i] = new scrollerobj_li('dynPage_li'+i, 'divScroller_li');
			pages_li[i].moveTo(0,0);
		}
	}

	if(showDynPage_mi == 1) {
		pages_mi = new Array();
		for (var i=0; i<numScrollPages_mi; i++){
			pages_mi[i] = new scrollerobj_mi('dynPage_mi'+i, 'divScroller_mi');
			pages_mi[i].moveTo(0,0);
		}
	}
		
	if(showDynPage_re == 1) {
		pages_re = new Array();
		for (var i=0; i<numScrollPages_re; i++){
			pages_re[i] = new scrollerobj_re('dynPage_re'+i, 'divScroller_re');
			pages_re[i].moveTo(0,0);
		}
	}
	
	
	bw.opacity = ( bw.ie && !bw.ie4 && navigator.userAgent.indexOf('Windows')>-1 ) || bw.ns6
	if (bw.ie5||bw.ie6 && !bw.mac) pages_li[0].css.filter= 'blendTrans(duration=0.6)'; // Preloads the windows filters.
	
	if(showDynPage_li == 1) {
		if (transitionOnload_li) activateContinue_li(0);
		else{
			activePage_li = pages_li[0];
			activePage_li.showIt();
		}
	}	

	if(showDynPage_mi == 1) {
		if (transitionOnload_mi) activateContinue_mi(0);
		else{
			activePage_mi = pages_mi[0];
			activePage_mi.showIt();
		}
	}
		
	if(showDynPage_re == 1) {
		if (transitionOnload_re) activateContinue_re(0);
		else{
			activePage_re = pages_re[0];
			activePage_re.showIt();
		}
	}
		
	if (bw.ie) for(var i=0;i<document.links.length;i++) document.links[i].onfocus=document.links[i].blur;
	pageslidefadeLoaded = 1;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWin2(theURL){
detail = window.open(theURL, 'win', 'width=760,height=400,scrollbars=auto,resizable=no');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function fertig(){
opener.location.reload();
setTimeout('self.close()',3000);
}

//Opacity 50 ************** Version 1
function makevisible(cur,which){
if (which==0) transparent.filters.alpha.opacity=100 
else transparent.filters.alpha.opacity=40 }

