
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.ie8
	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()
//alert (navigator.appVersion+"\n"+navigator.userAgent+"\nns6 "+bw.ns6+"\nie6 "+bw.ie6+"\nopera5 "+bw.opera5);

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

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 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 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.

// 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.

// 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)} //vertikal
scrollerobj_mi.prototype.moveBy = function(y,x){this.moveTo(this.x+x,this.y+y)} //horizontal
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(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);
		//alert (activePage_mi.x+"\n"+activePage_mi.w+"\n"+scroller1_mi.w);
	//if ( !busy && (step<0&&activePage_mi.y+activePage_mi.h>scroller1_mi.h || step>0&&activePage_mi.y<0) ){
	if ( !busy && (step<0&&activePage_mi.x+activePage_mi.w>scroller1_mi.w || step>0&&activePage_mi.x<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;
		activePage_li.hideIt(); activateContinue_li(num);
	}
}
function activateContinue_li(num){
	busy = 1;
	activePage_li = pages_li[num];
	activePage_li.moveTo(0,0);
	activePage_li.showIt(); busy=0;
}

var activePage_mi = null;
var busy = 0;
function activate_mi(num){
	if (activePage_mi!=pages_mi[num] && !busy){
		busy = 1;
		activePage_mi.hideIt(); activateContinue_mi(num);
	}
}
function activateContinue_mi(num){
	busy = 1;
	activePage_mi = pages_mi[num];
	activePage_mi.moveTo(0,0);
	activePage_mi.showIt(); busy=0;
}

var activePage_re = null;
var busy = 0;
function activate_re(num){
	if (activePage_re!=pages_re[num] && !busy){
		busy = 1;
		activePage_re.hideIt(); activateContinue_re(num);
	}
}
function activateContinue_re(num){
	busy = 1;
	activePage_re = pages_re[num];
	activePage_re.moveTo(0,0);
	activePage_re.showIt(); busy=0;
}


/**************************************************************
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);
		}
	}
	
	if(showDynPage_li == 1) {
			activePage_li = pages_li[0];
			activePage_li.showIt();
	}	
	if(showDynPage_mi == 1) {
			activePage_mi = pages_mi[0];
			activePage_mi.showIt();
	}
		
	if(showDynPage_re == 1) {
			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);
}


function home_on(){
	MM_swapImage('ml_home','','image/ml_home_on.gif',1);
	MM_swapImage('mb_home','','image/mb_home_on.jpg',1);
}
function home_of(){
	MM_swapImage('ml_home','','image/ml_home_of.gif',1);
	MM_swapImage('mb_home','','image/space.gif',1);
}

function wir_on(){
	MM_swapImage('ml_wir','','image/ml_wir_on.gif',1);
	MM_swapImage('mb_wir','','image/mb_wir_on.jpg',1);
}
function wir_of(){
	MM_swapImage('ml_wir','','image/ml_wir_of.gif',1);
	MM_swapImage('mb_wir','','image/space.gif',1);
}

function meta_on(){
	MM_swapImage('ml_meta','','image/ml_meta_on.gif',1);
	MM_swapImage('mb_meta','','image/mb_meta_on.jpg',1);
}
function meta_of(){
	MM_swapImage('ml_meta','','image/ml_meta_of.gif',1);
	MM_swapImage('mb_meta','','image/space.gif',1);
}

function inst_on(){
	MM_swapImage('ml_inst','','image/ml_inst_on.gif',1);
	MM_swapImage('mb_inst','','image/mb_inst_on.jpg',1);
}
function inst_of(){
	MM_swapImage('ml_inst','','image/ml_inst_of.gif',1);
	MM_swapImage('mb_inst','','image/space.gif',1);
}

function obje_on(){
	MM_swapImage('ml_obje','','image/ml_obje_on.gif',1);
	MM_swapImage('mb_obje','','image/mb_obje_on.jpg',1);
}
function obje_of(){
	MM_swapImage('ml_obje','','image/ml_obje_of.gif',1);
	MM_swapImage('mb_obje','','image/space.gif',1);
}
function change_to_blu(element) {
	element.style.backgroundImage = 'url(image/td_blu.gif)';
}
function change_to_blu1(element) {
	element.style.backgroundImage = 'url(image/td_blu1.gif)';
}
function change_to_wht(element) {
	element.style.backgroundImage = 'url(image/td_wht.gif)';
}
function change_to_frm(element) {
	element.style.backgroundImage = 'url(image/td_frm.gif)';
}
function change_to_spc(element) {
	element.style.backgroundImage = 'url(image/space.gif)';
}
function change_to_blu_wir(element) {
	element.style.backgroundImage = 'url(image/td_blu_wir.gif)';
}
function change_to_blu1_wir(element) {
	element.style.backgroundImage = 'url(image/td_blu1_wir.gif)';
}

