
var b=0;
var mac=0;
br = navigator.userAgent.toLowerCase();
if(br.indexOf("msie 4")!=-1){b=1;}//ie old
if((br.indexOf("msie 5")!=-1) || (br.indexOf("msie 6")!=-1) || (br.indexOf("msie 7")!=-1)){b=2;}//ie new
if(br.indexOf("mozilla/4.7")!=-1){b=3;}//NN 4.7x
if(br.indexOf("mozilla/5")!=-1){b=4;}//NN 6.x NN 7
if(br.indexOf("firefox")!=-1){b=5;}//firefox
if(br.indexOf("opera")!=-1){b=6;}//opera   
if(navigator.userAgent.indexOf("Mac")>-1){mac=1;}


// Firefox
if(b==5 || b==4)
	document.write("<LINK rel=\"stylesheet\" href=\"/site/media/styles/style_mz.css\" type=\"text/css\">");	





//	=========================================================================================== //
function showDiv(which) 
{ 
  //IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
  if (document.getElementById)
  { 
    	if ((which != "") && (document.getElementById(which)))
	  	{
	  		document.getElementById(which).style.visibility = 'visible';			
     	}
  }
}
//	=========================================================================================== //

//	=========================================================================================== //
function hideNavi()
{
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
		for(i=0;i<7;i++)
		{
			if (document.getElementById('subnav'+i))
			document.getElementById('subnav'+i).style.visibility="hidden";
		}
		hideAllSubnavi();
		document.getElementById('clearNavi').style.visibility="hidden";
	}
}
//	=========================================================================================== //

//	=========================================================================================== //
function hideAllSubnavi()
{
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
	
		var allDivs = document.getElementsByTagName("DIV");
	    for (i=0;i<(allDivs.length);i++)
		{
	    	if (allDivs[i]) 
		  		var allDivsname = allDivs[i].id;
		   	else
		  		var allDivsname = '';
		
	    	if (allDivsname.search('subnav') != -1)
					document.getElementById(allDivsname).style.visibility="hidden";
				
		}		
		
		
	}
}
//	=========================================================================================== //

function hideSubnavi(subnav)
{
	
	
	// Hier wird definiert wieviel Navigationspunkte maximal auf einer Ebene vorkommen
	// Wenn Navigationsstruktur noch nicht klar, muss diese Zahl eventuell erhöht werden, also bei mehr als 10 Navigations-
	// punkten auf einer Ebene.
	maxNavi=10;
	
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
	
		for(i=0;i<maxNavi;i++)
		{
			if(document.getElementById(subnav+'_'+i))
			{
				document.getElementById(subnav+'_'+i).style.visibility="hidden";
				for(z=0;z<maxNavi;z++)
				{
					if(document.getElementById(subnav+'_'+i+'_'+z))
						document.getElementById(subnav+'_'+i+'_'+z).style.visibility="hidden";
				}
			}	
		}		

	}
		
}

//	=========================================================================================== //
function hideDiv(which)
{
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
		document.getElementById(which).style.visibility="hidden";
	}
}
//	=========================================================================================== //

//	=========================================================================================== //
function hideAllDiv(what)
{
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
	
		var allDivs = document.getElementsByTagName("DIV");
	    for (i=0;i<(allDivs.length);i++)
		{
	    	if (allDivs[i]) 
		  		var allDivsname = allDivs[i].id;
		   	else
		  		var allDivsname = '';
		
	    	if (allDivsname.search(what) != -1)
					document.getElementById(allDivsname).style.visibility="hidden";
				
		}		
		
		
	}
}
//	=========================================================================================== //



//	=========================================================================================== //
function mkContentLines()
{
document.write("<div style=\"position:absolute;top:200px;left:20px;\"><img src=\"image/contentLinie.gif\" width=\"948\" height=\"2\" alt=\"\" border=\"0\"></div>");
}
//	=========================================================================================== //


//	=========================================================================================== //
function mkLanguageSelection()
{


}
//	=========================================================================================== //


function openWin(winUrl,winTitle,winWidth,winHeight)
{
	window.open(winUrl,winTitle,"toolbars=no,status=no,scrollbars=auto,width="+winWidth+",height="+winHeight+",left=0,top=0");
} 

var stopAutoChange=false;

function changePic(picName)
{
	// Automatischer Bildwechsel muss dann gestoppt werden
	stopAutoChange=true;	
	document.copyImg.src=picName;
	
}

function enlargePic()
{
	str=document.copyImg.src;
	
	var startPos1 = str.lastIndexOf("GALLERY.jpg");
	var subStr2 = str.slice(0,startPos1);
	openWin(subStr2+'LARGE.jpg',660,510); 
	
}

// Modifiziert 22.06.2007
function enlargePic3()
{
	var arrPos=getArrPos();
	if(files[arrPos][1]!="")
		openWin(files[arrPos][1],660,510); 
}

// Modifiziert 22.06.2007
function getArrPos()
{
	var str = document.formular.activeZahl.value;	
	var subStr1 = str.substr(4);
	arrPos=parseInt(subStr1);
	return arrPos; 
}


function enlargePic2(imgSrc,imgWidth,imgHeight)
{
	openWin(imgSrc+'_gross.htm',imgWidth,imgHeight+30);
}

function openNamedPopUp(sourceFile,popupName,xPos,yPos,winWidth,winHeight,scrollbars){
	if (document.all) window.open(sourceFile,popupName,"height="+(winHeight)+",width="+(winWidth)+",scrollbars="+scrollbars+",innerWidth="+winWidth+",innerHeight="+winHeight+",left="+xPos+",top="+yPos+",toolbar=no,location=no,status=no,menubar=no,resizable=yes");
	else window.open(sourceFile,popupName,"innerWidth="+(winWidth)+",innerHeight="+(winHeight)+",left="+(xPos)+",top="+(yPos)+",scrollbars="+scrollbars+",toolbar=no,location=no,status=no,menubar=no,resizable=yes");
}

function paramList(querystring) {
	if(querystring == '') return;
	var valueestring = unescape(querystring);
	valueestring = valueestring.slice(1);
	var pairs = valueestring.split("&");
	for (var i=0; i < pairs.length; i++) {
		var name = pairs[i].substring(0, pairs[i].indexOf("="));
		var value = pairs[i].substring(pairs[i].indexOf("=")+1, pairs[i].length);
		this[name] = value;
	}
}

var list = new paramList(window.location.search);

function displayImage() {
	if ((!list['imagepath'])||(list['imagepath'] == 0)){
		document.write("<b>Bild kann nicht angezeigt werden!</b><br><br><b>Image cannot be displayed!</b>");
	}else {
		document.write("<img border='0px' alt='' src='" + list['imagepath'] + "'><br/>");
	}
	if ((!list['imagepathOriginal'])||(list['imagepathOriginal'] == 0)){
		//nichts ausgeben
	}else {
		document.write("<div class='copyText' style='margin:10px;'><a href='" + list['imagepathOriginal'] + "'>original resolution</a></div>");
	}
}

function unsetHighlight(what)
{
	//IE 5.5, 6, 7, Firefox 1, Firefox 2, NS6/7
	if (document.getElementById)
	{
	
		var allItems = document.getElementsByTagName("A");
	    for (i=0;i<(allItems.length);i++)
		{
	    	if (allItems[i]) 
		  		var allItemsname = allItems[i].id;
		   	else
		  		var allItemsname = '';
		
	    	if (allItemsname.search(what) != -1)
					document.getElementById(allItemsname).className="unhighlightLink";
				
		}		
	}
}


function setHighlight(id1)
{
	//highlight
	if(id1!="")
	{
		document.getElementById(id1).className="highlightLink";
	}	
}

// Link weiss auf grauem Hintergrund hightlighten
function setHighlightBG(id1)
{
	//highlight
	if(id1!="")
	{
		document.getElementById(id1).className="highlightLinkBG";
		document.getElementById(id1).style.color="#ffffff";
	}	
}



// Modifiziert 22.06.2007
function setHighlightZahl(id1){
	
	document.formular.activeZahl.value=id1;
	
	// Enlarge ein- oder ausblenden
	var arrPos=getArrPos();

	if(files[arrPos][1]!="")
	{
		document.getElementById('enlarge').style.visibility="visible";
		document.getElementById('copyBildAhref').style.cursor="pointer";
	}	
	else 
	{
		document.getElementById('enlarge').style.visibility="hidden";
		document.getElementById('copyBildAhref').style.cursor="default";
	}	
		
	
	//highlight
	if(id1!="")
	{
		document.getElementById(id1).style.color="#FF850D";
	}	
	
}

//	Maximal 8 Bilder vorgesehen für Durchlauf, ansonsten hier erweitern
function resetHighlightZahl()
{
	//unhighlight
		az=document.formular.activeZahl.value;
	if (document.getElementById("zahl1") && az!="zahl1")	
		document.getElementById("zahl1").style.color="#10238C";

	if (document.getElementById("zahl2") && az!="zahl2")		
		document.getElementById("zahl2").style.color="#10238C";
	
	if (document.getElementById("zahl3") && az!="zahl3")	
		document.getElementById("zahl3").style.color="#10238C";
	
	if (document.getElementById("zahl4") && az!="zahl4")	
		document.getElementById("zahl4").style.color="#10238C";
	
	if (document.getElementById("zahl5") && az!="zahl5")	
		document.getElementById("zahl5").style.color="#10238C";
	
	if (document.getElementById("zahl6") && az!="zahl6")	
		document.getElementById("zahl6").style.color="#10238C";		
	
	if (document.getElementById("zahl7") && az!="zahl7")	
		document.getElementById("zahl7").style.color="#10238C";		
	
	if (document.getElementById("zahl8") && az!="zahl8")	
		document.getElementById("zahl8").style.color="#10238C";		
}

function unhightlightAllZahl(maxZahl)
{	
	for(i=1;i<=maxZahl;i++)
		document.getElementById("zahl"+i).style.color="#10238C";
}


// Modifiziert 22.06.2007
var imgCounter=1;
function changeCopyImg(files,maxPic)
{
	if(stopAutoChange==true)
		return;
		
	// maxPic + 1 da nach einem kompletten Durchlauf wieder das erste Bild 
	// angezeigt werden soll
	if(imgCounter==maxPic+1)
	{
		document.copyImg.src=files[1][0];
		unhightlightAllZahl(maxPic);
		setHighlightZahl('zahl1');
		return;
	}	
	
	// Bildwechsel
	document.copyImg.src=files[imgCounter][0];
	unhightlightAllZahl(maxPic);
	setHighlightZahl('zahl'+imgCounter);
	
	imgCounter++;
	
	if(imgCounter<=maxPic+1)
		setTimeout('changeCopyImg(files,maxPic)',1000);
}



function flashPopUp(page)
{
	if(page=="0")
		openWin("popUpAseptik.htm",300,440);
	 if(page=="1")
		openWin("popUpAseptik.htm",300,440);	
}

function getPosition(obj) {
  var pos = { x:0, y:0 };

  do {
    pos.x += obj.offsetLeft;
    pos.y += obj.offsetTop;
  } while (obj = obj.offsetParent);

  return pos;
}

//	=========================================================================================== //
//	Divs der weiteren Navigationsebenen
//	=========================================================================================== //
function mkSubNav()
{
	
	// Offset Positionen für die Subnavigationen 
	//arrOffsetLeft	= new Array("","0","110","220","330","450","550","660");
	
	// Definition in welche Richtung das Menu aufklappen soll
	arrDirection	= new Array("","right","right","right","left","left","left","left");
	
	
	// Breite der Divs (Box Model Bug IE)
	if(b==5 || b==4)
	{
		extraLeft=30;
		extraTop=12;
		divWidth=143;
	}	
	else
	{	
		extraLeft=0;
		extraTop=11;
		divWidth=165;
	}	
	
	// Zeilenabstand
	lineHeight=12;

	
	document.write("<div id=\"subNaviContainer\">");	
	
	// Ebene 2
	for(i=1;i<8;i++)
	{
		for(p=0;p<arrNavigation[i].length;p++)
		{
			
			for(m=0;m<arrNavigation[i][p].length;m++)
			{
				
				for(k=0;k<arrNavigation[i][p][m].length;k++)
				{
					
					if(typeof arrNavigation[i][p][m][k]=="string" && p!=0 && m==0 && k==0
						&& arrNavigation[i][0][0][0] != "" )
					{
						
						// Prüfen ob für es für diesen Menupunkt eine weitere Unterebene gibt und mouseover entsprechend definieren
						if(typeof arrNavigation[i][p][parseInt(m+1)][k]=="string")
							strMouseOver="onmouseover=\"hideSubnavi('subnav"+i+"');showDiv('subnav"+i+"_"+p+"');\" ";
						else	
							strMouseOver="onmouseover=\"hideSubnavi('subnav"+i+"');\"";						
						
						// Beim ersten Navipunkt, muss Div geöffnet werden
						if(p==1)
							document.write("<div id=\"subnav"+i+"\" class=\"subNaviText\" onmouseover=\"MM_swapImage('navi"+i+"','','"+arrMenuImage[i]+"',1)\" style=\"position:absolute;left:"+arrOffsetLeft[i]+"px;top:10px;width:"+divWidth+"px;float:left;\">");
						

						if (arrNavigation[i][p][m][k] != "") {	
							document.write("<img src=\"/media/images/global/pixel.gif\" id=\"pixel_"+i+"_"+p+"_"+m+"_"+k+"\" width=\"1\" height=\"1\" alt=\"\" border=\"0\">");
							document.write("<p style=\"text-indent:-7px;margin:0px;\"><a href=\""+arrNaviToPage[i][p][m][k]+"\" id=\"subnavLink_"+i+"_"+p+"\" "+strMouseOver+">_"+arrNavigation[i][p][m][k]+"</a></p>");
						} 
						
						// Wenn kein weiterer Navipunkt mehr folgt, Div wieder schliessen
							if(typeof arrNavigation[i][parseInt(p+1)][m][k]!="string")
							//if ((p+1) >= arrNavigation[i].length)
								document.write("</div>");
					}						
				}
				
			}
			
		}	
	}
	
	// Ebene 3
	for(i=1;i<8;i++)
	{
		for(p=0;p<arrNavigation[i].length;p++)
		{
			
			for(m=0;m<arrNavigation[i][p].length;m++)
			{
				
				for(k=0;k<arrNavigation[i][p][m].length;k++)
				{
					
					if(typeof arrNavigation[i][p][m][k]=="string" && p!=0 && m!=0 && k==0
						&& arrNavigation[i][0][0][0] != "" && arrNavigation[i][p][0][0] != "")
					{
						
						// Prüfen ob für es für diesen Menupunkt eine weitere Unterebene gibt und mouseover entsprechend definieren
						if(typeof arrNavigation[i][p][m][parseInt(k+1)]=="string")
							strMouseOver="onmouseover=\"hideSubnavi('subnav"+i+"_"+p+"');showDiv('subnav"+i+"_"+p+"_"+m+"');\" ";
						else	
							strMouseOver="onmouseover=\"hideSubnavi('subnav"+i+"_"+p+"');\"";
						
						// Beim ersten Navipunkt, muss Div geöffnet werden
						if(m==1)
						{
							
							// Left Position berechnen (left = arrOffsetLeft - Breite der Divs + 1 + extraLeft)
							// Dies gilt wenn das Menu nach rechts aufklappen soll
							if(arrDirection[i]=="right")
								divLeft=parseInt(arrOffsetLeft[i]) + parseInt(divWidth)-1+extraLeft;
																
							
							// Left Position berechnen (left = arrOffsetLeft - Breite der Divs + 1 - extraLeft)
							// Dies gilt wenn das Menu nach links aufklappen soll
							if(arrDirection[i]=="left")
								divLeft=arrOffsetLeft[i]-divWidth+1-extraLeft;
							// Top Position berechnen
							pixPos=getPosition(document.getElementById('pixel_'+i+'_'+p+'_0_0'));
							divTop=pixPos.y-179+extraTop;
							
							document.write("<div id=\"subnav"+i+"_"+p+"\" class=\"subNaviText\" style=\"position:absolute;left:"+divLeft+"px;top:"+divTop+"px;width:"+divWidth+"px;float:left;\">");
						}
						if (arrNavigation[i][p][m][k] != "") {						
							document.write("<img src=\"/media/images/global/pixel.gif\" id=\"pixel_"+i+"_"+p+"_"+m+"_"+k+"\" width=\"1\" height=\"1\" alt=\"\" border=\"0\">");
							document.write("<p style=\"text-indent:-7px;margin:0px;\"><a href=\""+arrNaviToPage[i][p][m][k]+"\" id=\"subnavLink_"+i+"_"+p+"_"+m+"\" "+strMouseOver+">_"+arrNavigation[i][p][m][k]+"</a></p>");
						}
						// Wenn kein weiterer Navipunkt mehr folgt, Div wieder schliessen
						if(typeof arrNavigation[i][p][parseInt(m+1)][k]!="string")
							document.write("</div>");
					}
				}
			}
		}
	}
	
	
	// Ebene 4
	for(i=1;i<8;i++)
	{
		for(p=0;p<arrNavigation[i].length;p++)
		{
			
			for(m=0;m<arrNavigation[i][p].length;m++)
			{
				
				for(k=0;k<arrNavigation[i][p][m].length;k++)
				{
					
					if(typeof arrNavigation[i][p][m][k]=="string" && p!=0 && m!=0 && k!=0
						&& arrNavigation[i][p][m][0] != "" && arrNavigation[i][p][0][0] != "" && arrNavigation[i][0][0][0] != "" )
					{
						// Beim ersten Navipunkt, muss Div geöffnet werden
						if(k==1)
						{
							
							// Left Position berechnen (left = arrOffsetLeft + (Breite der Divs *2) - 2 + (extraLeft*2))
							// Dies gilt wenn das Menu nach rechts aufklappen soll
							if(arrDirection[i]=="right")							
								divLeft=parseInt(arrOffsetLeft[i])+(divWidth*2)-2+(extraLeft*2);
								
								
							// Left Position berechnen (left = arrOffsetLeft - (Breite der Divs *2) + 2 - (extraLeft*2))
							// Dies gilt wenn das Menu nach links aufklappen soll
							if(arrDirection[i]=="left")
								divLeft=arrOffsetLeft[i]-(divWidth*2)+2-(extraLeft*2);
							
							
							// Top Position berechnen
							pixPos=getPosition(document.getElementById('pixel_'+i+'_'+p+'_'+m+'_0'));
							divTop=pixPos.y-179+extraTop;
							
							document.write("<div id=\"subnav"+i+"_"+p+"_"+m+"\" class=\"subNaviText\" style=\"position:absolute;left:"+divLeft+"px;top:"+divTop+"px;width:"+divWidth+"px;float:left;\">");
						}
						if (arrNavigation[i][p][m][k] != "") {
							document.write("<img src=\"/media/images/global/pixel.gif\" id=\"pixel_"+i+"_"+p+"_"+m+"_"+k+"\" width=\"1\" height=\"1\" alt=\"\" border=\"0\">");
							document.write("<p style=\"text-indent:-7px;margin:0px;\"><a href=\""+arrNaviToPage[i][p][m][k]+"\" id=\"subnavLink_"+i+"_"+p+"_"+m+"_"+k+"\" onmouseover=\"\">_"+arrNavigation[i][p][m][k]+"</a></p>");
						}
						
						// Wenn kein weiterer Navipunkt mehr folgt, Div wieder schliessen
						if(typeof arrNavigation[i][p][m][parseInt(k+1)]!="string")
							document.write("</div>");
					}
				}
			}
		}
	}
	document.write("</div>");

}
//	=========================================================================================== //



// Funktion bestimmt Höhe des pixel.gif im Contentbereich
// damit der Footer den Mindestabstand hat, auch wenn 
// der Content geringer ist als die Navigation.
function setMinHeight()
{
var pos = getPosition(document.getElementById('endNavi'));
//alert(pos.x + '/' + pos.y);
var minHeight=529; //IE 
var newHeight=265; 
var addHeight=0;
var extra=0;
// Firefox / Netscape starten hiermit   
if(b==4 || b==5)
{
	minHeight=523;
	extra=3;
}	

if(pos.y>minHeight)
{
	var addHeight=pos.y-minHeight;
	newHeight=265+addHeight+extra;
}	

return document.write("<img src=\"image/pixel.gif\" width=\"1\" height=\""+newHeight+"\" alt=\"\" border=\"0\">");
}





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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); 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 setActiveNaviImg(what)
{
	if(what!="" && what!="undefined")
		eval("document."+what+".src='image/"+what+"_h.gif';");
}
//-->
