letztertop=""; // Variable die definiert welches der letzte aktive Oberpunkt war. Beim Start leer.
letzterprodukt=""; // Variable die definiert welches der letzte aktive Produktoberpunkt war. Beim Start leer.
lauf1breite="";
function showsub(wen){ // Blendet Subnavigationen ein
	act=1;
	wen.parentNode.style.background="#333333";
	wen.parentNode.nextSibling.style.top=wen.parentNode.offsetTop+"px";
	wen.parentNode.nextSibling.style.left=wen.parentNode.offsetLeft+"px";
	wen.parentNode.nextSibling.style.visibility="visible";
	wen.style.zIndex="499";
	wen.parentNode.style.zIndex="499";
	wen.parentNode.nextSibling.style.zIndex="500";
	wen.parentNode.nextSibling.style.display="inline";

	//wen.parentNode.nextSibling.firstChild.style.borderRight="solid 1px #ffffff";

	i=0;
	laswidth=120;

	if(navigator.userAgent.search("MSIE")!=-1){
		while(wen.parentNode.nextSibling.firstChild.childNodes[i] && i<15){
			if(wen.parentNode.nextSibling.firstChild.childNodes[i].offsetWidth>laswidth){
				laswidth=wen.parentNode.nextSibling.firstChild.childNodes[i].offsetWidth;
			}
			i=i+1;
		}
		i=0;
		while(wen.parentNode.nextSibling.firstChild.childNodes[i] && i<15){
			wen.parentNode.nextSibling.firstChild.childNodes[i].style.width=laswidth-11+"px";
			i=i+1;
		}
	}
	if(navigator.userAgent.search("MSIE 7")!=-1){
		wen.parentNode.nextSibling.style.top=wen.parentNode.offsetTop+135+"px";



	}


	letztertop=wen;
}

function hidesub(){ // Blendet Subnavigationen aus
	if(letztertop!=""){
		letztertop.parentNode.nextSibling.style.visibility="hidden";
		letztertop.parentNode.nextSibling.style.disolay="none";
		letztertop.parentNode.style.background="#454f56";
	}
}
function actcolor(wen){ // Farb?nderungen Mouseover (Hauptnavigation)
	wen.style.background="#333333";
}
function produktactcolor(wen){ // Farb?nderungen Mouseover (Produktnavigation)
	wen.style.background="#a1c6ee";
	if(letztertop!=""){
		letztertop.parentNode.nextSibling.style.visibility="hidden";
		letztertop.parentNode.nextSibling.style.disolay="none";
		letztertop.parentNode.style.background="#454f56";
	}
}

function inactcolor(wen){ // Farb?nderungen Mouseout (Hauptnavigation)
	wen.style.background="#454f56";
}
function produktinactcolor(wen){ // Farb?nderungen Mouseout (Produktnavigation)
	wen.style.background="#cbe0f4";
	if(letztertop!=""){
		letztertop.parentNode.nextSibling.style.visibility="hidden";
		letztertop.parentNode.nextSibling.style.disolay="none";
		letztertop.parentNode.style.background="#454f56";
	}
}
function show_produktsub(wen){ // Zeight Produktsubnavigation
	document.getElementById("fliesstext").style.visibility="hidden";
	if(letzterprodukt!=""){
		letzterprodukt.parentNode.nextSibling.style.backgroundImage="none";
		letzterprodukt.parentNode.nextSibling.style.display="none";
		letzterprodukt.parentNode.nextSibling.style.visibility="hidden";
		if(navigator.userAgent.search("MSIE 6") == -1 || navigator.userAgent.search("MSIE 7") != -1) {
			letzterprodukt.parentNode.style.backgroundImage="url(./images/global/bg_produktpunkt.gif)";
		}
	}
	if(navigator.userAgent.search("Safari")!=-1){ // Safari reagiert wie immer etwas anders...
		wen.parentNode.style.backgroundImage="url(./images/global/bg_produktpunkt_a.gif)";
		wen.parentNode.nextSibling.style.marginLeft="-18px";
		wen.parentNode.nextSibling.style.backgroundImage="none";
		wen.parentNode.nextSibling.style.display="inline";
		wen.parentNode.nextSibling.style.visibility="visible";
		wen.parentNode.nextSibling.firstChild.style.marginTop="0px";
		wen.parentNode.nextSibling.firstChild.style.marginBottom="-1px";
	}
	if(navigator.userAgent.search("MSIE 7")!=-1 || navigator.userAgent.search("MSIE 8")!=-1){ // UInd der IE 7 auch
			wen.parentNode.style.backgroundImage="url(./images/global/bg_produktpunkt_a.gif)";
			wen.parentNode.nextSibling.style.marginLeft="-18px";
			wen.parentNode.nextSibling.style.backgroundImage="none";
			wen.parentNode.nextSibling.style.display="inline";
			wen.parentNode.nextSibling.style.visibility="visible";
			wen.parentNode.nextSibling.firstChild.style.marginTop="-17px";
			wen.parentNode.nextSibling.firstChild.style.marginBottom="-1px";

	}
	else{
		//alert(wen.parentNode.nodeName);
		if(navigator.userAgent.search("MSIE 6") == -1) {
			wen.parentNode.style.backgroundImage="url(./images/global/bg_produktpunkt_a.gif)";
		}
		//alert(wen.parentNode.style.backgroundImage);
		wen.parentNode.nextSibling.style.backgroundImage="none";
		wen.parentNode.nextSibling.style.display="inline";
		wen.parentNode.nextSibling.style.visibility="visible";
	}
	neuenavhoehe=document.getElementById("produktnavigation").offsetHeight-28;
	document.getElementById("fliesstext").style.marginTop=-neuenavhoehe+"px";
	document.getElementById("fliesstext").style.visibility="visible";



	letzterprodukt=wen;
}
function sucheingabe(wen, suchwort){ // Blendet das Wort 'suchwort' aus wenn man ins Suchfel klickt
	if(wen.value==suchwort){
		wen.value="";
	}
}
function machegross(){ // Sorgt im IE für die Scrollbar
	produktnavheight=document.getElementById("produktnavigation").offsetHeight;
	neuehoehe=document.getElementById("fliesstext").offsetHeight+400;

	// Änderung vom 5.12.2007
	document.getElementById("hauptrahmen").style.height=neuehoehe+"px";

	// Hier wird für die richtige Positionierung des Suchbuttons im ie7 gesorgt

	if(navigator.userAgent.search("MSIE 7") != -1){
		document.getElementById("suchbutton").style.marginTop="9px";
	}

	// -----

	neuenavhoehe=document.getElementById("produktnavigation").offsetHeight-28;
	document.getElementById("fliesstext").style.marginTop=-neuenavhoehe+"px";
	document.getElementById("fliesstext").style.visibility="visible";
}

function bewegebanner(){ // Bewegt das Laufband
	if(lauf1breite==""){
		lauf1breite=document.getElementById("lauf1").offsetWidth;
		abstand=document.getElementById("fliesstext").offsetHeight+171;
		document.getElementById("laufband").style.top=abstand+"px";
	}
	document.getElementById("lauf1").style.position="static";
	aktuellemargin=parseInt(document.getElementById("lauf1").style.marginLeft);
	document.getElementById("lauf1").style.visibility="visible";
	document.getElementById("lauf1").style.marginLeft=aktuellemargin-1+"px";
	document.getElementById("lauf2").style.marginLeft=aktuellemargin-1+lauf1breite+2+"px";
	if(aktuellemargin<0-lauf1breite){
		document.getElementById("lauf1").style.marginLeft="0px";
	}
	window.setTimeout("bewegebanner()", 15);
}

function grossesbild(oeffner){
	window.open("vergroesserung.php?bild="+oeffner.src, "vergroesserung","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=10,height=10");

}
function popup(url, breite, hoehe, fenstername){
	window.open(url, fenstername,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+breite+",height="+hoehe);
}
function fensteranpassung(){
	fensterbreite=document.getElementById("bild").offsetWidth;
	fensterhoehe=document.getElementById("bild").offsetHeight;
	window.resizeTo(fensterbreite, fensterhoehe);
	bewegefenster();
}
function zeigeaktiveproduktsubnav(wen){
	if(wen!=""){
		if(document.getElementById(wen).parentNode.nextSibling.style.display=="none"){

			show_produktsub(document.getElementById(wen).parentNode.parentNode.parentNode.previousSibling.firstChild);


			// geändert: 120907
			//alert(navigator.userAgent);
			if(navigator.userAgent.search("MSIE 7") != -1){
				document.getElementById(wen).parentNode.style.height="30px";
				//alert(document.getElementById(wen).parentNode.nextSibling.firstChild);
				document.getElementById(wen).parentNode.nextSibling.firstChild.style.marginTop="-12px";
			}
			// ---


			document.getElementById(wen).parentNode.nextSibling.style.display="block";


			if(navigator.userAgent.search("MSIE 7")!=-1){
				document.getElementById(wen).parentNode.nextSibling.style.marginTop="-13px";
			}

			if(navigator.userAgent.search("MSIE")!=-1){
				if(document.getElementById(wen).parentNode.nextSibling.nextSibling==null){
					document.getElementById(wen).parentNode.nextSibling.style.marginBottom="-20px";
				}
			}


			neuenavhoehe=document.getElementById("produktnavigation").offsetHeight-28;
			document.getElementById("fliesstext").style.marginTop=-neuenavhoehe+"px";
		}
	}
}
function zeigeaktiveproduktsubsubnav(wen){
	if(wen!=""){
		document.getElementById(wen).style.background="#dddddd";
	}
}

function bewegefenster(){
	vonlinks=opener.document.getElementById("hauptrahmen").offsetLeft+870-document.getElementById("bild").offsetWidth-20;
	window.moveBy(vonlinks, 140);
}

function ReturnFalse() {

}



/**
 * Funktionen CW
 */

//CW -- 2007-05-03
function produktsubactcolor(wen){ // Farb?nderungen Mouseover (Produktsubnavigation)
	if(navigator.userAgent.search("MSIE 7") == -1){ //Nicht beim IE7!
		wen.style.background="#dddddd";
	}
}

//CW -- 2007-05-03
function produktsubinactcolor(wen){ // Farb?nderungen Mouseout (Produktsubnavigation)
	if(navigator.userAgent.search("MSIE 7") == -1){ //Nicht beim IE7!
		wen.style.background="#eee";
	}
}

function HideHighlighter() {
	document.getElementById("highlighter_anfrage").style.visibility = "hidden";
	document.getElementById("highlighter_anfrage").style.display = "none";
}

function HideHighlighter_Timer(sec) {
	setTimeout("HideHighlighter()", sec);
}
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 SetFormFocus(wo){
	if(wo != null) { wo.focus(); }
}

/**
 * Funktionen für Angebotsanfrageformular
 * CW - 2008-01-23
 */


function DoHideShowOrderElements(intSprache_ID){
	if(document.getElementById('sntIstBestellung').checked == true) {
		document.getElementById('tr_intZahlungsbedingung_ID').style.display = "";
		document.getElementById('tr_sntAGBgelesen').style.display = "";
		document.getElementById('tr_sntRueckruf').style.display = "none";
		document.getElementById('tr_sntAnfrage_Wie').style.display = "none";
		document.getElementById('td_hinweis_anfrage1').style.backgroundColor = "#99CCCC";
		document.getElementById('td_hinweis_anfrage1').style.backgroundImage="url(./images/global/icon_einkaufswagen.gif)";
		document.getElementById('td_hinweis_anfrage2').style.backgroundColor = "#99CCCC";
		document.getElementById('td_hinweis_anfrage3').style.backgroundColor = "#99CCCC";
		document.getElementById('td_hinweis_anfrage3').style.backgroundImage="url(./images/global/icon_einkaufswagen.gif)";
		switch(intSprache_ID) {
			default:
			case 1: //Deutsch
				document.getElementById('text_hinweis_anfrage').innerHTML = "verbindliche Bestellung";
			break;
			case 2: //Englisch
			case 8: //USA
				document.getElementById('text_hinweis_anfrage').innerHTML = "binding Order";
			break;
			case 4: //Spanisch
				document.getElementById('text_hinweis_anfrage').innerHTML = "Pedido con compromiso";
			break;
		}
	} else {
		document.getElementById('tr_intZahlungsbedingung_ID').style.display = "none";
		document.getElementById('tr_sntAGBgelesen').style.display = "none";
		document.getElementById('tr_sntRueckruf').style.display = "";
		document.getElementById('tr_sntAnfrage_Wie').style.display = "";
		document.getElementById('td_hinweis_anfrage1').style.backgroundColor = "#cbe0f4";
		document.getElementById('td_hinweis_anfrage1').style.backgroundImage="url(./images/global/icon_information.gif)";
		document.getElementById('td_hinweis_anfrage2').style.backgroundColor = "#cbe0f4";
		document.getElementById('td_hinweis_anfrage3').style.backgroundColor = "#cbe0f4";
		document.getElementById('td_hinweis_anfrage3').style.backgroundImage="url(./images/global/icon_information.gif)";
		switch(intSprache_ID) {
			default:
			case 1: //Deutsch
				document.getElementById('text_hinweis_anfrage').innerHTML = "unverbindliche Anfrage";
			break;
			case 2: //Englisch
			case 8: //USA
				document.getElementById('text_hinweis_anfrage').innerHTML = "Non-binding request";
			break;
			case 4: //Spanisch
				document.getElementById('text_hinweis_anfrage').innerHTML = "Solicitud sin compromiso";
			break;
		}
		}
}

function DoHideShowMediathek(action)
{
	if(document.getElementById('divMediathek').style.display == "none" || document.getElementById('divMediathek').style.display == "")
	{
		document.getElementById('divMediathek').style.display = "inline";
	}
	else
	{
		//document.getElementById('divMediathek').style.display = "none";
	}
	switch(action)
	{
		case "open":
			document.getElementById('divMediathek').style.display = "inline";
		break;
		case "close":
			document.getElementById('divMediathek').style.display = "none";
		break;
	}
}

function SetOrderElemets(){
	if(document.getElementById('sntIstBestellung').checked == false) {
		document.getElementById('sntAGBgelesen').checked = true;
	}
}

function SetStyleMediathekTR(when, row){
	switch(when)
	{
		case "onmouseover":
			document.getElementById('MediathekTR_' + row).style.backgroundColor='#CCCCFF';
			document.getElementById('MediathekIcon_' + row).style.border='1px solid #9999CC';
			document.getElementById('MediathekInhalt_' + row).style.border='1px solid #9999CC';
			//document.getElementById('MediathekInhalt_' + row).style.fontWeight='bold';
			document.getElementById('MediathekIconImg_' + row).style.display='inline';
			document.getElementById('MediathekIconImgSW_' + row).style.display='none';
			document.getElementById('MediathekIconImg_' + row).style.width='20px';
		break;
		case "onmouseout":
			document.getElementById('MediathekTR_' + row).style.backgroundColor='#FFFFFF';
			document.getElementById('MediathekIcon_' + row).style.border='1px solid #FFFFFF';
			document.getElementById('MediathekInhalt_' + row).style.border='1px solid #FFFFFF';
			//document.getElementById('MediathekInhalt_' + row).style.fontWeight='normal';
			document.getElementById('MediathekIconImg_' + row).style.display='none';
			document.getElementById('MediathekIconImgSW_' + row).style.display='inline';
		break;
	}
}