<!--
// *************************************************************************
//  Allgemeines Script zur Bestimmung enthaltener Objekte im Dokument:
//  Wird von weiteren Scripts benutzt, um ein Objekt zu determinieren
// *************************************************************************
function findObj(n, d) { 
  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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); 
  return x;
}


// *************************************************************************
//  Bilder fuer MouseOvers vorausladen (body onLoad etc.)
// *************************************************************************
function preloadImages() {
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}


// *************************************************************************
//  Funktion fuer MouseOvers 
// *************************************************************************
function swapImage() { 
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// *************************************************************************
//  Funktion fuer MouseOut 
// *************************************************************************
function swapImgRestore() { 
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


// *************************************************************************
//  Fuer Newsletter-Abo-Formulare zur Themenauswahl
// *************************************************************************
// Checked alle Checkboxen t_<n> im Formular mit Namen newsletterform.
function selectAllTopics() {
    if (document.forms.newsletterform != null) {
        if (document.forms.newsletterform.t_alle.checked == true) {
            for (var i=1; i <= 10; i++) {
                if (eval("document.forms.newsletterform.t_" + i + "!=null")) {
                    eval("document.forms.newsletterform.t_" + i + ".checked = true");
                }
            }
        }
    }
}
// *************************************************************************
//  Fuer Newsletter-Abo-Formulare zur Themenauswahl
// *************************************************************************
// Setzt im Newsletter-Themenauswahl-Formular "alle" auf false.
function deselectAllTopicsCheckbox() {
    if (document.forms.newsletterform != null) {
        document.forms.newsletterform.t_alle.checked=false;
    }
}


// *************************************************************************
//  Aus einem select-Feld direkt zu einer URL wechseln
// *************************************************************************
// Im select-Feld folgendes hinzufuegen: onChange="jumpMenu('parent',this,0)"
function jumpMenu(targ,selObj,restore) {
  if (selObj.options[selObj.selectedIndex].value == "") {
    return false;
  } else {
    if (selObj.options[selObj.selectedIndex].value.charAt(0) == '/') {
        var s = selObj.options[selObj.selectedIndex].value.substr(1);
        eval(targ+".location='"+s+"'");
    } else {
        eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    }
    if (restore) { 
      selObj.selectedIndex=0;
    }
  }
}


// *************************************************************************
//  [1a]  Table-Zellen oder Rows highlighten
// *************************************************************************
// x = welches Objekt, y = welche Farbe (kann uebergeben werden)
function hilite(x,y) {
  if ( y == "" || y == null ) {
    y = "#006BB7";
  }
  x.style.backgroundColor = y;
  x.style.cursor = "hand";
}


// *************************************************************************
//  [1b]  Gehighlightete Table-Zellen oder Rows wieder zururcksetzen
// *************************************************************************
function hiliteRestore(x,y) {
  if ( y == "" || y == null ) {
    y = "#FFFFFF";
  }
  x.style.backgroundColor = y;
}


// *************************************************************************
//  [2a]  Table-Zellen oder Rows mit Bild highlighten
// *************************************************************************
// x = welches Objekt, y = welche Farbe (kann uebergeben werden)
function hilite2(x,y,image) {
  if ( y == "" || y == null ) {
    y = "#FFFFFF";
  }
  var xbase = x.id.substr(0,x.id.lastIndexOf("_"));
  var xending = x.id.substr(x.id.lastIndexOf("_")+1);
  alert(xending)
  return;
  var x2name = xbase;
  if (xending == "1") {
    x2name = x2name + "_2";
  } else {
    x2name = x2name + "_1";  
  }
  var x2 = findObj(x2name)

  x.style.backgroundColor = y;
  x2.style.backgroundColor = y;

  x.style.cursor = "hand"; // nur IE?
  
  findObj(xbase + "_img").src = image // Bild tauschen
}


// *************************************************************************
//  [2b]  Gehighlightete Table-Zellen oder Rows wieder zururcksetzen
// *************************************************************************
function hiliteRestore2(x,y,image) {
  if ( y == "" || y == null ) {
    y = "#F5B83D";
  }
  x.style.backgroundColor = y;
  var xbase = x.id.substr(0,x.id.lastIndexOf("_"));
  var xending = x.id.substr(x.id.lastIndexOf("_")+1);
  var x2name = xbase;
  if (xending == "1") {
    x2name = x2name + "_2";
  } else {
    x2name = x2name + "_1";  
  }
  var x2;
  eval ("x2 = document.all." + x2name);
  x2.style.backgroundColor = y;
  eval ("document.all." + xbase + "_img.src = \"" + image +  "\"");
}


// *************************************************************************
//  Neues Fenster mit angegebenen Parametern oeffnen 
// *************************************************************************

// Funktion, um den Link des Popups fuer das CPS zurechtzuschneiden

function createLink (link) {

  // Nachsehen, ob "Reddot" vorkommt ...
  found = link.toLowerCase().lastIndexOf("/cps/");
  if (found != -1) {
    return link;
  }
  
  // Nachsehen, ob ".jsp" vorkommt ...
  found = link.toLowerCase().lastIndexOf(".jsp");
  if (found != -1) {
    return link;
  }
  
  // Hier wird dann der Link incl SeesinID etc. zusammengeschoben
  
  var url = document.location.href;
  found = url.lastIndexOf("/hs.xsl/");
  if (found != -1) {
    url = url.substring(0,found+7) + link;
  }  
  else {
    var url2 = url.substr(7,100);
    found = url2.indexOf("/");
    url = "http://" + url2.substring(0,found+1) + link;
  }
  
  return url;
}

// Neues Fenster für Suche mit entsprechend zusammengeschobener URL oeffnen

function openSearchPopup(form, theURL,winName,features) {
    var query = form.elements['query'].value;
    var sid   = form.elements['sid'].value;
    var url = theURL + "?query=" + escape(query) + "&sid=" + escape(sid);
    openWindow(url, winName, features);
    return false;
}

// Neues Fenster mit entsprechend zusammengeschobener URL oeffnen

function openWindow(theURL,winName,features) {
  newwin = window.open(createLink(theURL),winName,features);
  newwin.focus();
}

function openPlzPopup(url,hgroup,product,features) {
    var url2 = createLink(url) + "?hgruppe=" + hgroup + "&filter=yes&produkt=" + product;
    openWindow(url2, 'Haendler', 'width=480,height=580,toolbar=no,resizable=no,scrollbars=yes,top=10,left=200');
}

// Produkt-Bild Popup öffnen
// url: URL des Popups
// image: absoluter Pfadf zum Bild, z.B. "/bilder/produkte/xxx.gif"
// name: Produktname
// subtitle: Produkt-Untertitel
// type: "b2c" oder "b2b" oder "support"
// widh: window width
// height: window height

function openProductImagePopup(url,image,name,subtitle,width,height) {

  if (image == '') return;

  //
  // If in RedDot, dont replace special chars 
  //
  var url2 = document.location.href;
  var found = url2.toLowerCase().lastIndexOf("/reddot4/");
  
  if (found == -1) {    
    //
    // Replace special Chars in name
    //
    /*
    var charAe = String.fromCharCode(196);
    name = name.replace(charAe,"&Auml;"); 

    var charae = String.fromCharCode(228);
    name = name.replace(charae, "&auml;");
    
    var charOe = String.fromCharCode(214);
    name = name.replace(charOe, "&Ouml;");
    
    var charoe = String.fromCharCode(246);
    name = name.replace(charOe, "&ouml;");
    
    var charUe = String.fromCharCode(220);
    name = name.replace(charUe, "&Uuml;");
    
    var charue = String.fromCharCode(252);
    name = name.replace(charue, "&uuml;");
   
    var charsz = String.fromCharCode(223);
    name = name.replace(charsz, "&szlig;");

    name = encodeURIComponent(name);
    */
    name = escape(name);

    
    //
    // Replace special Chars in subtitle
    //
    /*
    var charAe2 = String.fromCharCode(196);
    subtitle = subtitle.replace(charAe2, "&Auml;");
    
    var charae2 = String.fromCharCode(228);
    subtitle = subtitle.replace(charae2, "&auml;");
    
    var charOe2 = String.fromCharCode(214);
    subtitle = subtitle.replace(charOe2, "&Ouml;");

    var charoe2 = String.fromCharCode(246);
    subtitle = subtitle.replace(charoe2, "&ouml;");

    var charUe2 = String.fromCharCode(220);
    subtitle = subtitle.replace(charUe2, "&Uuml;");

    var charue2 = String.fromCharCode(252);
    subtitle = subtitle.replace(charue2, "&uuml;");

    var charsz2 = String.fromCharCode(223);
    subtitle = subtitle.replace(charsz2, "&szlig;");

    subtitle = encodeURIComponent(subtitle);
    */
    subtitle = escape(subtitle);
    
  }
  
    //
    // Render path, either in RedDot and also in Live Mode 
    //
    productpopup = window.open(url + '?image=' + image + '&name=' + name + '&subtitle=' + subtitle, 'productPopUp', 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes');
}


// *************************************************************************
//  Aus einem Select-Field heraus zu einer URL springen, option muss value enthalten
// *************************************************************************
function selectURL(targ,selObj,restore) { 
  if (selObj.options[selObj.selectedIndex].value != "") {
//    eval (targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'");
    eval ( window.open( selObj.options[selObj.selectedIndex].value,'popup','' ) );
    if (restore) 
      selObj.selectedIndex = 0;
  } else {
    return; 
  }
}


// *************************************************************************
//  [a]  Table-Zellen oder Rows highlighten
// *************************************************************************
// x = welches Objekt
function navhilite(x,t) {
    /*
  if (t == "b2c") {
    swapnav(x,'#ffffff','/deteweimages/link_orange.gif')
  }
  else {
    // swapnav(x,'#f5b83d','/deteweimages/link_weiss.gif') 
    swapnav(x,'#dedede','/deteweimages/link_weiss.gif')
  }
  x.style.cursor = "hand"; // nur IE?
  */
}



// *************************************************************************
//  [b]  Table-Zellen oder Rows lowlighten
// *************************************************************************
// x = welches Objekt
function navrestore(x,t) {
  if (t == "b2c") {
    swapnav(x,'#f5b83d','/deteweimages/link_weiss.gif')
  }
  else {
    swapnav(x,'#ffffff','/deteweimages/link_orange.gif')
  }
  x.style.cursor = "default"; // nur IE?
}


// *************************************************************************
//  [c]  Darstellung aendern von Objekten
// *************************************************************************
// x = welches Objekt
function swapnav (obj, color, imgsrc) {
  if (!obj || !color || !imgsrc) {
    return;
  } else {
    var xbase = obj.id.substr( 0,obj.id.lastIndexOf("_") );
    for (i = 1; i <= 4; i++) {
      findObj(xbase + "_" + i).style.backgroundColor = color;
    }
    findObj(xbase + "_img").src = imgsrc // Bild tauschen
  }
}



// *************************************************************************
//  Texte in Layern (div-Tags) austauschen 
// *************************************************************************
function setLayertext(objName,x,newText) { 
  if ( (obj = findObj(objName) ) != null ) with (obj) {
    if ( document.layers ) { 
      document.write(unescape(newText)); 
      document.close(); 
	} else {
      innerHTML = unescape(newText);
	}
  }
}

// *************************************************************************
//  rudimentaer Passwort und PW-Wiederholung auf Uebereinstimmung prüfen
// *************************************************************************
function matchPasswords() {
	if ( document.anmeldungX.passwort ) {
		if(document.anmeldungX.passwort.value != ''){
			if ( document.anmeldungX.passwort2.value != document.anmeldungX.passwort.value ) {
				alert('Das eingegebene Passwort stimmt nicht mit der Passwort-Wiederholung überein.');
			}	
		}
	} 
}

// =========================================================
// *************************************************************************
//
//  AB HIER :  FOOTER NAVIGATION MIT LAYERN
// 
// =========================================================
// *************************************************************************



// *************************************************************************
//  Layer ein- und ausblenden
// *************************************************************************
function showHideLayers() { 
  var i,p,v,obj,args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ( ( obj = findObj(args[i]) ) != null ) { 
      v = args[i+2];
      if (obj.style) { 
        obj = obj.style; 
        v = ( v == 'show' ) ? 'visible' : ( v == 'hide' ) ? 'hidden' : v; 
      }
      obj.visibility = v; 
    }
  }
}

function hideAllLayers() {
  layerCount = 5;  // Wieviele Layers zurücksetzen?
  for (i=0; i<layerCount; i++) {
    showHideLayers('floatLayer'+i,'','hide');
  }
}

// **************************************************************
//  Globale Variablen, Browsercheck und Browserhoehe ermitteln
// **************************************************************

// Opera wird extra identifiziert
var opera;
var currentBrowser = navigator.userAgent;
var search = currentBrowser.indexOf("Opera"); 
if (search != -1) var opera = true;

// Andere Browser checken
var ns6 = (!document.all && document.getElementById); 
var ie4 = (document.all);
var ns4 = (document.layers);

// Vertikale Position der Layers
var topMargin1;
var topMargin2;
var topMargin3;
var topMargin4;

// Definierte Hoehe der Layers (nur bei NS4 anders)
if (ie4) {
  var layerHeight1 = 24;
  var layerHeight2 = 98;
  var layerHeight3 = 98;
  var layerHeight4 = 98;
} else if (ns6 || opera) {
  var layerHeight1 = 25;
  var layerHeight2 = 98;
  var layerHeight3 = 98;
  var layerHeight4 = 98;
} else {
  var layerHeight_NN_1 = 40;
  var layerHeight_NN_2 = 125;
  var layerHeight_NN_3 = 125;
  var layerHeight_NN_4 = 125;
}

// Alternative Positionen fuer nicht definierte Browser...
var layerHeightAltenrnative1 = 100;
var layerHeightAltenrnative2 = 100;

// Timer fuer animierte Bewegung
var slideTime  = 1;

// Hoehe des Browsers ermitteln (findHt = find height)
function floatObject() { 
  if (ns4 || ns6) {
    findHt =  window.innerHeight;
  } else if(ie4) {
    findHt =  document.body.clientHeight;
  }
} 

// **************************************************************
//  Hauptfunktionen fuer die Footerlayers
// **************************************************************
function main() { 
  // Layers browserspezifisch nach ganz unten positionieren
  if (ns4) {
    topMargin1 = window.innerHeight - layerHeight_NN_1;
    topMargin2 = window.innerHeight - layerHeight_NN_2;
    topMargin3 = window.innerHeight - layerHeight_NN_3;
    topMargin4 = window.innerHeight - layerHeight_NN_4;
  } else if  (ns6 ||opera) {
    topMargin1 = window.innerHeight - layerHeight1;
    topMargin2 = window.innerHeight - layerHeight2;
    topMargin3 = window.innerHeight - layerHeight3;
    topMargin4 = window.innerHeight - layerHeight4;
  } else if (ie4) {
    topMargin1 = document.body.clientHeight - layerHeight1;
    topMargin2 = document.body.clientHeight - layerHeight2;
    topMargin3 = document.body.clientHeight - layerHeight3;
    topMargin4 = document.body.clientHeight - layerHeight4;
  } else {
    topMargin1 = layerHeightAltenrnative1;
    topMargin2 = layerHeightAltenrnative2;
    topMargin3 = layerHeightAltenrnative3;
    topMargin4 = layerHeightAltenrnative4;
  }

  // Y-Position der Layers neu bestimmen
  if (ns4) { 
    this.currentY1   = document.floatLayer1.top; 
    this.currentY2   = document.floatLayer2.top;
    this.currentY3   = document.floatLayer3.top;
    this.currentY4   = document.floatLayer4.top; 
    this.scrollTop1  = window.pageYOffset;
    this.scrollTop2  = window.pageYOffset;
    this.scrollTop3  = window.pageYOffset;
    this.scrollTop4  = window.pageYOffset;
    mainTrigger();
  } else if(ns6) {
    this.currentY1 = parseInt(document.getElementById('floatLayer1').style.top); 
    this.currentY2 = parseInt(document.getElementById('floatLayer2').style.top); 
    this.currentY3 = parseInt(document.getElementById('floatLayer3').style.top); 
    this.currentY4 = parseInt(document.getElementById('floatLayer4').style.top); 
    this.scrollTop1 = scrollY;
    this.scrollTop2 = scrollY;
    this.scrollTop3 = scrollY;
    this.scrollTop4 = scrollY;
    mainTrigger(); 
  } else if(ie4) { 
    this.currentY1   = floatLayer1.style.pixelTop;
    this.currentY2   = floatLayer2.style.pixelTop;
    this.currentY3   = floatLayer3.style.pixelTop;
    this.currentY4   = floatLayer4.style.pixelTop;
    this.scrollTop1  = document.body.scrollTop; 
    this.scrollTop2  = document.body.scrollTop; 
    this.scrollTop3  = document.body.scrollTop; 
    this.scrollTop4  = document.body.scrollTop; 
    mainTrigger();
  } 
} 


function mainTrigger() { 
  // Trigger fuer Positionsbestimmung und -abgleich der Layers
  var newTargetY1  = this.scrollTop1 + this.topMargin1;
  var newTargetY2  = this.scrollTop2 + this.topMargin2;
  var newTargetY3  = this.scrollTop3 + this.topMargin3;
  var newTargetY4  = this.scrollTop4 + this.topMargin4;
  
  if ( this.currentY1 != newTargetY1 || this.currentY2 != newTargetY2 || this.currentY3 != newTargetY3 || this.currentY4 != newTargetY4 ) { 
    if ( newTargetY1 != this.targetY1 || newTargetY2 != this.targetY2 || newTargetY3 != this.targetY3 || newTargetY4 != this.targetY4 ) { 
      this.targetY1 = newTargetY1;
      this.targetY2 = newTargetY2;
      this.targetY3 = newTargetY3;
      this.targetY4 = newTargetY4;
      floatStart();
    }
    animator(); 
  }
}


function floatStart() {
  var now  = new Date();
  this.A1    = this.targetY1 - this.currentY1;
  this.A2    = this.targetY2 - this.currentY2;
  this.A3    = this.targetY3 - this.currentY3;
  this.A4    = this.targetY4 - this.currentY4;
  
  this.B    = Math.PI / ( 2 * this.slideTime );
  this.C    = now.getTime();

  // Layers bewegen, wenn noetig
  if ( Math.abs(this.A1) > this.findHt ) { 
    this.D1 = this.A1 > 0 ? this.targetY1 - this.findHt : this.targetY1 + this.findHt;
    this.D2 = this.A2 > 0 ? this.targetY2 - this.findHt : this.targetY2 + this.findHt;
    this.D3 = this.A3 > 0 ? this.targetY3 - this.findHt : this.targetY3 + this.findHt;
    this.D4 = this.A4 > 0 ? this.targetY4 - this.findHt : this.targetY4 + this.findHt;
    
    this.A1 = this.A1 > 0 ? this.findHt : -this.findHt;
    this.A2 = this.A2 > 0 ? this.findHt : -this.findHt;
    this.A3 = this.A3 > 0 ? this.findHt : -this.findHt;
    this.A4 = this.A4 > 0 ? this.findHt : -this.findHt;
    
  } else {   
    this.D1 = this.currentY1;
    this.D2 = this.currentY2;
    this.D3 = this.currentY3;
    this.D4 = this.currentY4;
  } 
}


function animator() { 
  var now  = new Date();
  var newY1  = this.A1 * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D1;
  var newY2  = this.A2 * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D2;
  var newY3  = this.A3 * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D3;
  var newY4  = this.A4 * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D4;
  
  newY1    = Math.round(newY1);
  newY2    = Math.round(newY2);
  newY3    = Math.round(newY3);
  newY4    = Math.round(newY4);

  // Zeitsteuerung der Bewegung
  if (( this.A1 > 0 && newY1 > this.currentY1 ) || ( this.A1 < 0 && newY1 < this.currentY1 ) || ( this.A2 > 0 && newY2 > this.currentY2 ) || ( this.A2 < 0 && newY2 < this.currentY2 ) || ( this.A3 > 0 && newY3 > this.currentY3 ) || ( this.A3 < 0 && newY3 < this.currentY3 ) || ( this.A4 > 0 && newY4 > this.currentY4 ) || ( this.A4 < 0 && newY4 < this.currentY4 )) { 
    if ( ie4 )floatLayer1.style.pixelTop = newY1;
    if ( ie4 )floatLayer2.style.pixelTop = newY2;
    if ( ie4 )floatLayer3.style.pixelTop = newY3;
    if ( ie4 )floatLayer4.style.pixelTop = newY4;
    
    if ( ns4 )document.floatLayer1.top = newY1;
    if ( ns4 )document.floatLayer2.top = newY2;
    if ( ns4 )document.floatLayer3.top = newY3;
    if ( ns4 )document.floatLayer4.top = newY4;
    
    if ( ns6 )document.getElementById('floatLayer1').style.top = newY1 + "px";
    if ( ns6 )document.getElementById('floatLayer2').style.top = newY2 + "px";
    if ( ns6 )document.getElementById('floatLayer3').style.top = newY3 + "px";
    if ( ns6 )document.getElementById('floatLayer4').style.top = newY4 + "px";
  } 
} 

function footerinit() {
  // Timer fuer Positionskontrolle, Initialisierung des gesamten Scripts
  window.setInterval("main()", 10);
}

// =========================================================
// *************************************************************************
//
//  ENDE FOOTER NAVIGATION MIT LAYERN
// 
// =========================================================
// *************************************************************************

//-->
