
try {
	document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}

// Bilder laden
var PreloadImages = function() {
	var args = arguments;
	var imgs = new Array()
	for (var i = 0; i < args.length; i++) {
		imgs[i] = new Image();
		imgs[i].src = args[i];
	}
	return imgs;
}

// PopupFenster
var OpenWindow = function(url) {
	var BrWin = window.open(url,'_blank','width=520,height=400,scrollbars=yes');
	window.setTimeout(function(){BrWin.focus();},25);
	return false;
}

// Neues Element erstellen
function NewElement(parent,element,attributes,content) {
	var newElement = document.createElement(element);
	for (var i = 0; i < attributes.length; i+=2) {
		newElement.setAttribute(attributes[i],attributes[i+1],false);
	}
	if (content) {
		newElement.firstChild.nodeValue = content;
	}
	return parent.appendChild(newElement);
}

// Position eines Eintrags in einem Array ermitteln
Array.prototype.contains = function(searchString){
	for(result=[], x=0; x<this.length; x++){
		if(this[x] == searchString){
			result[result.length]=x;
		}
	}
	return result.length ? result : -1;
};

// Elemente anhand ihrer Klasse finden
document.getElementsByClassName = function(myClassName) {
	var allElems = document.getElementsByTagName('*');
	var elemWithClass = [];
	for (var i = 0; i < allElems.length; i++) {
		if (allElems[i].className.match(new RegExp('\\b' + myClassName + '\\b'))) {
			elemWithClass.push(allElems[i]);
		}
	}
	return elemWithClass.length > 0 ? elemWithClass : null;
};

// Alpha-Transparenz eines Elements setzen (IE ab 5.5, Opera ab 9.0, Mozilla/Netscape, KHTML/Safari)
var setCrossOpacity = function(obj,opac) {
	if (obj.filters) {
		obj.style.filter = 'alpha(opacity=' + opac * 100 +')';
	} else {
		obj.style.opacity = opac;
		obj.style.setProperty('-moz-opacity',opac,'');
		obj.style.setProperty('-khtml-opacity',opac,'');
	}
}

// Den ersten Element-Knoten eine Elternelements finden
var findFirstElementNode = function(parentNode) {
	if (typeof parentNode == 'object') {
		var count = 0;
		while (parentNode.childNodes[count].nodeType != 1) {
			count++;
		}
		return parentNode.childNodes[count];
	}
}

// Bilder austauschen bei mouseover/out
function SwapImage(elem,src,alphapng) {
	if (document.getElementById) {
		var img = typeof elem == 'object' ? elem : document.getElementById(elem);
		if (alphapng && document.all && !window.opera) {
			img.oldSrc = img.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src;
			img.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + src + '",sizingMethod=image))';
		} else {
			img.oldSrc = img.src;
			img.src = src;
		}
		elem.onmouseout = function() {
			SwapImage(elem,img.oldSrc,alphapng);
			elem.onmouseout = null;
		};
	}
}

// Inhalte ein-/ausblenden
function SwapContent(contentclass,index,parentelem,eventtarget) {
	if (document.getElementById) {
		var elems = document.getElementsByClassName(contentclass);
		var linkelems = document.getElementById(parentelem).getElementsByTagName('li');
		for (var i = 0; i < elems.length; i++) {
			elems[i].style.display = 'none';
		}
		for (var i = 0; i < linkelems.length; i++) {
			linkelems[i].className = '';
		}
		eventtarget.className = 'active';
		elems[index].style.display = 'block';
	}
}

// Inhalte ein-/ausblenden
function SwapChartContent(index) {
	if (document.getElementById) {
		SwapContent('inner-content',index,'OpenContentsContainer',document.getElementById('OpenContentsContainer').getElementsByTagName('li')[index]);

		var elems = document.getElementsByClassName('service-content')[0].getElementsByTagName('div');
		var linkelems = document.getElementsByClassName('chart-list')[0].getElementsByTagName('a');
		for (var i = 0; i < elems.length; i++) {
			elems[i].style.display = 'none';
		}
		for (var i = 0; i < linkelems.length; i++) {
			linkelems[i].className = '';
		}
		linkelems[index].className = 'active';
		elems[index].style.display = 'block';
		
		return false;
	}
}

// Alphatransparente PNGs fuer IE 5.5 und 6.0
function setIEAlphaPNG() {
	if (document.all && !window.opera) {
		var imgSrc, pngExt = '.png';
		var allImages = document.getElementsByTagName('img');
		for (var i = 0; i < allImages.length; i++) {
			if (allImages[i].src.match(new RegExp('\\b' + pngExt + '\\b'))) {
				imgSrc = allImages[i].src;
				allImages[i].src = '/images/layout/blank.gif';
				allImages[i].style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + imgSrc + '",sizingMethod=image))';
			}
		}
	}
}

// Subnavigation aufklappen
var SlideNavigation = function(slideElem,slideElemWidth,slideStepDivider,slideStepMin,slideTimeout) {
	this.initDone = false;
	if (document.getElementById) {
		this.slideElem = slideElem;
		this.slideElemWidth = slideElemWidth;
		this.slideStepDivider = slideStepDivider;
		this.slideStepMin = slideStepMin;
		this.slideTimeout = slideTimeout;
		this.initDone = false;
	}
}
	
SlideNavigation.prototype = {
	
	init : function() {
		if (document.getElementById) {
			this.slideElem = document.getElementById(this.slideElem);
			this.contentElem = findFirstElementNode(this.slideElem);
			this.contentElemWidth = this.contentElem.offsetWidth;
			this.slidedOut = false;
			this.sliding = false;
			this.initDone = true;
		}
	},
	
	action : function() {
		if (this.initDone && !this.sliding) {
			this.slide();
		}
	},

	slide : function() {
		if (!this.sliding) {
			this.slideElemWidth = !this.slidedOut ? 1 : this.contentElem.offsetWidth; 
			this.contentElemWidth = !this.slidedOut ? this.contentElem.offsetWidth : this.slideElemWidth;
			this.slideSteps = Math.round(this.contentElemWidth / this.slideStepDivider);
			this.slideElem.style.display = 'block';
			this.sliding = true;
		}
		this.slideElemWidth += !this.slidedOut ? this.slideSteps : -this.slideSteps;
		this.slideSteps -= (this.slideSteps > this.slideStepMin) ? Math.round(this.slideSteps / this.slideStepDivider) : 0;
		this.slideElem.style.width = this.slideElemWidth + 'px';
		if ( (!this.slidedOut 
				&& (this.slideElemWidth < this.contentElemWidth - this.slideSteps)) 
					|| (this.slidedOut
						&& (this.slideElemWidth >= this.slideSteps)) ) {
			var $this = this;
			window.setTimeout(function(){$this.slide();},this.slideTimeout);
		} else {
			//if (this.slidedOut) this.slideElem.style.display = 'none';
			this.slideElem.style.width = !this.slidedOut ? this.contentElemWidth + 'px' : '1px';
			this.slidedOut = this.slidedOut ? false : true;
			this.sliding = false;
		}
	}

};

// Buttons einfahren lassen
var SlideButton = function(slideFatherElem,index,slideElemTopMax,slideStepDivider,slideStepMin,slideTimeout) {
	if (document.getElementById) {
		this.slideFatherElem = slideFatherElem;
		this.index = index
		this.slideElemTopMax = slideElemTopMax;
		this.slideStepDivider = slideStepDivider;
		this.slideStepMin = slideStepMin;
		this.slideTimeout = slideTimeout;
		this.initDone = false;
	}
}

SlideButton.prototype = {

	init : function() {
		if (document.getElementById) {
			this.slideFatherElem = document.getElementById(this.slideFatherElem);
			this.slideElem = this.slideFatherElem.getElementsByTagName('li')[this.index];
			this.slideElemHeight = this.slideElem.offsetHeight;
			this.slideElemTop = 0;
			this.slidedOut = false;
			this.sliding = false;
			this.initDone = true;
		}
	},

	action : function() {
		if (this.initDone && !this.sliding) {
			this.slide();
		}
	},

	slide : function() {
		if (!this.sliding) {
			this.sliding = true;
			this.slideSteps = Math.round(this.slideElemTopMax / this.slideStepDivider);
		}
		this.slideElemTop += this.slideSteps;
		this.slideSteps -= (this.slideSteps > this.slideStepMin) ? Math.round(this.slideSteps / this.slideStepDivider) : 0;
		this.slideElem.style.top = this.slideElemTop + 'px';
		//alert(this.slideElemTop)
		if ( (!this.slidedOut && (this.slideElemTop <= this.slideElemTopMax))  ) {
			var $this = this;
			window.setTimeout(function(){$this.slide()},this.slideTimeout);
		} else {
			this.slideElem.style.top = this.slideElemTopMax + 'px';
			this.slidedOut = this.slidedMarginOut ? false : true;
			this.sliding = false;
		}
	}
	
};

// Inhalt aufziehen
var SlideContent = function(slideElem,slideElemHeight,slideElemMargin,slideStepDivider,slideStepMin,slideTimeout) {
	if (document.getElementById) {
		this.slideElem = slideElem;
		this.slideElemHeight = slideElemHeight;
		this.slideElemMargin = slideElemMargin;
		this.slideStepDivider = slideStepDivider;
		this.slideStepMin = slideStepMin;
		this.slideTimeout = slideTimeout;
		this.initDone = false;
	}
}

SlideContent.prototype = {

	init : function() {
		if (document.getElementById) {
			this.slideElem = document.getElementById(this.slideElem);
			this.contentElem = findFirstElementNode(this.slideElem);
			this.contentElemHeight = this.contentElem.offsetHeight;
			this.slideElemMarginMax = this.slideElemMargin;
			this.slidedOut = false;
			this.sliding = false;
			this.slidedMarginOut = false;
			this.slidingMargin = false;
			this.initDone = true;
		}
	},

	action : function() {
		if (this.initDone && !this.sliding && !this.slidingMargin) {
			this.slide();
			this.slideMargin();
			if (arguments.length > 0) {
				this.nextFunc = arguments[0];
			} else {
				this.nextFunc = null;
			}
		}
	},

	slide : function() {
		if (!this.sliding) {
			if (!this.slidedOut) 
				this.slideElem.style.display = 'block';
			this.slideElem.style.overflow = 'hidden';
			this.slideElemHeight = !this.slidedOut ? 0 : this.contentElem.offsetHeight; 
			this.contentElemHeight = !this.slidedOut ? this.contentElem.offsetHeight : this.slideElemHeight;
			this.slideSteps = Math.round(this.contentElemHeight / this.slideStepDivider);
			this.sliding = true;
		}
		this.slideElemHeight += !this.slidedOut ? this.slideSteps : -this.slideSteps;
		this.slideSteps -= (this.slideSteps > this.slideStepMin) ? Math.round(this.slideSteps / this.slideStepDivider) : 0;
		this.slideElem.style.height = this.slideElemHeight + 'px';
		if ( (!this.slidedOut 
				&& (this.slideElemHeight < this.contentElemHeight - this.slideSteps)) 
					|| (this.slidedOut
						&& (this.slideElemHeight >= this.slideSteps)) ) {
			var $this = this;
			window.setTimeout(function(){$this.slide()},this.slideTimeout);
		} else {
			this.slideElem.style.height = !this.slidedOut ? 'auto' : '1px';
			if (!this.slidedOut)
				this.slideElem.style.overflow = 'visible';
			if (this.slidedOut) 
				this.slideElem.style.display = 'none';
			this.slidedOut = this.slidedOut ? false : true;
			this.sliding = false;
		}
	},

	slideMargin : function() {
		if (!this.slidingMargin) {
			this.slidingMargin = true;
			this.slideMarginSteps = !this.slidedMarginOut ? Math.round(this.slideElemMargin / this.slideStepDivider) : Math.round(this.slideElemMarginMax / this.slideStepDivider);
		}
		this.slideElemMargin += (!this.slidedMarginOut && this.slideElemMargin >= this.slideMarginSteps) ? -this.slideMarginSteps : (this.slidedMarginOut && this.slideElemMargin <= this.slideElemMarginMax) ? this.slideMarginSteps : 0;
		this.slideMarginSteps -= (this.slideMarginSteps > this.slideStepMin) ? Math.round(this.slideMarginSteps / this.slideStepDivider) : 0;
		this.slideElem.style.marginTop = this.slideElemMargin + 'px';
		if ( (!this.slidedMarginOut && (this.slideElemMargin >= this.slideMarginSteps)) 
				|| (this.slidedMarginOut && (this.slideElemMargin < this.slideElemMarginMax - this.slideMarginSteps)) ) {
			var $this = this;
			window.setTimeout(function(){$this.slideMargin()},this.slideTimeout);
		} else {
			this.slideElem.style.marginTop = !this.slidedMarginOut ? 0 : this.slideElemMarginMax + 'px';
			this.slidedMarginOut = this.slidedMarginOut ? false : true;
			this.slidingMargin = false;
			var $this = this;
			if (this.nextFunc) window.setTimeout(function(){$this.nextFunc()},150);
		}
	}
	
};

// Layer-Popup
var LayerPopup = function(popupElem,popupMaskElemClass,popupIeAlphaElemClass,popupIeAlphaElemSrc,popupElemLeft,popupElemTop,popupElemWidthMax,popupElemHeightMax,slideStepDivider,slideStepMultiplier) {
	this.popupElem = popupElem;
	this.popupMaskElemClass = popupMaskElemClass;
	this.popupIeAlphaElemClass = popupIeAlphaElemClass;
	this.popupIeAlphaElemSrc = popupIeAlphaElemSrc;
	this.popupElemLeft = popupElemLeft;
	this.popupElemTop = popupElemTop;
	this.popupElemWidthMax = popupElemWidthMax;
	this.popupElemHeightMax = popupElemHeightMax;
	this.slideStepDivider = slideStepDivider;
	this.slideStepMultiplier = slideStepMultiplier;
}

LayerPopup.prototype = {

	init : function() {
		this.initDone = false;
		if (document.getElementById) {
			this.popupElem = document.getElementById(this.popupElem);
			
			if (document.all && !window.opera) {
				this.popupIeAlphaElem = document.createElement('div');
				this.popupIeAlphaElem.className = this.popupIeAlphaElemClass;
				this.popupIeAlphaElem.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.popupIeAlphaElemSrc + '",sizingMethod=image))';//images/popups/bg_open_showreel.png
				this.popupElem.insertBefore(this.popupIeAlphaElem, this.popupElem.firstChild);
			}
			
			this.popupMaskElem = document.createElement('div');
			this.popupMaskElem.className = this.popupMaskElemClass;
			this.popupElem.insertBefore(this.popupMaskElem, this.popupElem.firstChild);
			
			this.popupElemWidth = 1;
			this.popupElemHeight = 1;
			this.popupElemWidthMin = this.popupElemWidth;
			this.popupElemHeightMin = this.popupElemHeight;

			this.slideStepMin = 2;
			this.popupMaskOpacity = 1;
			this.sliding = false;
			this.slidedOut = false;
			this.currentHeight = null;
			this.currentWidth = null;
			this.initDone = true;
		}
	},
	
	action : function() {
		if (this.initDone) {
			if (!this.slidedOut) {
				this.popupElem.style.display = 'block';
			}
			this.slidePopup();
			if (arguments.length > 0) {
				this.nextFunc = arguments[0];
			} else {
				this.nextFunc = null;
			}
		}
	},

	slidePopup : function() {
		if (!this.sliding) {
			this.popupMaskElem.style.display = 'block';
			this.popupMaskOpacity = 1;
			setCrossOpacity(this.popupMaskElem,this.popupMaskOpacity)
			this.slideSteps = Math.round((this.popupElemHeightMax * this.slideStepMultiplier) / this.slideStepDivider);
			this.sliding = true;
		}
		this.popupElemHeight += this.slidedOut ? - this.slideSteps : this.slideSteps;
		this.popupElemWidth += this.slidedOut ? - this.slideSteps : this.slideSteps;
		this.slideSteps -= (this.slideSteps > this.slideStepMin) ? Math.round(this.slideSteps / this.slideStepDivider) : 0;
		if (this.slidedOut) {
			this.currentHeight = this.popupElemHeight > this.popupElemHeightMin ? this.popupElemHeight : this.popupElemHeightMin;
			this.currentWidth = this.popupElemWidth > this.popupElemWidthMin ? this.popupElemWidth : this.popupElemWidthMin;
			this.popupElem.style.height = this.currentHeight + 'px';
			this.popupElem.style.width = this.currentWidth + 'px';
			this.popupMaskElem.style.height = this.currentHeight + 'px';
			this.popupMaskElem.style.width = this.currentWidth + 'px';
		} else {
			this.currentHeight = this.popupElemHeight < this.popupElemHeightMax ? this.popupElemHeight : this.popupElemHeightMax;
			this.currentWidth = this.popupElemWidth < this.popupElemWidthMax ? this.popupElemWidth : this.popupElemWidthMax;
			this.popupElem.style.height = this.currentHeight + 'px';
			this.popupElem.style.width = this.currentWidth + 'px';
			this.popupMaskElem.style.height = this.currentHeight + 'px';
			this.popupMaskElem.style.width = this.currentWidth + 'px';
		}
		this.popupElem.style.left = this.popupElemLeft - (this.popupElemWidth / 2) + 'px';
		this.popupElem.style.top = this.popupElemTop - (this.popupElemHeight / 2) + 'px';
		if ((this.slidedOut &&
				(this.popupElemWidth > this.popupElemWidthMin || this.popupElemHeight > this.popupElemHeightMin))
					|| (!this.slidedOut &&
						(this.popupElemWidth < this.popupElemWidthMax || this.popupElemHeight < this.popupElemHeightMax))) {
			var $this = this;
			window.setTimeout(function(){$this.slidePopup()},10);
		} else {
			if (this.slidedOut) {
				this.popupElem.style.display = 'none';
			}
			this.sliding = false;
			this.slidedOut = this.slidedOut ? false : true;
			this.setOpacity();
			var $this = this;
			if (this.nextFunc) window.setTimeout(function(){$this.nextFunc()},200);
		}
	},
	
	setOpacity : function() {
		this.popupMaskOpacity -= 0.1;
		setCrossOpacity(this.popupMaskElem,this.popupMaskOpacity)
		if (this.popupMaskOpacity >= 0.1) {
			var $this = this;
			window.setTimeout(function(){$this.setOpacity()},5);
		} else {
			this.popupMaskOpacity = 0;
			setCrossOpacity(this.popupMaskElem,this.popupMaskOpacity)
			this.popupMaskElem.style.display = 'none';
		}
	}
	
}

// Tabellenzeilen-Rollover
var TableRowHover = function(elemsToHover,hoverColors,hoverStartColors,outColor,fadeSpeed,diffTDs) {
	this.elemsToHover = elemsToHover;
	this.hoverColors = hoverColors;
	this.hoverStartColors = hoverStartColors;
	this.outColor = outColor;
	this.fadeSpeed = fadeSpeed;
	this.diffTDs = diffTDs || false;
};

TableRowHover.prototype = {

	init : function() {
		if (document.getElementById) {
			this.count = 0;
			this.fading = false;
			this.startFading = false;
			this.elemsToHover = document.getElementsByClassName(this.elemsToHover);
			for (var i = 0; i < this.elemsToHover.length; i++) {
				this.setEvents = function() {
					var elem = arguments[0];
					var $this = this;
					elem.onmouseover = function() {
						$this.hover(elem);
					}
					elem.onmouseout = function() {
						$this.out();
					}
				}
				this.setEvents(this.elemsToHover[i]);
			}
		}
	},
	
	hover : function() {
		if (!this.fading) { 
			this.elem = arguments[0] ? arguments[0] : null;
			this.startFading = this.elem ? false : true;
			this.fading = true;
			this.firstStep = true;
			this.fade();
		}
	},
	
	fade : function() {
		if (this.fading) {
			if (!this.diffTDs) {
				if (this.startFading) {
					for (var i = 0; i < this.elemsToHover.length; i++) {
						this.elemsToHover[i].style.backgroundColor = this.hoverStartColors[this.count];
					}
				} else if (!this.currentFade) {
					this.elem.style.backgroundColor = this.hoverColors[this.count];
				}
			} else {
				if (!this.currentFade) {
					this.elem.style.backgroundColor = this.hoverColors[this.count];
					
					var TDs = this.elem.getElementsByTagName('td');
					for (var i = 0; i < TDs.length; i++) {
						if (TDs[i].className.indexOf('delivered') != -1)
							TDs[i].style.backgroundColor = this.hoverColors[this.count];
							
						if (TDs[i].className.indexOf('blank') != -1)
							TDs[i].style.backgroundColor = this.hoverColors[this.count];
					}
				}
			}
			this.count += this.count < this.hoverColors.length ? 1 : 0;
			if (this.count < this.hoverColors.length) {
				var $this = this;
				this.fadeSpeedTemp = this.firstStep ? Math.round(this.fadeSpeed * 1.5) : this.fadeSpeed;
				if (this.firstStep) { 
					this.firstStep = false;
				}
				window.setTimeout(function(){$this.fade()},this.fadeSpeedTemp);
			} else {
				this.count = 0;
				this.fading = false;
				this.startFading = false;
			}
		}
	},
	
	out : function() {
		if (!this.startFading) {
			this.fading = false;
			this.count = 0;
			if (this.elem) {
				this.elem.style.backgroundColor = this.outColor;
				
				var TDs = this.elem.getElementsByTagName('td');
				for (var i = 0; i < TDs.length; i++) {
					if (TDs[i].className.indexOf('delivered') != -1)
						TDs[i].style.backgroundColor = '#CDCBCC';
						
					if (TDs[i].className.indexOf('blank') != -1)
						TDs[i].style.backgroundColor = '#DCDADB';
				}
			}
		}
	}

};

// Scrollbar
var ScrollBar = function() {
	if (isDOM) {
		var a = arguments;
		this.objekt = a[0] + 'objekt';
		eval(this.objekt + '= this');
		this.gesamtBox = TMSucheElem(a[0]);
		this.inhalt = TMSucheElem(a[1]);
		this.leistenBox = NewElement(this.gesamtBox,'div',['id',a[2]],'');
		this.leiste = NewElement(this.leistenBox,'div',['id',a[3]],'');
		this.greifer = NewElement(this.leiste,'div',['id',a[4]],'');
		this.scrollVertikal = (a[5] == 'vertikal') ? true : false;
		this.scrollTimeout = a[6];
		this.scrollSpeed = a[7];
		this.mausradSpeed = a[8];
		this.scrollSchleife = null;
		this.inhaltMaxPos = 0;
		this.greiferMinPos = 0;
		this.initDone = false;
		this.init();
	}
};

ScrollBar.prototype = {
	
	init : function() {
		if (this.scrollVertikal) {
			this.inhaltPos = parseInt(this.inhalt.style.top) ? parseInt(this.inhalt.style.top) : 0;
			this.greiferPos = parseInt(this.greifer.style.top) ? parseInt(this.greifer.style.top) : 0;
			this.inhaltHoehe = this.inhalt.offsetHeight;
			this.gesamtBoxHoehe = this.gesamtBox.offsetHeight;
			this.inhaltMinPos = -this.inhaltHoehe + this.gesamtBoxHoehe;
			this.leistenHoehe = this.leiste.offsetHeight;
			this.greiferHoehe = this.greifer.offsetHeight;
			this.greiferMaxPos = this.leistenHoehe - this.greiferHoehe;
			this.scrollBereich = this.greiferMaxPos / (this.inhaltHoehe - this.gesamtBoxHoehe);
			if (this.inhaltHoehe > this.gesamtBoxHoehe) {
				this.leistenBox.style.visibility = 'visible';
			} else {
				this.leistenBox.style.visibility = 'hidden';
			}
		} else {
			this.inhaltPos = parseInt(this.inhalt.style.left) ? parseInt(this.inhalt.style.left) : 0;
			this.greiferPos = parseInt(this.greifer.style.left) ? parseInt(this.greifer.style.left) : 0;
			this.inhaltBreite = this.inhalt.offsetWidth;
			this.gesamtBoxBreite = this.gesamtBox.offsetWidth;
			this.inhaltMinPos = -this.inhaltBreite + this.gesamtBoxBreite;
			this.leistenBreite = this.leiste.offsetWidth;
			this.greiferBreite = this.greifer.offsetWidth;
			this.greiferMaxPos = this.leistenBreite - this.greiferBreite;
			this.scrollBereich = this.greiferMaxPos / (this.inhaltBreite - this.gesamtBoxBreite);
			if (this.inhaltBreite > this.gesamtBoxBreite) {
				this.leistenBox.style.visibility = 'visible';
			} else {
				this.leistenBox.style.visibility = 'hidden';
			}
		}
		var obj = this;
		TMErstelleEvent(this.greifer,'mousedown',function(e) { obj.startDrag(e); });
		this.mausradPos = this.inhaltPos / this.mausradSpeed;
		if (isGECKO) {
			TMErstelleEvent(this.gesamtBox,'DOMMouseScroll',function(e) { obj.scrollMouseWheel(e); },false);
		} else {
			TMErstelleEvent(this.gesamtBox,'mousewheel',function(e) { obj.scrollMouseWheel(e); });
		}
		this.initDone = true;
	},
	
	positionIt : function() {
		if (this.scrollVertikal) {
			this.inhaltPosX = 0;
			this.inhaltPosY = this.inhaltPos;
			this.greiferPosX = 0;
			this.greiferPosY = this.greiferPos;
		} else {
			this.inhaltPosX = this.inhaltPos;
			this.inhaltPosY = 0;
			this.greiferPosX = this.greiferPos;
			this.greiferPosY = 0;
		}
		TMCSSPosition(this.inhalt,this.inhaltPosX,this.inhaltPosY);
		TMCSSPosition(this.greifer,this.greiferPosX,this.greiferPosY);
	},
	
	startDrag : function(e) {
		this.mausPos = this.scrollVertikal ? TMSucheMaus(e).yo : TMSucheMaus(e).xo;
		this.ziehenPos = this.mausPos - this.greiferPos;
		var obj = this;
		TMErstelleEvent(document,'mousemove',function(e) { obj.drag(e); });
		TMErstelleEvent(document,'mouseup',function() { obj.stopDrag(); });
		TMUnterbindeStandard(e);
	},
	
	drag : function(e) {
		this.mausPos = this.scrollVertikal ? TMSucheMaus(e).yo : TMSucheMaus(e).xo;
		this.greiferPos = this.mausPos - this.ziehenPos;				
		if (this.greiferPos > this.greiferMaxPos) { 
			this.greiferPos = this.greiferMaxPos;
			this.inhaltPos = this.inhaltMinPos;
		} else if (this.greiferPos < this.greiferMinPos) { 
			this.greiferPos = this.greiferMinPos;
			this.inhaltPos = this.inhaltMaxPos;
		} else {
			this.inhaltPos = Math.round(-this.greiferPos * (1 / this.scrollBereich));
		}
		if (isIE6) {
			this.mausradPos = this.inhaltPos / this.mausradSpeed;
		}
		this.positionIt();
		TMUnterbindeStandard(e);
	},
	
	stopDrag : function() {
		TMEntferneEvent(document,'mousemove');
		TMEntferneEvent(document,'mouseup');
	},
	
	jumpUp : function() {
		this.greiferPos = this.greiferMinPos;
		this.inhaltPos = this.inhaltMaxPos;
		if (isIE6) {
			this.mausradPos = this.inhaltPos / this.mausradSpeed;
		}
		this.positionIt();
		//TMUnterbindeStandard(e);
	},

	scrollMouseWheel : function(e) {
		e = e ? e : window.event;
		var delta = 0;
		if (e.wheelDelta) {
			delta = e.wheelDelta / 120;
            if (window.opera) {
				delta = -delta;
			}
		} else if (e.detail) {
			delta = -e.detail/3;
		}
		if (delta) {
			this.mausradPos += delta;
			this.inhaltPos = Math.round(this.mausradPos * this.mausradSpeed);
			if (this.inhaltPos < this.inhaltMinPos) {
				this.inhaltPos = this.inhaltMinPos;
				this.greiferPos = this.greiferMaxPos;
				this.mausradPos = this.inhaltPos / this.mausradSpeed;
			} else if (this.inhaltPos > this.inhaltMaxPos) {
				this.inhaltPos = this.inhaltMaxPos;
				this.greiferPos = this.greiferMinPos;
				this.mausradPos = this.inhaltPos / this.mausradSpeed;
			} else {
				this.greiferPos = Math.round(-this.inhaltPos * this.scrollBereich);
			}
			this.positionIt();
			//TMUnterbindeStandard(e)
			e.returnValue = false;
		}
	}
	
};


function targetBlank(url) {
	f = open(url);
}


