// JavaScript Document

function PopUp(strURL,w,h,resizable,scrollbars) { 
  window.open(strURL, "","resizable="+resizable+",menubar=0,toolbar=0,scrollbars="+scrollbars+",status=0,WIDTH="+w+",HEIGHT="+h+""); 
}

function toggleDisplay(objID){
	var tmpObjDisplay = document.getElementById(objID).style.display;
	if (tmpObjDisplay == 'none'){
		document.getElementById(objID).style.display = 'block';
		if(objID == 'TellAFriend'){
			document.TAF.To.focus();	
		}
	} else {
		document.getElementById(objID).style.display = 'none';
	}
}

function toggle_display(id1,id2) {
	var elem1 = document.getElementById(id1);
	var elem2 = document.getElementById(id2);
	elem1.style.display = elem1.style.display == 'block' ? 'none' : 'block';
	elem2.style.display = elem2.style.display == 'block' ? 'none' : 'block';
}


function openProduct(ArtNr){
	ArtNr = encodeURIComponent(ArtNr);
	ArtNr = htmlEncode(ArtNr);
	window.location.href = '?ArtNr='+ArtNr;
}


function ProductSearch(SearchFor){
	var NoCache = new Date();
	req = createXMLHttpRequest();
	req.onreadystatechange = handleProductSearch;
	req.open('POST', 'default.asp?NoCache='+NoCache.getTime()+'&ProductSearch=true', true);
	req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	
	SearchFor = SearchFor.replace(/ /g,'*');
	SearchFor = encodeURIComponent(SearchFor);
	SearchFor = htmlEncode(SearchFor);
	
	req.send('SearchFor='+SearchFor);
}
function handleProductSearch() {
	switch(req.readyState){
	  case 0 : //UNINITIALIZED
	  case 1 : //LOADING
	  case 2 : //LOADED
	  case 3 : //INTERACTIVE
	    break;
	  case 4 : //COMPLETED
	    //req.status
		if(req.responseText.length > 0){
			document.getElementById("SearchResults").style.display = 'block';
			document.getElementById("SearchResults").innerHTML = req.responseText
		} else {
			document.getElementById("SearchResults").style.display = 'none';
			document.getElementById("SearchResults").innerHTML = '';
		}
	    break;
	  default : ; //fehlerhafter Status
	}
}




function addClipboard(Prod) {
	var NoCache = new Date();
	req = createXMLHttpRequest();
	req.onreadystatechange = handleClipboard;
	req.open('POST', 'default.asp?NoCache='+NoCache.getTime()+'&addClipboard=true', true);
	req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	req.send('add='+Prod);
	document.getElementById("Added"+Prod).style.display = 'block';
}
function removeClipboard(Prod) {
	var NoCache = new Date();
	req = createXMLHttpRequest();
	req.onreadystatechange = handleClipboard;
	req.open('POST', 'default.asp?NoCache='+NoCache.getTime()+'&removeClipboard=true', true);
	req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	req.send('remove='+Prod);
	document.getElementById("ProdItem"+Prod).style.display = 'none';
}
function handleClipboard() {
	switch(req.readyState){
	  case 0 : //UNINITIALIZED
	  case 1 : //LOADING
	  case 2 : //LOADED
	  case 3 : //INTERACTIVE
	    break;
	  case 4 : //COMPLETED
	    //req.status
		if(req.responseText.length > 0){
			document.getElementById("ClipboardA").innerHTML = req.responseText
	  		document.getElementById("ClipboardLI").style.display = 'block';
		} else {
	  		document.getElementById("ClipboardLI").style.display = 'none';
			document.getElementById("ClipboardPannelContent").innerHTML = '&nbsp;&nbsp;&nbsp;<i>Clipboard is empty</i>';
		}
	    break;
	  default : ; //fehlerhafter Status
	}
}



function RotatePic() { 
      // name des bildes was getauscht werden soll im html-code (img-tag-name) 
      var BildTDTagID = "rdmpic";   
       
      // ordner, wo die bilder gespeichert wurden 
      var BildOrdner = "/images/headerimg/";     
       
      // dateiname der bilder ohne nummer 
      var BildName = "bild";             
       
      // Bildformat (.jpg, .gif, .png, etc.) 
      var BildFormat = ".jpg";         
       
      //Anzahl der Bilder im Bildordner 
      var AnzahlBilder = 9;         
       
      // Zahlenwert, mit der die bildernummerierung beginnt 
      var StartCounter = 1;         
       
       
      // random zahl ermitteln 
      RandBild = Math.round(Math.random()*AnzahlBilder); 
      if( AnzahlBilder == RandBild ) RandBild = 0; 
      rb = BildOrdner + BildName + (RandBild + StartCounter) + BildFormat; 
       
      if (document.images) { 
         document.images[BildTDTagID].src=rb; 
      } 
}

function htmlEncode(source){

	function special(source){
		var result = '';
		for (var i = 0; i < source.length; i++){
			var c = source.charAt(i);
			if (c < ' ' || c > '~')
				c = '&#' + c.charCodeAt() + ';';
			result += c;
		}
		return result;
	}

	var result = source;
	
	result = result.replace(/\&/g,'&amp;');
	result = result.replace(/\</g,'&lt;');
	result = result.replace(/\>/g,'&gt;');
	result = result.replace(new RegExp('"','g'), '&quot;');

	result = special(result);
	
	return result;
}

function createXMLHttpRequest(){
	var obj = null;
	try{
		obj = new ActiveXObject("MSXML2.XMLHTTP");
	}
	catch (err_MSXML2){
	try{
		obj = new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (err_Microsoft){
		if(typeof XMLHttpRequest != "undefined")
		obj = new XMLHttpRequest;
	}
	}
	return obj;
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_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; }
}

/* SpryCollapsiblePanel.js - Revision: Spry Preview Release 1.4 */

// Copyright (c) 2006. Adobe Systems Incorporated.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright notice,
//     this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice,
//     this list of conditions and the following disclaimer in the documentation
//     and/or other materials provided with the distribution.
//   * Neither the name of Adobe Systems Incorporated nor the names of its
//     contributors may be used to endorse or promote products derived from this
//     software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

var Spry;
if (!Spry) Spry = {};
if (!Spry.Widget) Spry.Widget = {};

Spry.Widget.CollapsiblePanel = function(element, opts)
{
	this.init(element);

	Spry.Widget.CollapsiblePanel.setOptions(this, opts);

	this.attachBehaviors();
};

Spry.Widget.CollapsiblePanel.prototype.init = function(element)
{
	this.element = this.getElement(element);
	this.focusElement = null;
	this.hoverClass = "CollapsiblePanelTabHover";
	this.openClass = "CollapsiblePanelOpen";
	this.closedClass = "CollapsiblePanelClosed";
	this.focusedClass = "CollapsiblePanelFocused";
	this.enableAnimation = true;
	this.enableKeyboardNavigation = true;
	this.animator = null;
	this.hasFocus = false;
	this.contentIsOpen = true;
};

Spry.Widget.CollapsiblePanel.prototype.getElement = function(ele)
{
	if (ele && typeof ele == "string")
		return document.getElementById(ele);
	return ele;
};

Spry.Widget.CollapsiblePanel.prototype.addClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
		return;
	ele.className += (ele.className ? " " : "") + className;
};

Spry.Widget.CollapsiblePanel.prototype.removeClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
		return;
	ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};

Spry.Widget.CollapsiblePanel.prototype.hasClassName = function(ele, className)
{
	if (!ele || !className || !ele.className || ele.className.search(new RegExp("\\b" + className + "\\b")) == -1)
		return false;
	return true;
};

Spry.Widget.CollapsiblePanel.prototype.setDisplay = function(ele, display)
{
	if( ele )
		ele.style.display = display;
};

Spry.Widget.CollapsiblePanel.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
	if (!optionsObj)
		return;
	for (var optionName in optionsObj)
	{
		if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
			continue;
		obj[optionName] = optionsObj[optionName];
	}
};

Spry.Widget.CollapsiblePanel.prototype.onTabMouseOver = function()
{
	this.addClassName(this.getTab(), this.hoverClass);
};

Spry.Widget.CollapsiblePanel.prototype.onTabMouseOut = function()
{
	this.removeClassName(this.getTab(), this.hoverClass);
};

Spry.Widget.CollapsiblePanel.prototype.open = function()
{
	this.contentIsOpen = true;
	if (this.enableAnimation)
	{
		if (this.animator)
			this.animator.stop();
		this.animator = new Spry.Widget.CollapsiblePanel.PanelAnimator(this, true);
		this.animator.start();
	}
	else
		this.setDisplay(this.getContent(), "block");

	this.removeClassName(this.element, this.closedClass);
	this.addClassName(this.element, this.openClass);
};

Spry.Widget.CollapsiblePanel.prototype.close = function()
{
	this.contentIsOpen = false;
	if (this.enableAnimation)
	{
		if (this.animator)
			this.animator.stop();
		this.animator = new Spry.Widget.CollapsiblePanel.PanelAnimator(this, false);
		this.animator.start();
	}
	else
		this.setDisplay(this.getContent(), "none");

	this.removeClassName(this.element, this.openClass);
	this.addClassName(this.element, this.closedClass);
};

Spry.Widget.CollapsiblePanel.prototype.onTabClick = function()
{
	if (this.isOpen())
		this.close();
	else
		this.open();
	this.focus();
};

Spry.Widget.CollapsiblePanel.prototype.onFocus = function(e)
{
	this.hasFocus = true;
	this.addClassName(this.element, this.focusedClass);
};

Spry.Widget.CollapsiblePanel.prototype.onBlur = function(e)
{
	this.hasFocus = false;
	this.removeClassName(this.element, this.focusedClass);
};

Spry.Widget.CollapsiblePanel.ENTER_KEY = 13;
Spry.Widget.CollapsiblePanel.SPACE_KEY = 32;

Spry.Widget.CollapsiblePanel.prototype.onKeyDown = function(e)
{
	var key = e.keyCode;
	if (!this.hasFocus || (key != Spry.Widget.CollapsiblePanel.ENTER_KEY && key != Spry.Widget.CollapsiblePanel.SPACE_KEY))
		return true;
	
	if (this.isOpen())
		this.close();
	else
		this.open();

	if (e.stopPropagation)
		e.stopPropagation();
	if (e.preventDefault)
		e.preventDefault();

	return false;
};

Spry.Widget.CollapsiblePanel.prototype.attachPanelHandlers = function()
{
	var tab = this.getTab();
	if (!tab)
		return;

	var self = this;
	Spry.Widget.CollapsiblePanel.addEventListener(tab, "click", function(e) { return self.onTabClick(); }, false);
	Spry.Widget.CollapsiblePanel.addEventListener(tab, "mouseover", function(e) { return self.onTabMouseOver(); }, false);
	Spry.Widget.CollapsiblePanel.addEventListener(tab, "mouseout", function(e) { return self.onTabMouseOut(); }, false);

	if (this.enableKeyboardNavigation)
	{
		// XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
		// rely on adding the tabindex attribute if it is missing to enable keyboard navigation
		// by default.

		// Find the first element within the tab container that has a tabindex or the first
		// anchor tag.
		
		var tabIndexEle = null;
		var tabAnchorEle = null;

		this.preorderTraversal(tab, function(node) {
			if (node.nodeType == 1 /* NODE.ELEMENT_NODE */)
			{
				var tabIndexAttr = tab.attributes.getNamedItem("tabindex");
				if (tabIndexAttr)
				{
					tabIndexEle = node;
					return true;
				}
				if (!tabAnchorEle && node.nodeName.toLowerCase() == "a")
					tabAnchorEle = node;
			}
			return false;
		});

		if (tabIndexEle)
			this.focusElement = tabIndexEle;
		else if (tabAnchorEle)
			this.focusElement = tabAnchorEle;

		if (this.focusElement)
		{
			Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement, "focus", function(e) { return self.onFocus(e); }, false);
			Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement, "blur", function(e) { return self.onBlur(e); }, false);
			Spry.Widget.CollapsiblePanel.addEventListener(this.focusElement, "keydown", function(e) { return self.onKeyDown(e); }, false);
		}
	}
};

Spry.Widget.CollapsiblePanel.addEventListener = function(element, eventType, handler, capture)
{
	try
	{
		if (element.addEventListener)
			element.addEventListener(eventType, handler, capture);
		else if (element.attachEvent)
			element.attachEvent("on" + eventType, handler);
	}
	catch (e) {}
};

Spry.Widget.CollapsiblePanel.prototype.preorderTraversal = function(root, func)
{
	var stopTraversal = false;
	if (root)
	{
		stopTraversal = func(root);
		if (root.hasChildNodes())
		{
			var child = root.firstChild;
			while (!stopTraversal && child)
			{
				stopTraversal = this.preorderTraversal(child, func);
				try { child = child.nextSibling; } catch (e) { child = null; }
			}
		}
	}
	return stopTraversal;
};

Spry.Widget.CollapsiblePanel.prototype.attachBehaviors = function()
{
	var panel = this.element;
	var tab = this.getTab();
	var content = this.getContent();

	if (this.contentIsOpen || this.hasClassName(panel, this.openClass))
	{
		this.removeClassName(panel, this.closedClass);
		this.setDisplay(content, "block");
		this.contentIsOpen = true;
	}
	else
	{
		this.removeClassName(panel, this.openClass);
		this.addClassName(panel, this.closedClass);
		this.setDisplay(content, "none");
		this.contentIsOpen = false;
	}

	this.attachPanelHandlers();
};

Spry.Widget.CollapsiblePanel.prototype.getTab = function()
{
	return this.getElementChildren(this.element)[0];
};

Spry.Widget.CollapsiblePanel.prototype.getContent = function()
{
	return this.getElementChildren(this.element)[1];
};

Spry.Widget.CollapsiblePanel.prototype.isOpen = function()
{
	return this.contentIsOpen;
};

Spry.Widget.CollapsiblePanel.prototype.getElementChildren = function(element)
{
	var children = [];
	var child = element.firstChild;
	while (child)
	{
		if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
			children.push(child);
		child = child.nextSibling;
	}
	return children;
};

Spry.Widget.CollapsiblePanel.prototype.focus = function()
{
	if (this.focusElement && this.focusElement.focus)
		this.focusElement.focus();
};

/////////////////////////////////////////////////////

Spry.Widget.CollapsiblePanel.PanelAnimator = function(panel, doOpen, opts)
{
	this.timer = null;
	this.interval = 0;
	this.stepCount = 0;

	this.fps = 0;
	this.steps = 10;
	this.duration = 100;
	this.onComplete = null;

	this.panel = panel;
	this.content = panel.getContent();
	this.panelData = [];
	this.doOpen = doOpen;

	Spry.Widget.CollapsiblePanel.setOptions(this, opts);


	// If caller specified speed in terms of frames per second,
	// convert them into steps.

	if (this.fps > 0)
	{
		this.interval = Math.floor(1000 / this.fps);
		this.steps = parseInt((this.duration + (this.interval - 1)) / this.interval);
	}
	else if (this.steps > 0)
		this.interval = this.duration / this.steps;

	var c = this.content;

	var curHeight = c.offsetHeight ? c.offsetHeight : 0;
	
	if (doOpen && c.style.display == "none")
		this.fromHeight = 0;
	else
		this.fromHeight = curHeight;

	if (!doOpen)
		this.toHeight = 0;
	else
	{
		if (c.style.display == "none")
		{
			// The content area is not displayed so in order to calculate the extent
			// of the content inside it, we have to set its display to block.

			c.style.visibility = "hidden";
			c.style.display = "block";
		}

		// Unfortunately in Mozilla/Firefox, fetching the offsetHeight seems to cause
		// the browser to synchronously re-layout and re-display content on the page,
		// so we see a brief flash of content that is *after* the panel being positioned
		// where it should when the panel is fully expanded. To get around this, we
		// temporarily position the content area of the panel absolutely off-screen.
		// This has the effect of taking the content out-of-flow, so nothing shifts around.

		// var oldPos = c.style.position;
		// var oldLeft = c.style.left;
		// c.style.position = "absolute";
		// c.style.left = "-2000em";

		// Clear the height property so we can calculate
		// the full height of the content we are going to show.
		c.style.height = "";
		this.toHeight = c.offsetHeight;

		// Now restore the position and offset to what it was!
		// c.style.position = oldPos;
		// c.style.left = oldLeft;
	}

	this.increment = (this.toHeight - this.fromHeight) / this.steps;
	this.overflow = c.style.overflow;

	c.style.height = this.fromHeight + "px";
	c.style.visibility = "visible";
	c.style.overflow = "hidden";
	c.style.display = "block";
};

Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.start = function()
{
	var self = this;
	this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
};

Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.stop = function()
{
	if (this.timer)
	{
		clearTimeout(this.timer);

		// If we're killing the timer, restore the overflow
		// properties on the panels we were animating!

		if (this.stepCount < this.steps)
			this.content.style.overflow = this.overflow;
	}

	this.timer = null;
};

Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.stepAnimation = function()
{
	++this.stepCount;

	this.animate();

	if (this.stepCount < this.steps)
		this.start();
	else if (this.onComplete)
		this.onComplete();
};

Spry.Widget.CollapsiblePanel.PanelAnimator.prototype.animate = function()
{
	if (this.stepCount >= this.steps)
	{
		if (!this.doOpen)
			this.content.style.display = "none";
		this.content.style.overflow = this.overflow;
		this.content.style.height = this.toHeight + "px";
	}
	else
	{
		this.fromHeight += this.increment;
		this.content.style.height = this.fromHeight + "px";
	}
};

// ******************************************************************************************************************


/*

 Browser.js - Objekt zur Abfrage von Browserinformationen (Release 3.0)
 ======================================================================

 Von Markus Jung

 Implementiert die Klasse 'Browser' und stellt sie als Objekt zur Verfügung. Das Objekt ist notwendig, um browserunabhängige JavaScripts zu implementieren.

 Methoden
 - out string Name() = Internet Explorer|Safari|Navigator|Firefox|false: Name
 - out float Version() = [Version]|false: Version
 - out string Betriebssystem() = Windows|Mac OS|false: Betriebssystemfamilie
 - out boolean istKompatibel() = true|false: Kompatibilität prüfen

 Abhängigkeiten
 - Keine

 Geschichte
 - 3.0: 26.09.06, MJung, Erstellung

 Copyright 2006 dezember und juli gmbh (Schweiz). Alle Rechte vorbehalten.
*/


Browser = new BrowserKlasse()


function BrowserKlasse()
{

 this.Release = 3.0


 // Methode out string Name() = Internet Explorer|Safari|Navigator|Firefox|false
 this.Name = function()
 {

  if (navigator.appName == 'Microsoft Internet Explorer') return 'Internet Explorer'
  if (/Safari/.test(navigator.userAgent) == true) return 'Safari'
  if (/Netscape/.test(navigator.userAgent) == true) return 'Navigator'
  if (/Firefox/.test(navigator.userAgent) == true) return 'Firefox'
  return false
 }


 // Methode out float Version() = [Version]|false
 this.Version = function()
 {

  var Name = this.Name()

  if (document.layers) return 4
  if (Name == 'Internet Explorer') return parseFloat(/MSIE \d+\.\d+/.exec(navigator.appVersion)[0].substr(5))
  if (Name == 'Safari') return 1
  if (Name == 'Navigator') return parseFloat(/Netscape\/\d+\.\d/.exec(navigator.userAgent)[0].substr(9))
  if (Name == 'Firefox') return parseFloat(/Firefox\/\d+\.\d/.exec(navigator.userAgent)[0].substr(8))
  return false
 }


 // Methode out string Betriebssystem() = Windows|Mac OS|false
 this.Betriebssystem = function()
 {

  if (/Win/.test(navigator.platform) == true) return 'Windows'
  if (/Mac/.test(navigator.platform) == true) return 'Mac OS'
  return false
 }


 // Methode out boolean istKompatibel() = true|false
 this.istKompatibel = function()
 {

  var Name = this.Name()
  var Version = this.Version()
  var Betriebssystem = this.Betriebssystem()

  if (Name == 'Internet Explorer' && Version >= 5 && Betriebssystem != false) return true
  if (Name == 'Safari' && Betriebssystem == 'Mac OS') return true
  if (Name == 'Navigator' && Version >= 7 && Betriebssystem != false) return true
  if (Name == 'Firefox' && Version >= 1 && Betriebssystem != false) return true
  return false
 }
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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_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];}
}

/*

 DHTMLMenue.js - Objekt zur Realisation von Dynamic HTML Menüs (Release 2.0)
 ===========================================================================

 Von Markus Jung

 Implementiert die Klasse 'DHTMLMenue' und stellt sie als Objekt zur Verfügung. Das Objekt ermöglicht die Implementation von dynamischen, auch überlappenden, Menüs. Das Popup-Verhalten kann mittels
 Konstante eingestellt werden. Die Menüs müssen lediglich deklariert werden, die Einbettung erfolgt zur Laufzeit. Es können dabei mehrere einzelne Menüs deklariert werden. Bei Bedarf können die
 entsprechenden Menüdateien eingebunden und das Variablenfeldes der Methode 'einbetten' übergeben werden. Die Einbettung der Menüs und Untermenüs erfolgt mit Div-Tags, die Menüelemente mit Span- resp.
 A-Tags (um eine Bedienung mit der Tastatur zu ermöglichen). Das Erscheinungsbild kann mit Kontextselektoren individuell definiert werden. Für nicht kompatible Browser kann eine alternative URL
 angegeben werden. Die alternative URL kann beim Popup-Verhalten 2 auch für eine Bereichsübersicht verwendet werden.
 Die Menüdeklaration besteht aus einem Variablenfeld von Menüs, welche durch einen im Variablenfeld eindeutigen Namen identifiziert werden. Ein einzelnes Menü besteht wiederum aus einem Variablenfeld
 von Menüelementen oder dem Tag 'Trennlinie'. Ein Menüelement wird durch die Beschriftung und dem Pfad oder dem Namen eines Untermenüs beschrieben. Absolute URL's und JavaScript-Anweisungen werden
 durch das vorangestellte Protokolle erkannt.
 Mit der Methode 'Inhalt' kann der Inhalt in Form eines Verzeichnissen dargestellt werden.

 Menüdeklaration
 - [Menü] = new Array()
   [Menü]['Daten'] = new Array([Nummer],'[Titel]','[Name Menü]',[OffsetX],[OffsetY],[DeltaY],[Alternative URL])
   [Menü]['[Name]'] = new Array({'[Beschriftung]§[URL]|[[Name Untermenü]]',}..)

 Methoden
 - einbetten(in string Name): Menü einbetten
 - Inhalt(in string Name): Inhaltsverzeichnis erzeugen

 Abhängigkeiten
 - Benutzt Broswer.js (Release 3)

 Geschichte
 - 2.0: 29.09.06, MJung, Erstellung

 Copyright 2006 dezember und juli gmbh (Schweiz). Alle Rechte vorbehalten.
*/


DHTMLMenue = new DHTMLMenueKlasse()


function DHTMLMenueKlasse()
{

 this.Release = 2.0


 // Konstanten
 this.Root = '../'
 this.Popup = 3 // 1 Nach Betätigen (mit Maus oder Tastatur), 2 Beim Zeigen, 3 Nach Betätigen oder beim Zeigen


 // Private Variablen
 this.Hoverpfad = new Array()
 this.Menuepfad = new Array()


 // Methode einbetten(in array Menuedeklartion)
 this.einbetten = function(Menuedeklartion)
 {

  var Nummer = Menuedeklartion['Daten'][0]
  var Titel = 'DHTMLMenueTitel' + Nummer
  var Menue = 'DHTMLMenue' + Nummer
  var href,onMouseOver,style

  if (Browser.istKompatibel())
  {

   href = ' class="MenuBarItemSubmenu" href=javascript:DHTMLMenue.einaus("'+Titel+'","'+Menue+'")'
   onMouseOver = 'onMouseOver=DHTMLMenue.ein("'+Titel+'","'+Menue+'")'
   style = 'style="cursor: default"'

   switch (this.Popup)
   {
    case 1:
     onMouseOver = ''
     style = ''
     break
    case 2: 
     if (Menuedeklartion['Daten'][6] == '')
      href = ''
     else
     {
      href = 'href='+Menuedeklartion['Daten'][6]
      style = ''
     }
     onMouseOver = 'onMouseOver=DHTMLMenue.ein("'+Titel+'","'+Menue+'")'
     break
    case 3:
     break
   }

   document.write('<div class=DHTMLMenueTitel id='+Titel+'><a '+href+' '+onMouseOver+' '+style+'>'+Menuedeklartion['Daten'][1]+'</a></div>')
   document.write('<div class=DHTMLMenue id='+Menue+'>')
   this.einbetten1(Menuedeklartion,Nummer,Menuedeklartion['Daten'][2])
   document.write('</div>')
  }
  else document.write('<div class=DHTMLMenueTitel><a href='+this.Root+Menuedeklartion['Daten'][6]+'>'+Menuedeklartion['Daten'][1]+'</a></div>')
 }


 this.einbetten1 = function(Menuedeklartion,Nummer,id)
 {

  var Menue,Untermenue,Menueelement,Menueelemente
  var i

  // Alle Menüelemente abarbeiten
  for (i = 0; i < Menuedeklartion[id].length; i = i + 1)
  {

   // Menü, Untermenü und Menüelement(e) bestimmen
   Menue = 'DHTMLMenue' + Nummer
   Untermenue = 'DHTMLMenue' + Nummer + '-' + i
   Menueelement = 'DHTMLMenueElement' + Nummer + '-' + i
   Menueelemente = Menuedeklartion[id][i].split('§')

   // Menüelement einbetten
   if (/\[.+\]/.test(Menueelemente[1]) == true)
   {
    document.write('<span id='+Menueelement+'><a href=javascript:DHTMLMenue.einaus("'+Menueelement+'","'+Untermenue+'") onMouseOver=DHTMLMenue.ein("'+Menueelement+'","'+Untermenue+'") style=cursor:default>'+Menueelemente[0]+'</a></span>')
    document.write('<div id='+Untermenue+' style="left: '+Menuedeklartion['Daten'][3]+'px; top: '+(Menuedeklartion['Daten'][4]+i*Menuedeklartion['Daten'][5])+'px">')
    this.einbetten1(Menuedeklartion,Nummer+'-'+i,Menueelemente[1].substring(1,Menueelemente[1].length-1))
    document.write('</div>')
   }
   else
   {
    if (Menueelemente[0] == '<Trennlinie>') document.write('<hr noshade>')
    else
    {
     if (/^\w+[:]/.test(Menueelemente[1]) == false) Menueelemente[1] = this.Root + Menueelemente[1]
     document.write('<span id='+Menueelement+'><a href="'+Menueelemente[1]+'" onMouseOver=DHTMLMenue.ein("'+Menueelement+'","'+Menue+'")>'+Menueelemente[0]+'</a></span>')
    }
   }
  }
 }


 // Interne Methode ein(in string id,in string Name)
 this.ein = function(id,Menue)
 {

  var Hoverpfad = (id == '') ? '' : /\d+[-\d+]*/.exec(id)[0].split('-')
  var Menuepfad = (Menue == '') ? '' : /\d+[-\d+]*/.exec(Menue)[0].split('-')
  var i

  // Hover entfernen
  for (i = this.Hoverpfad.length; i > 0; i = i - 1)
  {
   if (this.Hoverpfad[i-1] != Hoverpfad[i-1])
    if (i == 1) document.getElementById('DHTMLMenueTitel' + this.Hoverpfad.join('-')).className = 'DHTMLMenueTitel'
    else document.getElementById('DHTMLMenueElement' + this.Hoverpfad.join('-')).className = ''
   this.Hoverpfad = this.Hoverpfad.slice(0,this.Hoverpfad.length-1)
  }

  // Hover hinzufügen
  if (id != '')
  {
   if (/DHTMLMenueTitel/.test(id) == true) document.getElementById(id).className = 'DHTMLMenueTitelHover'
   else document.getElementById(id).className = 'Hover'
   this.Hoverpfad = /\d+[-\d+]*/.exec(id)[0].split('-')
  }

  // Menüs behandeln
  if (Menue == '') return

  // Menüs entfernen
  for (i = this.Menuepfad.length; i > 0; i = i - 1)
  {
   if (this.Menuepfad[i-1] != Menuepfad[i-1]) document.getElementById('DHTMLMenue' + this.Menuepfad.join('-')).style.visibility = 'hidden'
   this.Menuepfad = this.Menuepfad.slice(0,this.Menuepfad.length-1)
  }

  // Menü hinzufügen
  document.getElementById(Menue).style.visibility = 'visible'
  this.Menuepfad = /\d+[-\d+]*/.exec(Menue)[0].split('-')

  // Alles aus, wenn Maus Dokument berührt
  document.body.onmouseover = DHTMLMenue.aus
 }


 // Interne Methode aus(in object eventW3C)
 this.aus = function(eventW3C)
 {

  var Browsername = Browser.Name()
  var Ereigniselement
  var i

  // Bedingungen prüfen
  switch (Browsername)
  {
   case 'Internet Explorer': Ereigniselement = event.srcElement; break;
   case 'Navigator':
   case 'Safari':
   case 'Firefox': Ereigniselement = eventW3C.target; break;
  }

  if (Ereigniselement.className.substring(0,10) == 'DHTMLMenue') return
  if (Ereigniselement.parentNode.id.substring(0,10) == 'DHTMLMenue') return

  // Alle Menüs entfernen
  for (i = DHTMLMenue.Menuepfad.length; i > 0; i = i - 1)
  {
   document.getElementById('DHTMLMenue' + DHTMLMenue.Menuepfad.join('-')).style.visibility = 'hidden'
   DHTMLMenue.Menuepfad = DHTMLMenue.Menuepfad.slice(0,DHTMLMenue.Menuepfad.length-1)
  }

  // Alle Hovers entfernen
  for (i = DHTMLMenue.Hoverpfad.length; i > 0; i = i - 1)
  {
   if (i == 1) document.getElementById('DHTMLMenueTitel' + DHTMLMenue.Hoverpfad.join('-')).className = 'DHTMLMenueTitel'
   else document.getElementById('DHTMLMenueElement' + DHTMLMenue.Hoverpfad.join('-')).className = 'DHTMLMenueElement'
   DHTMLMenue.Hoverpfad = DHTMLMenue.Hoverpfad.slice(0,DHTMLMenue.Hoverpfad.length-1)
  }

  // Abschluss
  document.body.onmouseover = null
 }


 // Interne Methode einaus(id,Menue)
 this.einaus = function(id,Menue)
 {

  var Hoverpfad = (id == '') ? '' : /\d+[-\d+]*/.exec(id)[0].split('-')
  var Menuepfad = (Menue == '') ? '' : /\d+[-\d+]*/.exec(Menue)[0].split('-')
  var i

  // Ein oder Aus
  if (document.getElementById(Menue).style.visibility == 'visible')
  {

   // Menüs entfernen
   Menuepfad = Menuepfad.slice(0,Menuepfad.length-1)
   for (i = this.Menuepfad.length; i > 0; i = i - 1)
   {
    if (this.Menuepfad[i-1] != Menuepfad[i-1])
    {
     document.getElementById('DHTMLMenue' + this.Menuepfad.join('-')).style.visibility = 'hidden'
     this.Menuepfad = this.Menuepfad.slice(0,this.Menuepfad.length-1)
    }
   }

   // Hover entfernen
   Hoverpfad = Hoverpfad.slice(0,Hoverpfad.length-1)
   for (i = this.Hoverpfad.length; i > 0; i = i - 1)
   {
    if (this.Hoverpfad[i-1] != Hoverpfad[i-1])
    {
     if (i == 1) document.getElementById('DHTMLMenueTitel' + this.Hoverpfad.join('-')).className = 'DHTMLMenueTitel'
     else document.getElementById('DHTMLMenueElement' + this.Hoverpfad.join('-')).className = ''
     this.Hoverpfad = this.Hoverpfad.slice(0,this.Hoverpfad.length-1)
    }
   }
  }
  else this.ein(id,Menue)
 }


 // Methode Inhalt(in array Menuedeklartion)
 this.Inhalt = function(Menuedeklaration)
 {

  document.write('<div class=DHTMLMenueInhaltsverzeichnis>')
  this.Inhalt1(Menuedeklaration,Menuedeklaration['Daten'][2])
  document.write('</div>')
 }


 this.Inhalt1 = function(Menuedeklaration,id)
 {

  var Menueelemente
  var i

  // Alle Menüelemente abarbeiten
  for (i = 0; i < Menuedeklaration[id].length; i = i + 1)
  {

   // Menüelemente bestimmen
   Menueelemente = Menuedeklaration[id][i].split('§')

   // Menüelement einbetten
   if (/\[.+\]/.test(Menueelemente[1]) == true)
   {
    document.write('<span>'+Menueelemente[0]+'</span>')
    if (!document.layers) document.write('<div>')
    this.Inhalt1(Menuedeklaration,Menueelemente[1].substring(1,Menueelemente[1].length-1))
    if (!document.layers) document.write('</div>')
   }
   else
   {
    if (Menueelemente[0] == '<Trennlinie>') document.write('<hr noshade>')
    else
    {
     if (/^\w+[:]/.test(Menueelemente[1]) == false) Menueelemente[1] = this.Root + Menueelemente[1]
     document.write('<span><a href="'+Menueelemente[1]+'">'+Menueelemente[0]+'</a></span>')
    }
   }
  }
 }
}

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
