	function TsAutoHover() {
		if (!document.getElementsByTagName) {
			return;
		}
		var imgs = document.getElementsByTagName('img');
		var i, l = imgs.length;
		var j, m;
		var reSwapme = /autoswap|auto-swap/;
		var reIsActive = /_a\.[a-z]+/;
		var reFileParts = /(.*)\.([a-z]+$)/;
		var srcParts;
		for (i = 0; i < l; i++) {
			if (reSwapme.test(imgs[i].className) && !reIsActive.test(imgs[i].src)) {
				srcParts = imgs[i].src.match(reFileParts)
				imgs[i]._srcNormal = imgs[i].src;
				imgs[i]._srcActive = srcParts[1] + '_a.' + srcParts[2];
				imgs[i].onmouseover = function() {
					this.src = this._srcActive;
				}
				imgs[i].onmouseout = function() {
					this.src = this._srcNormal;
				}
			}
		}

		if (window.oldOnload) {
			oldOnload();
		}
	}

	function TsAutoHoverInstall() {
		if (window.addEventListener) {
			window.addEventListener('load', TsAutoHover, true);
		} else if (window.attachEvent) {
			window.attachEvent('onload', TsAutoHover);
		} else {
			if (window.onload) {
				window.oldOnload = window.onload;
			}
			window.onload = TsAutoHover;
		}
	}
	/**
	 * Searches for table with id and changes the style of the <tr> element
	 */
	function highlightTr(id) {
		var domTable = document.getElementById(id);
		var domBody = domTable.getElementsByTagName('tbody')[0];
		var domTr = domBody.getElementsByTagName('tr');
		for (var i = 0, l = domTr.length; i < l; i++) {
			var a = domTr[i].getElementsByTagName('a')[0];
			domTr[i]._normal = domTr[i].className;
			domTr[i]._href = a.href;
			domTr[i].onmouseover = function() {
				this.className = 'red';
			}
			domTr[i].onmouseout = function() {
				this.className = this._normal;
			}
			domTr[i].onclick = function() {
				window.location.href = this._href;
			}
		}
	}
	/**
	 * Für die for <ul> element with id and changes style for <li> element
	 */
	function initializePulldown () {
		var domUl = document.getElementById('menu');
		var domLi = domUl.getElementsByTagName('li');
		for (var i = 1, l = domLi.length - 1 ; i < l; i++) {
			var sId = 'div' + domLi[i].id.substr(2,domLi[i].id.length-2);
			var domDiv = document.getElementById(sId) || false;
			domLi[i]._domDiv = domDiv;
			domDiv._domLi = domLi[i];
			domLi[i]._i = i-1;
			
			domLi[i].onmouseover = function() {
				jsddOver(this._i);
			}
			domDiv.onmouseover = function () {
				jsddOver(this._domLi._i);
			}
			domLi[i].onmouseout = function() {
				jsddOut(this._i);
			}
			domDiv.onmouseout = function () {
				jsddOut(this._domLi._i);
			}
		}
		
	}
	function highlightMenu(id) {
		var ul = document.getElementById(id);
		var li = ul.getElementsByTagName('li');
		for (var i = 0, l = li.length; i < l; i++) {
			var a = li[i].getElementsByTagName('a');
			if (a.length > 0) {
				li[i]._normal = li[i].className;
				li[i]._href = a[0].href;
				li[i].onmouseover = function() {
					this.className = 'red';
				}
				li[i].onmouseout = function() {
					this.className = this._normal;
				}
				li[i].onclick = function() {
					window.location.href = this._href;
				}
			}
		}
	}
	/* General function for Popup windows */

	function popupCenter(url, name, attributes, width, height) {
		topx = (screen.height - height) / 2;
		leftx = (screen.width - width) / 2;
		if (attributes.length > 0)
			if (attributes.substr(attributes.length-1,1) != ',')
				attributes += ','
		var w = window.open(url, name, attributes + 'width='+width+',height='+height+',screenx='+leftx+',screeny='+topx+',top='+topx+',left='+leftx+',status=yes,resizable=yes,scrollbars=yes');
		w.focus();
	}

	function popupabout(url) {
		popupCenter(url, 'popupabout', '', 700, 500);
		return false;
	}