<!-- main variables -->

var pictures = new Array();
var userAgent = window.navigator.userAgent;
var bVers = parseInt(userAgent.charAt(userAgent.indexOf("/")+1),10);
var preLoadIsComplete = false;
var oldImg = "";
var oldCnt;

<!-- preload -->
function preLoad()
	{
	var preLoadedImgs = "";
	if (document.all)
		for (i=0; i<document.all.tags("div").length; i++)
			{
			for (j=0; j<document.all.tags("div")[i].document.images.length; j++)
				{
				if (document.all.tags("div")[i].document.images[j].name)
					{
					if ( preLoadedImgs.indexOf(document.all.tags("div")[i].document.images[j].name) < 0)
						{
						var imgSrc = document.all.tags("div")[i].document.images[j].src;
						var tmpPrefix = imgSrc.substr(0,imgSrc.length-4);
						var tmpSuffix = imgSrc.substr(imgSrc.length-4,imgSrc.length-1);
						var tmpActiveSrc = tmpPrefix + "-a" + tmpSuffix;
						var IEFix = new activeImageConstructor(document.all.tags("div")[i].document.images[j].name,document.all.tags("div")[i].document.images[j].src,tmpActiveSrc);
						var tmpData = new Array(IEFix);
						pictures = pictures.concat(tmpData);
						preLoadedImgs = preLoadedImgs.concat(document.all.tags("div")[i].document.images[j].name);
						}
					}
				}
			}
	else
		for (i=0; i<document.layers.length; i++)
			{
			for (j=0; j<document.layers[i].document.images.length; j++)
				{
				if (document.layers[i].document.images[j].name)
					{
					var imgSrc = document.layers[i].document.images[j].src;
					var tmpPrefix = imgSrc.substr(0,imgSrc.length-4);
					var tmpSuffix = imgSrc.substr(imgSrc.length-4,imgSrc.length-1);
					var tmpActiveSrc = tmpPrefix + "-a" + tmpSuffix;
					var IEFix = new activeImageConstructor(document.layers[i].document.images[j].name,document.layers[i].document.images[j].src,tmpActiveSrc);
					var tmpData = new Array(IEFix);
					pictures = pictures.concat(tmpData);
					}
				}
			}
	for (i=0; i<document.images.length; i++)
		{
		if (document.images[i].name)
			{
			if ( preLoadedImgs.indexOf(document.images[i].name) == -1)
				{
				var imgSrc = document.images[i].src;
				var tmpPrefix = imgSrc.substr(0,imgSrc.length-4);
				var tmpSuffix = imgSrc.substr(imgSrc.length-4,imgSrc.length-1);
				var tmpActiveSrc = tmpPrefix + "-a" + tmpSuffix;
				var IEFix = new activeImageConstructor(document.images[i].name,document.images[i].src,tmpActiveSrc);
				var tmpData = new Array(IEFix);
				pictures = pictures.concat(tmpData);
				}
			}
		}
	preLoadIsComplete = true;
	}


<!-- Mozilla layer access -->
function NSStyle(s)
	{
	return findElement(s,0);
	}

<!-- Highlighting -->
function activeImageConstructor(aName,aLowlightSrc,aHighlightSrc)
	{
	this.name  = aName;
	this.lowLight  = new Image();
	this.lowLight.src  = aLowlightSrc;
	this.highLight  = new Image();
	this.highLight.src  = aHighlightSrc;
	}

<!-- mouseOver main document -->
function mouseOver(aPic)
	{
	if (preLoadIsComplete)
		{
		for (i=0; i<pictures.length; i++)
			{
			if (pictures[i].name == aPic)
				{
					if (oldImg.length > 0)
						eval("document.images." + oldImg + ".src = pictures[" + oldCnt + "].lowLight.src");
				eval("document.images." + aPic + ".src = pictures[" + i + "].highLight.src");
				oldImg = aPic;
				oldCnt = i;
				}
			}
		}
	else
		preLoad();
	}

<!-- mouseOut main document -->
function mouseOut(aPic)
	{
	oldImg = "";
	if (preLoadIsComplete)
		{
		for (i=0; i<pictures.length; i++)
			{
			if (pictures[i].name == aPic)
				eval("document.images." + aPic + ".src = pictures[" + i + "].lowLight.src");
			}
		}
	else
		preLoad();
	}

<!-- mouseOver function layers -->
function layerMouseOver(aPic,aLayer)
	{
	if (preLoadIsComplete)
		{
		for (i=0; i<pictures.length; i++)
			{
			if (pictures[i].name == aPic)
				if (document.layers)
					{
					if (oldImg.length > 0)
						{
						eval("NSStyle('"+aLayer+"').document.images['"+oldImg+"'].src = pictures["+oldCnt+"].lowLight.src");
				}
					eval("NSStyle('"+aLayer+"').document.images['"+aPic+"'].src = pictures["+i+"].highLight.src");
					}
				else
					eval("document.all.tags('div')."+aLayer+".document.images['"+aPic+"'].src = pictures["+i+"].highLight.src");
			}
		}
	else
		preLoad();
	}

<!-- mouseOut function layers -->
function layerMouseOut(aPic,aLayer)
	{
	oldImg = "";
	if (preLoadIsComplete)
		{
		for (i=0; i<pictures.length; i++)
			{
			if (pictures[i].name == aPic)
				if (document.layers)
					eval("NSStyle('"+aLayer+"').document.images['"+aPic+"'].src = pictures["+i+"].lowLight.src");
				else
					eval("document.all.tags('div')."+aLayer+".document.images['"+aPic+"'].src = pictures["+i+"].lowLight.src");
			}
		}
	else
		preLoad();
	}

<!-- MSIE layer access -->
function IEStyle(s)
	{
	return document.all.tags("div")[s].style;
	}

<!-- visibility switch layers -->
function vSwitch(aLayer,aBool)
	{
	if (preLoadIsComplete)
		{
		if (document.all)
			IEStyle(aLayer).visibility = (aBool == 0) ? "hidden" : "visible";
		else
			NSStyle(aLayer).visibility = (aBool == 0) ? 'hide' : 'show';
		}
	else
		preLoad();
	}

<!-- Mozilla layer functionality -->
function findElement(n,ly)
	{
	var curDoc = ly ? ly.document : document;
	var elem = curDoc[n];
	if (bVers < 4)
		return document[n];
	if (!elem)
		{
		for (var i=0;i<curDoc.layers.length;i++)
			{
			elem = findElement(n,curDoc.layers[i]);
			if (elem)
				return elem;
			}
		}
	return elem;
}


function divlayer_init() {
  divlayer = new Array();
  if (document.layers) {
    for (i = 0; i < document.layers.length; i++) {
      if (document.layers[i].name != "") {
        divlayer[document.layers[i].name] = new divlayer_init_ns4(document.layers[i]);
      }
    }
  } else {
    if (document.all) {
      var divlayers = document.all.tags("DIV");
      for (i = 0; i < divlayers.length; i++) {
        if (divlayers[i].id != "") {
          divlayer[divlayers[i].id] = new divlayer_init_dom(divlayers[i]);
        }
      }
    } else {
      if (document.getElementById) {
        var divlayers = document.getElementsByTagName("DIV");
        for (i = 0; i < divlayers.length; i++) {
          var divlayerobj = divlayers[i];
          if (divlayerobj.id != "") {
            divlayer[divlayerobj.id] = new divlayer_init_dom(divlayerobj);
          }
        }
      }
    }
  }
}


// W3C DOM object (uses some IEx DOM calls for convenience, can later be switched)

function divlayer_init_dom(obj) {
  this.obj = obj;
  this.name = obj.id;

  this.hide = divlayer_hide_dom;
  this.show = divlayer_show_dom;

  this.getleft = divlayer_getleft_iex;
  this.gettop = divlayer_gettop_iex;
  this.getwidth = divlayer_getwidth_iex;
  this.getheight = divlayer_getheight_iex;

  this.getclipleft = divlayer_getclipleft_dom;
  this.getclipright = divlayer_getclipright_dom;
  this.getcliptop = divlayer_getcliptop_dom;
  this.getclipbottom = divlayer_getclipbottom_dom;

  this.setleft = divlayer_setleft_dom;
  this.settop = divlayer_settop_dom;

  this.setclip = divlayer_setclip_dom;
}


// W3C DOM methods

function divlayer_hide_dom() { this.obj.style.visibility = "hidden"; }
function divlayer_show_dom() { this.obj.style.visibility = "visible"; }

function divlayer_getleft_dom() { return parseInt(this.obj.style.left); }
function divlayer_gettop_dom() { return parseInt(this.obj.style.top); }
function divlayer_getwidth_dom() { return parseInt(this.obj.style.width); }
function divlayer_getheight_dom() { return parseInt(this.obj.style.height); }

function divlayer_getcliptop_dom() { return divlayer_getclipparm(this,0); }
function divlayer_getclipright_dom() { return divlayer_getclipparm(this,1); }
function divlayer_getclipbottom_dom() { return divlayer_getclipparm(this,2); }
function divlayer_getclipleft_dom() { return divlayer_getclipparm(this,3); }
function divlayer_getclipparm(lyr,indx) {
  var clips = lyr.obj.style.clip;
  if (clips.length > 0) {
    clips = clips.slice(5,clips.length-1);
    var clipentries = clips.split(" ");
    return parseInt(clipentries[indx]);
  } else {
    if (indx == 0) { return 0; }
    if (indx == 1) { return lyr.getwidth(); }
    if (indx == 2) { return lyr.getheight(); }
    if (indx == 3) { return 0; }
  }
}

function divlayer_setclip_dom(left,top,right,bottom) {
  if (top == null) { top = this.getcliptop(); }
  if (right == null) { right = this.getclipright(); }
  if (bottom == null) { bottom = this.getclipbottom(); }
  if (left == null) { left = this.getclipleft(); }
  this.obj.style.clip = "rect(" + top + "px, " + right + "px, " + bottom + "px, " + left + "px)";
}

function divlayer_setleft_dom(leftpx) { this.obj.style.left = leftpx + "px"; }
function divlayer_settop_dom(toppx) { this.obj.style.top = toppx + "px"; }

// IEx DOM methods

function divlayer_getleft_iex() { return parseInt(this.obj.offsetLeft); }
function divlayer_gettop_iex() { return parseInt(this.obj.offsetTop); }
function divlayer_getwidth_iex() { return parseInt(this.obj.offsetWidth); }
function divlayer_getheight_iex() { return parseInt(this.obj.offsetHeight); }


// NS4 DOM object

function divlayer_init_ns4(obj) {
  this.obj = obj;
  this.name = obj.name;
  this.hide = divlayer_hide_ns4;
  this.show = divlayer_show_ns4;

  this.gettop = divlayer_gettop_ns4;

  this.getcliptop = divlayer_getcliptop_ns4;
  this.getclipleft = divlayer_getclipleft_ns4;
  this.getclipbottom = divlayer_getclipbottom_ns4;
  this.getclipright = divlayer_getclipright_ns4;

  this.setleft = divlayer_setleft_ns4;
  this.settop = divlayer_settop_ns4;

  this.setclip = divlayer_setclip_ns4;
}


// NS4 DOM methods, other than W3C DOM methods (which means all, practically)

function divlayer_hide_ns4() { this.obj.visibility = "hidden"; }
function divlayer_show_ns4() { this.obj.visibility = "visible"; }

function divlayer_gettop_ns4() { return this.obj.top; }

function divlayer_getcliptop_ns4() { return this.obj.clip.top; }
function divlayer_getclipleft_ns4() { return this.obj.clip.left; }
function divlayer_getclipbottom_ns4() { return this.obj.clip.bottom; }
function divlayer_getclipright_ns4() { return this.obj.clip.right; }

function divlayer_setclip_ns4(left,top,right,bottom) {
  if (top != null) { this.obj.clip.top = top; }
  if (left != null) { this.obj.clip.left = left; }
  if (bottom != null) { this.obj.clip.bottom = bottom; }
  if (right != null) { this.obj.clip.right = right; }
}

function divlayer_setleft_ns4(leftpx) { this.obj.left = leftpx; }
function divlayer_settop_ns4(toppx) { this.obj.top = toppx; }


// EOF

scroller = new Array();
dls_mousedown = false;

function dls_init(name,height) {
  scroller[name] = new dls_layer(name,height);
  dls_mousedown = true; scroller[name].scroll(); dls_mousedown = false;
}

function dls_layer(name,height) {
  this.name = name;

  this.scroller = divlayer[name];
  this.scrollup = divlayer[name+'-scrollup'];
  this.scrolldown = divlayer[name+'-scrolldown'];

  this.otop = this.scroller.gettop();
  this.oheight = this.scroller.getclipbottom();
  this.height = height;
  this.scrollpos = 0;

  this.scroll = dls_scroll;
  this.startscroll = dls_startscroll;
  this.stopscroll = dls_stopscroll;
  this.scrollamount = 0;
}

function dls_scroll() {
  if (dls_mousedown) {
    this.scrollpos += this.scrollamount;
    if (this.scrollpos >= this.oheight - this.height) {
      this.scrollpos = this.oheight - this.height;
      this.scrolldown.hide();
    } else {
      this.scrolldown.show();
    }
    if (this.scrollpos <= 0) {
      this.scrollpos = 0;
      this.scrollup.hide();
    } else {
      this.scrollup.show();
    }
    this.scroller.setclip(null,this.scrollpos,null,this.scrollpos+this.height);
    this.scroller.settop(this.otop-this.scrollpos);
    this.scroller.show();

    setTimeout("scroller['"+this.name+"'].scroll();",50);
  }
}

function dls_startscroll(amount) {
  this.scrollamount = amount;
  dls_mousedown = true;
  this.scroll();
}

function dls_stopscroll() {
  dls_mousedown = false;
}

// EOF



	function MailingList(url)
	{
	 Struktur = window.open(url, 'newsletter', 'width=320,height=380,scrollbars=no,screenX=5,screenY=5,locationbar=no,status=no');
 	}


	function NeuFenster(url)
	{
	 Struktur = window.open(url, 'small', 'width=450,height=450,scrollbars=no,screenX=5,screenY=5,locationbar=no,status=no');
 	}



	function Tour(url)
	{
	 Struktur = window.open(url, 'tour', 'width=530,height=500,scrollbars=no,screenX=5,screenY=5,locationbar=no,status=no');
 	}


	function BlowUp(url)
	{
	 Struktur = window.open(url, 'tour', 'width=500,height=600,scrollbars=no,screenX=5,screenY=5,locationbar=no,status=no');
 	}


	function BlowUp2(url)
	{
	 Struktur = window.open(url, 'tour', 'width=760,height=600,scrollbars=no,screenX=5,screenY=5,locationbar=no,status=no');
 	}



function NeuFenster(url)
{
 Struktur = window.open(url, 'small', 'width=450,height=450,scrollbars=no,top=5,left=5,locationbar=no,status=no');
}
