function init() {
 try {
  initMenu();
  initTips();
 } catch(e) {}
 
 document.onload = window.onload = function() {
  document.getElementById('content').style.height='';
  if (document.getElementById('content').offsetHeight < document.getElementById('context-out').offsetHeight) {
   document.getElementById('content').style.height=document.getElementById('context-out').offsetHeight+'px';
  }
 };

 window.onload();
}

ie7andup = navigator.userAgent.indexOf('MSIE')!=-1 && navigator.userAgent.substr(navigator.userAgent.indexOf('MSIE')+5,1) > 6;

// Flash
flashVersion = 0; flashEnabled="";

function writeFlash(fname, width, height) {
// Flash Check
if (flashEnabled=="") {
agent = navigator.userAgent.toLowerCase(); 

if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') { 
 for (var i = 100; i >= 3; i--) {
  if (flashPlugin.description.indexOf(i + '.') != -1) { flashVersion = i; break; }
 }
}


} else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1) {
  var doc = '<scr' + 'ipt language="VBScript"\> \n';
  doc += 'On Error Resume Next \n';
  doc += 'Dim obFlash \n';
  doc += 'For i = ' + 9 + ' To 3 Step -1 \n';
  doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
  doc += '   If IsObject(obFlash) Then \n';
  doc += '      flashVersion = i \n';
  doc += '      Exit For \n';
  doc += '   End If \n';
  doc += 'Next \n';
  doc += '</scr' + 'ipt\> \n';
  document.write(doc);
}

flashEnabled = (flashVersion >= 6) ? true : false;
}


if (flashEnabled) {
 document.write("<div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\""+fname+".swf\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"best\" /><param name=\"scale\" value=\"noscale\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+fname+".swf\" menu=\"false\" quality=\"best\" scale=\"noscale\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>");
} else {
 document.write('<img src="'+ fname +'.jpg" width="'+ width +'" height="'+ height +'" alt="" />');
}
}

// Sonder-Funktion zum Einsatz bei Flash Version 8+ Filmen
// Versionsnummer anders - sonst identisch mit writeFlash()

function writeFlash_v8(fname, width, height) {
// Flash Check
if (flashEnabled=="") {
agent = navigator.userAgent.toLowerCase(); 

if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') { 
 for (var i = 100; i >= 3; i--) {
  if (flashPlugin.description.indexOf(i + '.') != -1) { flashVersion = i; break; }
 }
}


} else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1) {
  var doc = '<scr' + 'ipt language="VBScript"\> \n';
  doc += 'On Error Resume Next \n';
  doc += 'Dim obFlash \n';
  doc += 'For i = ' + 9 + ' To 3 Step -1 \n';
  doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
  doc += '   If IsObject(obFlash) Then \n';
  doc += '      flashVersion = i \n';
  doc += '      Exit For \n';
  doc += '   End If \n';
  doc += 'Next \n';
  doc += '</scr' + 'ipt\> \n';
  document.write(doc);
}

flashEnabled = (flashVersion >= 8) ? true : false;
}

if (flashEnabled) {
 document.write("<div><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\""+fname+".swf\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"best\" /><param name=\"scale\" value=\"noscale\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+fname+".swf\" menu=\"false\" quality=\"best\" scale=\"noscale\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>");
} else {
 document.write('<img src="'+ fname +'.jpg" width="'+ width +'" height="'+ height +'" alt="" /><br /><a style="border: none !important;" target="_blank" href="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash&Lang=German" title=""><img src="/swf/flash_download.jpg" width="555" height="40" alt="" /></a>');
}
}



// Tips
document.write("<div id=\"tiplayer\"><div></div></div>");
tiptags = Array("dfn","acronym","area","img");
tiptext = Array; tiptimer = -1;


function initTips() {
for (t=0; t < tiptags.length; t++) {
for (i=0; i < document.getElementsByTagName(tiptags[t]).length; i++) {
 tiptext[(tiptags[t]+i)] = document.getElementsByTagName(tiptags[t])[i].title.replace(/\*([^\*]+)\*/g,'<strong>$1</strong>').replace(/ -- /g,"<br /><br />").replace(/ - /g,"<br />");

 document.getElementsByTagName(tiptags[t])[i].title = "";
 document.getElementsByTagName(tiptags[t])[i].id = tiptags[t]+i;
 document.getElementsByTagName(tiptags[t])[i].onmouseover = handleTip;
 if (tiptags[t]=="img") {
	 document.getElementsByTagName(tiptags[t])[i].onmousemove = handleTip;
	tiptext[(tiptags[t]+i)] = tiptext[(tiptags[t]+i)];
 }
 document.getElementsByTagName(tiptags[t])[i].onmouseout = hideTip;
}
}

tip = document.getElementById("tiplayer");
}

tipobj=-1;
function handleTip(e) {
if (tiptimer) window.clearTimeout(tiptimer);
if (tiptext[this.id]=="" || tiptext[this.id]=="&nbsp;&nbsp;") return;
tip.firstChild.innerHTML = tiptext[this.id];

if (this.tagName.toLowerCase()=="area") { //sonderfall area
tip.style.left = ((! document.all) ? e.pageX : (ie7andup ? document.documentElement.scrollLeft :document.body.scrollLeft) + event.clientX)  + 10 + "px";
tip.style.top = ((! document.all) ? e.pageY : (ie7andup ? document.documentElement.scrollTop :document.body.scrollTop) + event.clientY) - 110 + "px";
tip.className = "tip-rechts";
tip.style.display='block';
return;
} else if (this.tagName.toLowerCase()=="img") {
tip.style.left = ((! document.all) ? e.pageX : (ie7andup ? document.documentElement.scrollLeft :document.body.scrollLeft) + event.clientX) + "px";
tip.style.top = ((! document.all) ? e.pageY : (ie7andup ? document.documentElement.scrollTop :document.body.scrollTop) + event.clientY) +20 + "px";
tip.firstChild.style.width = "auto";
tip.className = "simpletip";
if (tiptext[this.id].indexOf('Marion')>-1) tip.className+=' tipseccolor';
tip.style.display='block';
return;

} else {
			getPos(this);
}

//if (this.tagName.toLowerCase()!="img") {this.className = "toolhover"; tipobj = this;} else{ tipobj=-1;} 

tip.style.top = absoluteTop - 90 + "px";

if (absoluteLeft + this.offsetWidth + 250 > document.body.offsetWidth) {
tip.style.left = absoluteLeft - 220 + "px";
tip.className = "tip-links";
} else {
tip.style.left = absoluteLeft + this.offsetWidth - 2 + "px";
tip.className = "tip-rechts";
}

tiptimer = window.setTimeout("tip.style.display='block'",200);
}
function hideTip() {
//if (document.tipobj && tipobj.tagName.toLowerCase()!="img") tipobj.className = "";
if (tiptimer) window.clearTimeout(tiptimer);
tip.style.display="none";
}



// Fade
fadelevel = 1; fadeobj = -1; fadetimer = -1;
function startFade(obj,fadein) {
if (fadetimer) window.clearTimeout(fadetimer);
fadeobj = obj;
fadelevel = 1;
fadeObj(fadein);
fadeobj.style.display = "block";
}

function fadeObj(fin) {
A = fadelevel * 10;
if (! fin) {A = 100 - A;}

if (A==0) {
fadeobj.style.display="none";
} else {
if (typeof(fadeobj.style.MozOpacity)!="undefined") {
fadeobj.style.MozOpacity = A / 100 - 0.01;
} else if (typeof(fadeobj.style.Opacity)!="undefined") {
fadeobj.style.Opacity = A / 100;
} else {
fadeobj.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+A+")";
}
}

if (++fadelevel > 10) { fadelevel=1; } else { fadetimer = window.setTimeout("fadeObj("+fin+")",30); }
}



// Menu
hidetimer = -1; hidethis = -1; lastmnu = -1;

function getPos(obj) {
absoluteTop = obj.offsetTop;
absoluteLeft = obj.offsetLeft;
while(obj.offsetParent!=null) {
objParent = obj.offsetParent;
absoluteTop += objParent.offsetTop;
absoluteLeft += objParent.offsetLeft;
obj = objParent;
}
}
function initMenu() {
for (i=1; i < 5; i++) {
 document.getElementsByTagName("h2")[i].onmouseover = handleMenu;
 document.getElementsByTagName("h2")[i].onmouseout = hideMenu;
 document.getElementsByTagName("ul")[i].onmouseout = hideMenu;
 document.getElementsByTagName("ul")[i].onmouseover = stopHideTimer;
 document.getElementsByTagName("ul")[i].lastChild.style.borderBottom = "0px";
}
}
function handleMenu() {
this.style.backgroundColor = "#646464";
stopHideTimer();
for (i=1; i < 5; i++) {
 document.getElementsByTagName("ul")[i].style.display = "none";
}
mnuobj = this.nextSibling;
getPos(this);
mnuobj.style.top = absoluteTop + this.offsetHeight + 1 + "px";
mnuobj.style.left = absoluteLeft + "px";

startFade(mnuobj,true);
}

function hideMenu() {
if (this.nodeName.toLowerCase()=="h2") { this.style.backgroundColor = "#969696"; hidethis = this.nextSibling; } else { hidethis = this; }
hidetimer = window.setTimeout("startFade(hidethis,false);",1000);
}
function stopHideTimer() {
if (hidetimer) window.clearTimeout(hidetimer);
}


function closelayer() {
 document.getElementById('homelayer').style.display='none';
}


function writeLayer(fname, width, height) {
// Flash Check
if (flashEnabled=="") {
agent = navigator.userAgent.toLowerCase(); 

if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') { 
 for (var i = 100; i >= 3; i--) {
  if (flashPlugin.description.indexOf(i + '.') != -1) { flashVersion = i; break; }
 }
}


} else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1) {
  var doc = '<scr' + 'ipt language="VBScript"\> \n';
  doc += 'On Error Resume Next \n';
  doc += 'Dim obFlash \n';
  doc += 'For i = ' + 9 + ' To 3 Step -1 \n';
  doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
  doc += '   If IsObject(obFlash) Then \n';
  doc += '      flashVersion = i \n';
  doc += '      Exit For \n';
  doc += '   End If \n';
  doc += 'Next \n';
  doc += '</scr' + 'ipt\> \n';
  document.write(doc);
}

flashEnabled = (flashVersion >= 6) ? true : false;
}


if (flashEnabled) {
 document.write("<div id=\"homelayer\" style=\"position:absolute;top:105px;left:1px;z-index:100;\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\""+width+"\" height=\""+height+"\"><param name=\"movie\" value=\""+fname+".swf\" /><param name=\"menu\" value=\"false\" /><param name=\"quality\" value=\"best\" /><param name=\"scale\" value=\"noscale\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\""+fname+".swf\" menu=\"false\" quality=\"best\" scale=\"noscale\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object></div>");
} else {
 document.write('');
}
}
