function imgChange(bild,source) {
	eval('document.getElementsByName("' + bild + '")[0].src = ' + source + '.src;');
}

function imglo(bild) {
	eval('document.getElementsByName("' + bild + '")[0].src = ' + bild + 'lo.src;');
}

function imghi(bild) {
	eval('document.getElementsByName("' + bild + '")[0].src = ' + bild + 'hi.src;');
}

function goTo(ziel) {
	if (ziel != "#" && ziel != "") {
		window.location.href = ziel;
	}
}

function randunten() {
	if (screen.width > 1024) {
		document.getElementById("portalcontentmain").style.marginBottom = "80px";
	}
}

var menuopen = "";
var aktivmenu = "";
var aktiv="";

function aufklappen(ebene) {
	window.clearTimeout(aktiv);
	if (menuopen != "") zuklappen(menuopen);
	menuopen = ebene;
	if (document.getElementById(ebene)) {
		document.getElementById(ebene).style.visibility = "visible";
		if (document.getElementById(ebene.substr(3,ebene.length-3)).className != "mainactive") {
			document.getElementById(ebene.substr(3,ebene.length-3)).className = "mainhigh";
		}
	}
}

function checkMenu(ebene) {
	aktiv = window.setTimeout("zuklappen('"+ebene+"')",1000);
}

function zuklappen(ebene) {
	if (document.getElementById(ebene.substr(3,ebene.length-3)).className != "mainactive") {
		document.getElementById(ebene.substr(3,ebene.length-3)).className = "main";
	}
	if (document.getElementById(ebene)) {
		document.getElementById(ebene).style.visibility = "hidden";
	}
}

function popup(page, width, height) {
    if (width=='') width=570;
    if (height=='') height=685;
	zoomwindow = window.open(page, "Zoom", "width="+width+",height="+height+",left=0,top=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

function zoom(page, width, height) {
    page = page + "&width="+width+"&height"+height;
    if (width=='') width=570;
    if (height=='') height=685;
    //if (zoomwindow) zoomwindow.close();    
	  zoomwindow = window.open(page, "Zoom", "width="+width+",height="+height+",left=0,top=0,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}

var flashVersion = 0;
function getFlashVersion() {
	var maxFlashVersion = 25;
	var minFlashVersion = 6;
	var agent = navigator.userAgent.toLowerCase(); 

	// NS3 needs flashVersion to be a local variable
	if (((agent.indexOf("mozilla/3") != -1) && (agent.indexOf("msie") == -1)) || ((agent.indexOf("msie") != -1) && (agent.indexOf("mac") != -1))) {
		flashVersion = 0;
		return flashVersion;
	}
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = maxFlashVersion; i >= minFlashVersion; i--) {
				if (flashPlugin.description.indexOf(i + '.') != -1) {
					flashVersion = i;
					break;
				}
			}
		}
	}
	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if ((agent.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >= 4) && (agent.indexOf("win") != -1) && (agent.indexOf("16bit") == -1)) {
		var doc = '<scr' + 'ipt language="VBScript"\> \n';
		doc += 'On Error Resume Next \n';
		doc += 'Dim obFlash \n';
		doc += 'For i = '+maxFlashVersion+' To '+minFlashVersion+' 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);
	} else flashVersion = -1;
	return flashVersion;
}

function insertFlashObject(id,src,width,height,name,bgcolor,imgsrc) {
	if (bgcolor.length == 0) bgcolor = '#ffffff';
	var canDo=0;
	if (getFlashVersion() >= 6) canDo = 1;
	if (canDo!=1) {
		if (imgsrc && imgsrc.length > 0) {
			document.write('<img src="'+imgsrc+'" border="0" alt="" />');
		}
	} else {
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" align=""');
		if (id.length > 0) document.write(' id="'+id+'"');
		if (name.length > 0) document.write(' name="'+name+'"');
		document.write('>\n');
		document.write('<param name="movie" value="'+src+'" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="scale" value="noborder" />');
		document.write('<param name="wmode" value="transparent" />');
		document.write('<param name="bgcolor" value="'+bgcolor+'" />');
		if ((id.length == 0) && (name.length > 0)) id = name;
		document.write('<embed src="'+src+'" menu="false" quality="high" scale="noborder" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+id+'" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>');
		document.writeln('</object>');
	}
}

function showDiv(container) {
	document.getElementById(container+"off").style.display = "none";
	document.getElementById(container).style.display = "block";
}

function hideDiv(container) {
	document.getElementById(container).style.display = "none";
	document.getElementById(container+"off").style.display = "block";
}

function searchNavi(ul, group, query, text, classname, spanId) {
   
  var span = document.createElement('span');
  span.id = spanId;
  
  var link = document.createElement('a');
  link.href = '?make=find&localsearch=1&group='+group+'&query='+query;
  link.className = classname;  
  link.appendChild(document.createTextNode(text));
  link.appendChild(span);
  
  var li = document.createElement('li');
  li.appendChild(link);
  
  ul.appendChild(li);
}
