



	var MSIE  = false;
	var MSI6  = false;
	var DOM2  = false;
	var CSS1  = false;

	/* -------------------------------------------------------------------------------------- */
	if (navigator.appName.substr(0,9) == 'Microsoft')
		MSIE = true;
	else if (navigator.appName.substr(0,8) == 'Netscape')
		DOM2 = true;
	if (document.compatMode == 'CSS1Compat')
		CSS1 = true;
	if (!(typeof document.addEventListener != 'function' && window.XMLHttpRequest))
		MSI6 = MSIE && true;

	function tldomain() {
		var anc = document.getElementsByTagName('base');

		if (anc && anc[0] && anc[0].href)
			anc = anc[0].href;
		else
			anc = window.location.href;

		anc = anc.split('/');
		anc = anc[2];
//		anc = anc.split('.');
//		anc = anc[anc.length - 2] + '.' +
//		      anc[anc.length - 1];

		return anc;
	}

	function wait(msecs) {
		var start = new Date().getTime();
		var cur   = start;
		while((cur - start) < msecs)
			cur = new Date().getTime();
		return true;
	}

	if (!Array.indexOf) {
	    Array.prototype.indexOf = function(obj) {
	        for (var i = 0; i < this.length; i++)
	            if (this[i] == obj)
	                return i;

	        return -1;
	    }
	}

	/* -------------------------------------------------------------------------------------- */
	function activateTab(tab) {
		var prev = tab;
		while ((prev = prev.previousSibling))
			if (prev.className && prev.className.match(/tab/))
				prev.className = prev.className.replace(/ (act|deact)/gi, '') + ' deact';

		var next = tab;
		while ((next = next.nextSibling))
			if (next.className && next.className.match(/tab/))
				next.className = next.className.replace(/ (act|deact)/gi, '') + ' deact';

		tab.className = tab.className.replace(/ (act|deact)/gi, '') + ' act';
		return false;
	}

	function rotateTab(tab, dir) {
		var next = tab;

		/* quit all textNodes on this level! */
		while ((next = next.nextSibling)) {
			if (next.nextSibling && (next.nextSibling.nodeType == 3))
				next.parentNode.removeChild(next.nextSibling);
		}

		var next = tab, first = tab, last = tab, cnt;

		while ((next = next.nextSibling)) {
			first = last = next;
			if (first.className && first.className.match(/tab/)) {
				while ((next = next.nextSibling)) {
					if (next.className && next.className.match(/tab/))
						last = next;
				}

				break;
			}
		}

		if (first != last) {
			if (dir == 'r') {
				tab.parentNode.removeChild(cnt = last.nextSibling);
				tab.parentNode.insertBefore(cnt, first);
				tab.parentNode.removeChild(cnt = last);
				tab.parentNode.insertBefore(cnt, first.previousSibling);
			}
			else if (dir == 'l') {
				tab.parentNode.removeChild(cnt = first.nextSibling);
				tab.parentNode.appendChild(cnt);
				tab.parentNode.removeChild(cnt = first);
				tab.parentNode.insertBefore(cnt, tab.parentNode.lastChild);
			}
		}

		return false;
	}

	/* dynamic effects ----------------------------------------------------------------------
	 *
	 * Developed by Robert Nyman, http://www.robertnyman.com
	 * Code/licensing: http://code.google.com/p/getelementsbyclassname/
	 */
	var getElementsByClassName = function (className, tag, elm){
		if (elm.getElementsByClassName) {
			getElementsByClassName = function (className, tag, elm) {
				elm = elm || document;
				var elements = elm.getElementsByClassName(className),
					nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null,
					returnElements = [],
					current;
				for(var i=0, il=elements.length; i<il; i+=1){
					current = elements[i];
					if(!nodeName || nodeName.test(current.nodeName)) {
						returnElements.push(current);
					}
				}
				return returnElements;
			};
		}
		else if (document.evaluate) {
			getElementsByClassName = function (className, tag, elm) {
				tag = tag || "*";
				elm = elm || document;
				var classes = className.split(" "),
					classesToCheck = "",
					xhtmlNamespace = "http://www.w3.org/1999/xhtml",
					namespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,
					returnElements = [],
					elements,
					node;
				for(var j=0, jl=classes.length; j<jl; j+=1){
					classesToCheck += "[contains(concat(' ', @class, ' '), ' " + classes[j] + " ')]";
				}
				try	{
					elements = document.evaluate(".//" + tag + classesToCheck, elm, namespaceResolver, 0, null);
				}
				catch (e) {
					elements = document.evaluate(".//" + tag + classesToCheck, elm, null, 0, null);
				}
				while ((node = elements.iterateNext())) {
					returnElements.push(node);
				}
				return returnElements;
			};
		}
		else {
			getElementsByClassName = function (className, tag, elm) {
				tag = tag || "*";
				elm = elm || document;
				var classes = className.split(" "),
					classesToCheck = [],
					elements = (tag === "*" && elm.all)? elm.all : elm.getElementsByTagName(tag),
					current,
					returnElements = [],
					match;
				for(var k=0, kl=classes.length; k<kl; k+=1){
					classesToCheck.push(new RegExp("(^|\\s)" + classes[k] + "(\\s|$)"));
				}
				for(var l=0, ll=elements.length; l<ll; l+=1){
					current = elements[l];
					match = false;
					for(var m=0, ml=classesToCheck.length; m<ml; m+=1){
						match = classesToCheck[m].test(current.className);
						if (!match) {
							break;
						}
					}
					if (match) {
						returnElements.push(current);
					}
				}
				return returnElements;
			};
		}

		return getElementsByClassName(className, tag, elm);
	};

	function effectslide(elm) {
		var blcks = elm.getElementsByTagName('div');
		var slids = elm.getElementsByTagName('img');
		var queue = [];
		var w = 0, h = 0;

		/* determine rectangle */
		for (var s = 0; s < slids.length; s++) {
			if (slids[s].parentNode == blcks[0]) {
				w = Math.max(slids[s].width,  w);
				h = Math.max(slids[s].height, h);

				slids[s].style.position = 'absolute';
				slids[s].style.display = 'block';
				slids[s].style.zIndex = s;
				slids[s].style.opacity = (s ? '0.0' : '1.0');
				slids[s].style.filter = 'alpha(Opacity=' + (s ? '0' : '100') + ')';

				queue.push(slids[s]);
			}
		}

		/* center pictures in the rectangle */
		for (var s = 0; s < queue.length; s++) {
			queue[s].style.top  = ((w - queue[s].width ) >> 1) + 'px';
			queue[s].style.left = ((h - queue[s].height) >> 1) + 'px';
		}

		blcks[0].style.width  = w + 'px';
		blcks[0].style.height = h + 'px';
		blcks[1].style.marginLeft = (w + 10) + 'px';
		blcks[2].style.width  = w + 'px';

		var slideproc = function() {
			var s;
			var h = queue[0];
			var r = queue[1];
			var q = parseFloat(h.style.opacity) - 0.02; h.style.opacity = q; h.style.filter = 'alpha(Opacity=' + parseInt(q * 100) + ')';
			var o = parseFloat(r.style.opacity) + 0.02; r.style.opacity = o; r.style.filter = 'alpha(Opacity=' + parseInt(o * 100) + ')';
			if ((q > 0.0) &&
			    (o < 1.0))
				setTimeout(slideproc, 100);
			else {
				h.style.opacity = '0.0';
				h.style.filter = 'alpha(Opacity=0)';
				r.style.opacity = '1.0';
				r.style.filter = 'alpha(Opacity=100)';
				h = queue.shift(); queue.push(h);
				for (s = 0; s < queue.length; s++)
					queue[s].style.zIndex = s;
				setTimeout(slideproc, 1000 + parseInt(Math.floor(3000 * Math.random())));
			}
		}

		setTimeout(slideproc, 1000 + parseInt(Math.floor(3000 * Math.random())));
	}

	function effectproc(tree) {
		/* slide-effects */
		var slides = getElementsByClassName('fce-slides', 'div', tree);
		while (slides.length)
			effectslide(slides.pop());
	}

	/* dynamic js/css files ----------------------------------------------------------------- */
	var prmstr = new RegExp(' (.*?)="(.*?)"', 'gi');
	var valstr = new RegExp(' (.*?)="(.*?)"', 'i');
	var refstr = new RegExp('href="(.*?)"', 'i');
	var srcstr = new RegExp('src="(.*?)"', 'i');
	var typstr = new RegExp('type="(.*?)"', 'i');
	var inside = new RegExp('<(script|link).*?>([\\s\\S]*?)<\/(script|link)>', 'i');

	function matchLINKs(links) {
		// kill all previous <link rel="alternate"
		// kill all previous <link rel="(???|chapter)"
		// overlay all <link rel="shortcut icon"
		// overlay all <link rel="stylesheet"
		var head = document.getElementsByTagName("head")[0];
		var refs = new Object();

		for (var s = 0; s < links.length; s++) {
			var typ;
			if ((typ = links[s].match(refstr)) && (typ = typ[1])) {
				if (!typ.match(/https?/))
					typ = window.location.protocol + '//' + window.location.hostname + '/' + typ;
				refs[typ] = links[s];
			}
			else
				refs['idx' + s] = links[s];
		}

		for (var s = head.childNodes.length - 1; s >= 0; s--) {
			var link = head.childNodes[s];
			if (link.tagName && (link.tagName.toLowerCase() == 'link')) {
				/* these we don't do again */
				if (link.rel.match(/stylesheet|shortcut|icon/) && link.href)
					refs[link.href] = false;
				/* these we do again */
				else
					head.removeChild(link);
			}
		}

		for (var s in refs) {
			if (refs[s]) {
				var ln = document.createElement('link');
				var tr = refs[s].match(prmstr);

				for (var p = 0; p < tr.length; p++) {
					var pair = tr[p].match(valstr);
					if (pair)
						ln.setAttribute(pair[1],pair[2]);
				}

				head.appendChild(ln);
			}
		}
	}

	function matchCSSs(styles) {
	}

	function matchJSs(scripts) {
		var head = document.getElementsByTagName("head")[0];
		var jacs = new Array();

		for (var s = 0; s < scripts.length; s++) {
			var typ;
			if ((typ = scripts[s].match(srcstr)) && (typ = typ[1])) {
				if (!typ.match(/https?/))
					typ = window.location.protocol + '//' + window.location.hostname + '/' + typ;
				/* scriptaculous-fix: can't use document.write! */
				jacs.push(typ.replace(/scriptaculous.js\?load\=(.*)/, '$1.js'));
			}
			else if ((typ = scripts[s].match(inside)) && (typ = typ[2])) {
				jacs.push(typ);
			}
		}

		for (var s = 0; s < head.childNodes.length; s++) {
			var typ, script = head.childNodes[s], pos;
			if (script.tagName && (script.tagName.toLowerCase() == 'script') && (typ = script.src)) {
				if (!typ.match(/https?/))
					typ = window.location.protocol + '//' + window.location.hostname + '/' + typ;
				if ((pos = jacs.indexOf(typ)) != -1)
					jacs.splice(pos, 1);
			}
		}

		/* We spawn off a late-load/eval, should actually not matter much
		 * _when_ it is executed as long as its executed IN ORDER!
		 */
		var kiss = 0;

		function step() {
			if (kiss < jacs.length) {
				var scr = jacs[kiss++], src;

				if (scr.indexOf(window.location.protocol) == 0) {
					src = document.createElement('script');
					src.onload = function() { step(); };
					src.onreadystatechange = function() { if (this.readyState.match(/^(loaded)|(complete)$/)) step(); };
					src.type = 'text/javascript';
					src.src = scr;

					head.appendChild(src);
				}
				else {
				/*	src = document.createElement('script');
					src.type = 'text/javascript';
					src.innerHTML = scr;

					head.appendChild(src);
				} */
					try {
						/* IE: no global-scope with eval but execScript */
						if (window.execScript)
							window.execScript(scr);
						else
							window.eval(scr);
					}
					catch(e) {
					}

					step();
				}
			}
			/* DOM2: finished, trigger 'onload' */
			else if (document.createEvent) {
				var evt = document.createEvent('HTMLEvents');

         			evt.initEvent(
         			  'load',
         			  true,		// Click events bubble
         			  true);	// and they can be cancelled

				/* Safari: dipatch to the document instead */
				if (window.dispatchEvent)
	         			window.dispatchEvent(evt);
	         		else if (document.dispatchEvent)
	         			document.dispatchEvent(evt);
			}
			/* IE: "prototype.js"-specific */
			else if (typeof Event != 'undefined' && Event.observers && Event.observers.length) {
				for (var i = 0; i < Event.observers.length; i++) {
					if ((Event.observers[i][0] == window) &&
					    (Event.observers[i][1] == 'load'))
						try { Event.observers[i][2](); } catch(e) { };
				}
			}
		};

		step();
	}

	function appendJS(url, func, reload, reexec) {
		var head = document.getElementsByTagName("head")[0];

		if (!url.match(/https?/))
			url = window.location.protocol + '//' + window.location.hostname + '/' + url;

		for (var s = 0; s < head.childNodes.length; s++) {
			var typ, script = head.childNodes[s], pos;
			if (script.tagName && (script.tagName.toLowerCase() == 'script') && (typ = script.src)) {
				if (!typ.match(/https?/))
					typ = window.location.protocol + '//' + window.location.hostname + '/' + typ;
				if (typ == url) {
					if (!reload) { if (reexec)
						setTimeout(func, 0);
						return;
					}

					head.removeChild(script);
					break;
				}
			}
		}

		var src;

		src = document.createElement('script');
		src.onload = function() { func(); };
		src.onreadystatechange = function() { if (this.readyState.match(/^(loaded)|(complete)$/)) func(); };
		src.type = 'text/javascript';
		src.src = url;

		head.appendChild(src);
	}

	/* transparency tools ------------------------------------------------------------------- */
	function setOpacities(elms) {
		if (elms && elms.length) {
			for (var key in elms) {
				alert(key);
			}
		}
	}
//setOpacities([0.0 : document.body]);

	/* page transition fader ---------------------------------------------------------------- */
	var fader;

	function loadPlace() {
		document.body.parentNode.style.background = 'center 200px url(/pics/circle.gif) no-repeat white';
	}

	function loadRemove() {
		document.body.parentNode.style.background = 'none';
	}

	function fadeOut() {
		var text = document.getElementById('content');
		var foot = document.getElementById('foot');

		/* start the loading-indicator */
		loadPlace();

		clearInterval(fader);
		fader = setInterval(function() {
			if (0.0 < parseFloat(text.style.opacity)) {
				var steps = Math.floor(parseFloat(text.style.opacity) / 0.05);
				var posit = Math.floor(document.body.parentNode.scrollTop * Math.pow(steps / (steps + 1), 2));

				text.style.opacity = -0.05 + parseFloat(text.style.opacity);
				foot.style.opacity = -0.05 + parseFloat(foot.style.opacity);
				text.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(text.style.opacity)) + ")";
				foot.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(foot.style.opacity)) + ")";

				document.body.parentNode.scrollTop = posit;
			}
			else {
				clearInterval(fader);

				/* don't do these to prevent scrollbar flickering */
			//	text.style.display = 'none';
			//	foot.style.display = 'none';

				document.body.parentNode.scrollTop = 0;
			}
		}, 50);
	}

	function fadeWait(value) {
		var text = document.getElementById('content');
		var foot = document.getElementById('foot');

		return (Math.abs(value - parseFloat(text.style.opacity)) > 0.01);
	}

	function fadeIn() {
		var text = document.getElementById('content');
		var foot = document.getElementById('foot');

		text.style.display = 'block';
		foot.style.display = 'block';

		clearInterval(fader);
		fader = setInterval(function() {
			if (1.0 > parseFloat(text.style.opacity)) {
				text.style.opacity =  0.05 + parseFloat(text.style.opacity);
				foot.style.opacity =  0.05 + parseFloat(foot.style.opacity);
				text.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(text.style.opacity)) + ")";
				foot.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(foot.style.opacity)) + ")";
			}
			else {
				clearInterval(fader);

				/* start the loading-indicator */
				loadRemove();

				text.style.filter = null;
				foot.style.filter = null;
			}
		}, 50);
	}

	/* history system ------------------------------------------------------------------ */
	var monitor;

	if (MSIE) {
		var ifrm = document.createElement('iframe');

		ifrm.id = "dummy";
		ifrm.name = "dummy";
		ifrm.width = "0";
		ifrm.height = "0";
		ifrm.style.display = "none";
		ifrm.attachEvent('onload', function() {
			/* "about:blank" is not a valid history-entry for IE,
			 * also "about:blank" fires 'onload' even though src=""
			 * in addition, the pushHistory could be faster than
			 * loading "about:config", which means we can't just
			 * quit the first load unconditionaly
			 */
			if (window.frames.dummy.location.href == 'about:blank') {
				window.frames.dummy.monitor = false;
				window.frames.dummy.location.href = 'http://frohling.biz/blank.html' + window.location.uri.encode('?');

				return;
			}

			try { window.frames.dummy.monitor = true;  } catch(e) {}
		}, false);
		window.attachEvent('onload', function() {
			document.body.appendChild(ifrm);

			try { window.frames.dummy.monitor = false; } catch(e) {}
		}, false);

		window.location.uri = '';
	}

	/* Internet Explorer can't handle hashes with '/', and no urls with double '?', replace */
	String.prototype.encode = function(prefix) {
		var code = this.replace(/\//g,'|').replace(/\?/g,'!');	/**/

		return prefix + code;
	}

	String.prototype.decode = function(prefix) {
		var rest = this.split(prefix); if (rest.length > 1) rest.splice(0, 1); rest = rest.join(prefix);
		var code = rest.replace(/\|/g,'/').replace(/\!/g,'?');	/**/

		return code;
	}

	function monitorHistory() {
		clearTimeout(monitor);

		/* iframe-history object */
		try { if (window.frames.dummy && window.frames.dummy.monitor) {
			/* the history of failures:
			 *   1) iframe.src != dummy.location
			 *	doesn't work beacause we can't change src to reflect
			 *	our changes, because it kills the iframe-history
			 *   2) location.hash != dummy.location
			 *	doesn't work because the user should be able to
			 *	change the hash on it's own (bookmarks too)
			 */
			var oldstr = window.location.uri;
			var hshstr = window.frames.dummy.location.search.decode('?');

			if (oldstr != hshstr)
				window.location.hash = hshstr.encode('#');
		} } catch(e) {}

		var newstr = window.location.hash.decode('#');
		var oldstr = window.location.uri;
		var dmnstr = window.location.protocol + '//' + window.location.hostname;

		if (newstr != oldstr) {
			/* update global anchor */
			window.location.rel = dmnstr + newstr;
			window.location.uri = newstr;

			cacheRequest(window.location);
		}
		else
			monitor = setTimeout(monitorHistory, 1000);
	}

	function pushHistory(url, uri) {
		clearTimeout(monitor);

		/* update global anchor */
		window.location.rel  = url;
		window.location.uri  = uri;
		window.location.hash = uri.encode('#');

		/* iframe-history object */
		try { if (window.frames.dummy) {
			var hshstr = window.frames.dummy.location.search.decode('?');

			if (hshstr != uri) {
				window.frames.dummy.monitor = false;
				window.frames.dummy.location.href = 'http://frohling.biz/blank.html' + uri.encode('?');
			}
		} } catch(e) {}

		monitor = setTimeout(monitorHistory, 100);
	}

	/* caching system ------------------------------------------------------------------ */
	var pages = new Array();
	var request;

	function cacheObj(doc) {
		this.doc = doc;
	}

	function cacheDisplay(anchor, che) {
		/* wait untill we really can do something */
		if (fadeWait(0.0))
			setTimeout(function() { cacheDisplay(anchor, che); }, 100);
		else {
			if ((che.doc.readyState == 4) && (che.doc.status == 200)) {
				/* replace the old elements by the new */
				document.title                               = che.elm.title;
				document.getElementById('content').innerHTML = che.elm['text'].innerHTML;
				document.getElementById('subm'   ).innerHTML = che.elm['subm'].innerHTML;
				document.getElementById('menu'   ).innerHTML = che.elm['menu'].innerHTML;

				/* re-evaluate dynamic js/css (first!, because img/object may contain onloads) */
				/* re-evaluate dynamic js/css (last!, because onloads may walk the tree) */
				matchLINKs(che.elm.links);
				matchCSSs(che.elm.styles);
				matchJSs(che.elm.scripts);
			}
			else {
				document.getElementById('content').innerHTML = '' +
					'<h1>Pagina no encontrada!<\/h1>' +
					'<p>La dirección "' + che.rel + '" no se ha encontrado o denego accesso.<\/p>';
			}

			/* update global anchor */
			pushHistory(che.rel, che.ref);

			/* replace the old anchors by the new */
			reproc();

			/* fade the content in */
			fadeIn();
		}
	}

	function cacheStore(anchor, doc) {
		var che = new cacheObj(doc);

		/* store the new nodes too, for not search all over again */
		if (!che.elm) {
			che.elm = new Array();

			che.elm.title   = getElementByIdXML(che.doc, 'title', 1);
			che.elm['menu'] = getElementByIdXML(che.doc, 'ul', 'menu');
			che.elm['subm'] = getElementByIdXML(che.doc, 'ul', 'subm');
			che.elm['text'] = getElementByIdXML(che.doc, 'div', 'content');
			che.elm.links   = getElementByIdXML(che.doc, 'link', -1);
			che.elm.styles  = getElementByIdXML(che.doc, 'style', -1);
			che.elm.scripts = getElementByIdXML(che.doc, 'script', -1);

			che.rel = anchor.rel;
			che.ref = anchor.uri;
		}

		cacheDisplay(anchor, pages[anchor.rel] = che);
	}

	function cacheCheck(anchor, doc) {
		/* IE does not return a 'Last-Modified' on a HEAD-request! :-( */
		var A, a = new Date(A = pages[anchor.rel].doc.getResponseHeader('Last-Modified')), aa = a.getTime();
		var B, b = new Date(B =                   doc.getResponseHeader('Last-Modified')), bb = b.getTime();

		/* we don't have an older version */
		if (isNaN(a) || isNaN(b) || (a < b)) {
//			doAsyncAbortRequest(request);
			request = doAsyncGETRequest(anchor.rel, null, null, cacheStore, anchor);
		}
		else
			cacheDisplay(anchor, pages[anchor.rel]);
	}

	function cacheRequest(anchor) {
		/* fade the content out */
		fadeOut();

		/* go on and find some (possibly new) content */
		if (pages[anchor.rel]) {
//			doAsyncAbortRequest(request);
			request = doAsyncHEADRequest(anchor.rel, null, null, cacheCheck, anchor);
		}
		else {
//			doAsyncAbortRequest(request);
			request = doAsyncGETRequest(anchor.rel, null, null, cacheStore, anchor);
		}
	}

	function directForm(form) {
		var parms = new Array();

		for (var e = 0; e < form.elements.length; e++) {
			var elm = form.elements[e];

			if (elm.name && (elm.name != '')) {
				if (elm.tagName.toLowerCase() == 'input') {
					if (elm.type == 'checkbox') {
						if (elm.checked)
							parms[elm.name] = 'on';
					}
					else if (elm.type == 'radio') {
						for (var r = 0; r < form.radios.length; r++) {
							if ((form.radios[r].name == elm.name) && form.radios[r].checked) {
								parms[elm.name] = form.radios[r].value;
								break;
							}
						}
					}
					else if (elm.type == 'submit') {
						if (elm.smitted)
							parms[elm.name] = elm.value;
					}
					else if (elm.type == 'image') {
						if (elm.smitted)
							parms[elm.name] = elm.value;
					}
					else
						parms[elm.name] = elm.value;
				}
				else
					parms[elm.name] = elm.value;
			}
		}

		return parms;
	}

	function directRequest(form) {
		/* fade the content out */
		fadeOut();

		/* go on and find some (possibly new) content */
//		doAsyncAbortRequest(request);
		request = doAsyncPOSTRequest(form.rel, directForm(form), null, cacheStore, form);
	}

	/* local anchor switch ------------------------------------------------------------------ */
//	var urlstr = '^https?:\/\/(www.)?' + window.location.hostname;
	var urlstr = '^https?:\/\/(www.)?' + tldomain();
	var uristr = '^(https?)|(mailto)|(javascript)|(skype)|(ftp)+:';
	var extstr = '^(mailto)|(javascript)|(skype)|(ftp)+:';
	var tp3str = '(fileadmin\/)|(typo3\/)|(stats\/)|(TSFE)|(ADMCMD)+';
	var urlexp = new RegExp(urlstr, 'g');
	var uriexp = new RegExp(uristr, 'g');
	var extexp = new RegExp(extstr, 'g');
	var tp3exp = new RegExp(tp3str, 'g');

	function relink() {
		var hshstr = window.location.hash.decode('#');
		var dmnstr = window.location.protocol + '//' + window.location.hostname;
		var pthstr = window.location.protocol + '//' + window.location.hostname + window.location.pathname;

		/* replace anchors ----------------------------------- */
		var as = document.getElementsByTagName('a');

		for (var i = 0; i < as.length; i++) {
			var anchor = as[i];

			/* local anchors */
			if (!anchor.rel)
			if ( anchor.href.match(urlexp) ||
			    !anchor.href.match(uriexp)) {
			if (!anchor.href.match(tp3exp) &&
			    !anchor.href.match(dmnstr + '/#') &&
			    !anchor.href.match('#')) {

				anchor.rel     = anchor.href;
				anchor.uri     = anchor.rel.replace(urlexp, '');
				anchor.href    = pthstr + anchor.uri.encode('#');
				anchor.preclck = anchor.onclick && anchor.getAttribute('onsubmit') ? anchor.onclick : null;
				anchor.onclick = function() {
					if (this.preclck && (this.preclck != this.onclick))
						if (!this.preclck())
							return false;
					cacheRequest(this);
					return false; };
				anchor.target  = '';
			}
			}
			/* external anchors receive a thumbnail if available */
			else if (!anchor.href.match(extexp) &&
				 !anchor.onmouseover &&
				 !anchor.onmouseout) {
				anchor.onmouseover = function() {
					var dimg = document.createElement('img');

					dimg.className = 'thumb';
					dimg.onload = function() {
						this.style.marginLeft = (this.width / -2) + 'px';
						this.style.visibility = 'visible'; }
					dimg.src = 'http://www.shrinktheweb.com/xino.php?embed=1&STWAccessKeyId=36b3a6b0c49d81f&stwsize=sm&stwUrl=' + this.protocol + '//' + this.hostname;

					this.style.position = 'relative';
					this.appendChild(dimg);
				};

				anchor.onmouseout  = function() {
					if (this.lastChild.className == 'thumb')
						this.removeChild(this.lastChild);
				};
			}
		}

		/* replace formulars ----------------------------------- */
		var forms = document.getElementsByTagName('form');

		for (var i = 0; i < forms.length; i++) {
			var form = forms[i];

			/* local anchors */
			if (!form.rel)
			if ( form.action.match(urlexp) ||
			    !form.action.match(uriexp)) {
			if (!form.action.match(tp3exp) &&
			    !form.action.match(dmnstr + '/#')) {

				form.rel      = form.action;
				form.uri      = form.rel.replace(urlexp, '');
				form.action   = pthstr + form.uri.encode('#');
				form.presbmit = form.onsubmit && form.getAttribute('onsubmit') ? form.onsubmit : null;
				form.onsubmit = function() {
					if (this.presbmit && (this.presbmit != this.onsubmit))
						if (!this.presbmit())
							return false;
					directRequest(this);
					return false; }
				form.target   = '';
			}
			}
		}

		/* replace submits ----------------------------------- */
		var inputs = document.getElementsByTagName('input');

		for (var i = 0; i < inputs.length; i++) {
			var input = inputs[i];

			/* local submits */
			if (!input.rel && input.form.rel)
			if ((input.type == 'submit') ||
			    (input.type == 'image')) {

				input.rel     = input.form.rel;
				input.smitted = false;
				input.preclck = input.onclick;
				input.onclick = function() { if (this.preclck && (this.preclck != this.onclick)) this.preclck(); this.smitted = true; }
			}
		}
	};

	/* before-display hiding ----------------------------------------------------------------
	 *
	 * dynamicCSS.js v1.0 <http://www.bobbyvandersluis.com/articles/dynamicCSS.php>
	 * Copyright 2005 Bobby van der Sluis
	 * This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
	 */
	function createStyleRule(selector, declaration) {
		if (!document.getElementsByTagName ||
		  !(document.createElement || document.createElementNS)) return;
		var agt = navigator.userAgent.toLowerCase();
		var is_ie = ((agt.indexOf("msie") != -1) &&  (agt.indexOf("opera") == -1));
		var is_iewin = (is_ie &&  (agt.indexOf("win") != -1));
		var is_iemac = (is_ie &&  (agt.indexOf("mac") != -1));
		if (is_iemac) return; // script doesn't work properly in IE/Mac
		if (is_ie) is_iewin = true;
		var head = document.getElementsByTagName("head")[0];
		var style = (typeof document.createElementNS != "undefined") ?
		  document.createElementNS("http://www.w3.org/1999/xhtml", "style") :
		  document.createElement("style");
		if (!is_iewin) {
		    var styleRule = document.createTextNode(selector + " {" + declaration + "}");
		        style.appendChild(styleRule); // bugs in IE/Win
		}
		style.setAttribute("type", "text/css");
		style.setAttribute("media", "screen");
		head.appendChild(style);
		if (is_iewin &&  document.styleSheets && document.styleSheets.length > 0) {
		    var lastStyle = document.styleSheets[document.styleSheets.length - 1];
		    if (typeof lastStyle.addRule == "object") {
		    	/* IE can't add multi-rules at once */
		    	var selectors = selector.split(',');
		    	for (var n = 0; n < selectors.length; n++)
		          lastStyle.addRule(selectors[n], declaration, -1);
		    }
		}
	}

	/* DOM manipulation functions;
	 * Can only be used after a page has fully loaded
	 */
	function setElementStyleById(id, propertyName, propertyValue) {
		if (!document.getElementById) return;
		var el = document.getElementById(id);
		if (el) el.style[propertyName] = propertyValue;
	}

	function setElementStyle(element, propertyName, propertyValue) {
		if (!document.getElementsByTagName) return;
		var el = document.getElementsByTagName(element);
		for (var i = 0; i < el.length; i++) {
			el[i].style[propertyName] = propertyValue;
		}
	}

	function setElementStyleByClassName(cl, propertyName, propertyValue) {
		if (!document.getElementsByTagName) return;
		var re = new RegExp("(^| )" + cl + "( |$)");
		var el = document.all ? document.all : document.getElementsByTagName("body")[0].getElementsByTagName("*"); // fix for IE5.x
		for (var i = 0; i < el.length; i++) {
			if (el[i].className && el[i].className.match(re)) {
				el[i].style[propertyName] = propertyValue;
			}
		}
	}

	/* animated intro ----------------------------------------------------------------------- */
	function intro() {
		var body = document.body;

//		/* extract the contents from the noscript-element, which actually is not a DOM-tree */
//		var nscr = document.getElementsByTagName("noscript")[0];
//		var temp = document.createElement('div');
//
//		temp.innerHTML = nscr.textContent;
//
//		var textLocal = getElementByIdLocal(temp, 'div', 'content');
//		var menuLocal = getElementByIdLocal(temp, 'ul', 'menu');
//		var srchLocal = getElementByIdLocal(temp, 'div', 'srch');
//		var submLocal = getElementByIdLocal(temp, 'ul', 'subm');
//		var langLocal = getElementByIdLocal(temp, 'ul', 'lang');
//		var adrsLocal = getElementByIdLocal(temp, 'div', 'adrs');
//
//		/* directly map the content without any thought */
//		textLocal.style.display = 'none';
//		while (body.firstChild)
//			body.removeChild(body.firstChild);
//		body.appendChild(textLocal);

		var textLocal = document.getElementById('content');
		var menuLocal = document.getElementById('menu');
		var srchLocal = document.getElementById('srch');
		var submLocal = document.getElementById('subm');
		var langLocal = document.getElementById('lang');
		var adrsLocal = document.getElementById('adrs');

		/* directly map the content without any thought */
		while (body.firstChild)
			body.removeChild(body.firstChild);
		body.appendChild(textLocal);

		/* begin creating the animation-elements */
		var text = document.getElementById("content");

		var back = document.createElement("div"); back.className = "back";                           back.style.left =   "0%"; back.style.top = "0";
		var bacR = document.createElement("div"); bacR.className = "back"; bacR.style.opacity = 0.0; bacR.style.left = "100%"; bacR.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(bacR.style.opacity)) + ")";
		var bacC = document.createElement("div"); bacC.className = "back"; bacC.style.opacity = 0.0;                           bacC.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(bacC.style.opacity)) + ")";
		var guid = document.createElement("div"); guid.className = "guid"; guid.style.opacity = 0.0;                           guid.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(guid.style.opacity)) + ")";
		var looo = document.createElement("a"  ); looo.className = "looo";
		var dot1 = document.createElement("img"); dot1.className = "dot1"; dot1.radius = 18.0; dot1.angle = 256.0; dot1.slope = 0.0; dot1.speed = 0.0;
		var dot2 = document.createElement("img"); dot2.className = "dot2"; dot2.radius = 18.0; dot2.angle = 284.0; dot2.slope = 0.0; dot2.speed = 0.0;
		var logo = document.createElement("img"); logo.className = "logo";
		var menu = document.createElement("ul" ); menu.className = "menu"; menu.id = "menu";         menu.style.left = "100%";
		var srch = document.createElement("div"); srch.className = "srch"; srch.id = "srch";         srch.style.left =  "40%"; srch.style.opacity = 0.0; srch.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(srch.style.opacity)) + ")";

		var foot = document.createElement("div"); foot.className = "foot"; foot.id = "foot";
		var term = document.createElement("div"); term.className = "term";
		var lang = document.createElement("ul" ); lang.className = "menu"; lang.id = "lang";
		var subm = document.createElement("ul" ); subm.className = "menu"; subm.id = "subm";
		var adrs = document.createElement("div"); adrs.className = "adrs";

		var fakR = document.createElement("img"); fakR.className = "fake";
		var fakC = document.createElement("img"); fakC.className = "fake";
		var fakL = document.createElement("img"); fakL.className = "fake";

		var cascade = 0, missing = 1;

		/* ---------------------------------------------------------------------------------- */
		menu.innerHTML = (menuLocal ? menuLocal.innerHTML : '');
		srch.innerHTML = (srchLocal ? srchLocal.innerHTML : '');
		srch.style.background = 'none';
		looo.alt = "frohling"
		looo.href = "/";

		looo.appendChild(fakL);
		looo.appendChild(fakC);
		looo.appendChild(fakR);
		looo.appendChild(logo);
		looo.appendChild(dot1);
		looo.appendChild(dot2);
		guid.appendChild(looo);
		guid.appendChild(menu);
		guid.appendChild(srch);
		back.appendChild(bacC);
		back.appendChild(bacR);
		back.appendChild(guid);
		body.insertBefore(back, body.firstChild);

		/* ---------------------------------------------------------------------------------- */
		lang.innerHTML = (langLocal ? langLocal.innerHTML : '');
		subm.innerHTML = (submLocal ? submLocal.innerHTML : '');
		adrs.innerHTML = (adrsLocal ? adrsLocal.innerHTML : '');

		term.appendChild(subm);
		term.appendChild(lang);
		term.appendChild(adrs);
		foot.appendChild(term);
		body.appendChild(foot);

		/* ---------------------------------------------------------------------------------- */
		back.style.display = 'block';
		text.style.display = 'none';
		foot.style.display = 'none';

		/* stage 1 - react on loading the first picture (logo) ----------------------- */
		fakL.onload = function() {
		//	looo.style.background = "center center url(" + fakL.src + ") no-repeat transparent";
			logo.src              =                        fakL.src;

			/* sliding logo to the left */
			var givl = setInterval(function() {
				if (cascade >= 0)
					if (1.0 > parseFloat(guid.style.opacity)) {
						guid.style.opacity = 0.02 + parseFloat(guid.style.opacity);
						guid.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(guid.style.opacity)) + ")";
					}
					else {
						clearInterval(givl);
						cascade++;

						guid.style.opacity = '';
						guid.style.filter  = '';
					}
			}, 10);
		};

		/* stage 2 - react on loading the second picture (ray) ----------------------- */
		fakR.onload = function() {
			bacR.style.background = "center center url(" + fakR.src + ") no-repeat transparent";

			/* no loader from now on */
			loadRemove();

			/* appearing ray */
			var bivl = setInterval(function() {
				if (cascade >= 1)
					if (1.0 > parseFloat(bacR.style.opacity)) {
						bacR.style.opacity = 0.04 + parseFloat(bacR.style.opacity);
						bacR.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(bacR.style.opacity)) + ")";
						bacR.style.left = Math.floor(parseInt(bacR.style.left) / 1.333) + "%";
					}
					else {
						clearInterval(bivl);
						cascade++;

						bacR.style.opacity = '';
						bacR.style.filter  = '';
					}
			}, 10);
		};

		/* stage 2 - react on loading the third picture (cloud) ---------------------- */
		fakC.onload = function() {
			bacC.style.background = "center center url(" + fakC.src + ") no-repeat transparent";
			term.style.background = "right  bottom url(pics/bg-foot.png) no-repeat transparent";

			/* appearing cloud */
			var bivl = setInterval(function() {
				if (cascade >= 2)
					if (1.0 > parseFloat(bacC.style.opacity)) {
						bacC.style.opacity = 0.05 + parseFloat(bacC.style.opacity);
						bacC.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(bacC.style.opacity)) + ")";
					}
					else {
						clearInterval(bivl);
						cascade++;

						bacC.style.opacity = '';
						bacC.style.filter  = '';
					}
			}, 10);

			/* the whole block sliding to the left */
			var livl = setInterval(function() {
				if (cascade >= 3)
					if (0 < (50 + parseFloat(back.style.left))) {
						back.style.left = -50 + Math.floor((50 + parseFloat(back.style.left)) / 1.2) + "%";
					}
					else {
						clearInterval(livl);
						cascade++;
					}
			}, 10);

			/* menu sliding in from the right */
			var mivl = setInterval(function() {
				if (cascade >= 4)
					if (0 < (parseInt(menu.style.left) - 50)) {
						menu.style.left = parseInt(menu.style.left) - 5 + "%";
					}
					else {
						clearInterval(mivl);

						back.style.marginTop = back.clientHeight + "px";
						back.style.top = "-100%";

						cascade++;
					}
			}, 10);

			/* the whole block sliding to the top */
			var tivl = setInterval(function() {
				if (cascade >= 5)
					if (175 < parseInt(back.style.marginTop)) {
						back.style.marginTop = 175 + Math.floor((parseInt(back.style.marginTop) - 175) / 1.2) + "px";
					}
					else {
						clearInterval(tivl);

						back.style.height = back.style.marginTop;
						back.style.marginTop = "0";
						back.style.top = "0";

						text.style.opacity = 0.0;
						foot.style.opacity = 0.0;

						text.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(text.style.opacity)) + ")";
						foot.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(foot.style.opacity)) + ")";

						text.style.display = "block";
						foot.style.display = "block";

						back.style.overflow = "visible";
						foot.style.overflow = "visible";

						cascade++;
					}
			}, 10);

			/* content fading in */
			var civl = setInterval(function() {
				if (cascade >= 6)
					if (1.0 > parseFloat(text.style.opacity)) {
						srch.style.left    = 0.5   + parseFloat(srch.style.left   ) + '%';
						srch.style.opacity = 0.033 + parseFloat(srch.style.opacity);
						text.style.opacity = 0.050 + parseFloat(text.style.opacity);
						foot.style.opacity = 0.050 + parseFloat(foot.style.opacity);

						srch.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(srch.style.opacity)) + ")";
						text.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(text.style.opacity)) + ")";
						foot.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(foot.style.opacity)) + ")";
					}
					else {
						clearInterval(civl);
						cascade++;

						srch.style.left    = '';
						srch.style.opacity = '';
						text.style.opacity = 1.0;
						foot.style.opacity = 1.0;

						srch.style.filter  = '';
						text.style.filter  = '';
						foot.style.filter  = '';
					}

					if (MSIE)
						srch.firstChild.firstChild.style.filter =
						srch.firstChild.lastChild.style.filter =
						srch.firstChild.style.filter =
						srch.style.filter;
			}, 100);
		};

		/* first loading dot --------------------------------------------------------- */
		var rot1 = setInterval(function() {
			var y = dot1.radius * Math.sin(2 * Math.PI * dot1.angle / 360);
			var x = dot1.radius * Math.cos(2 * Math.PI * dot1.angle / 360);
			var u =           x * Math.sin(2 * Math.PI * dot1.slope / 360);
			var v =           x * Math.cos(2 * Math.PI * dot1.slope / 360);

			dot1.style.marginTop  = (-2.5 + -45 + y) + "px";
			dot1.style.marginLeft = (-2.0 + -23 + v) + "px";

			if ((cascade < 5) ||
			    (Math.abs(65 + parseFloat(dot1.style.marginTop )) >= 2) ||
			    (Math.abs(30 + parseFloat(dot1.style.marginLeft)) >= 2)) {
				dot1.angle = (dot1.angle + 2 * 6.00) % 360;
				dot1.slope = (dot1.slope +     0.50) % 360;
			}
			else
				clearInterval(rot1);
		}, 10);

		/* second loading dot -------------------------------------------------------- */
		var rot2 = setInterval(function() {
			var y = dot2.radius * Math.sin(2 * Math.PI * dot2.angle / 360);
			var x = dot2.radius * Math.cos(2 * Math.PI * dot2.angle / 360);
			var u =           x * Math.sin(2 * Math.PI * dot2.slope / 360);
			var v =           x * Math.cos(2 * Math.PI * dot2.slope / 360);

			dot2.style.marginTop  = (-2.5 + -45 + y) + "px";
			dot2.style.marginLeft = (-2.0 + -23 + v) + "px";

			if ((cascade < 5) ||
			    (Math.abs(65 + parseFloat(dot2.style.marginTop )) >= 2) ||
			    (Math.abs(20 + parseFloat(dot2.style.marginLeft)) >= 2)) {
				dot2.angle = (dot2.angle + 2 * 356.00) % 360;
				dot2.slope = (dot2.slope +       0.75) % 360;
			}
			else
				clearInterval(rot2);
		}, 10);

		/* now load for real */
		dot1.src = "pics/dot.png";
		dot2.src = "pics/dot.png";
		fakL.src = "pics/logo.png";
		fakR.src = "pics/bg-ray.png";
		fakC.src = "pics/bg-cloud.png";
	};

	function prolog() {
		var text = document.getElementById('content');
		var foot = document.getElementById('foot');

		text.style.opacity = 0;
		foot.style.opacity = 0;
		text.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(text.style.opacity)) + ")";
		foot.style.filter = "alpha(Opacity=" + parseInt(100 * parseFloat(foot.style.opacity)) + ")";

		fadeIn();
	}

	/* trigger it all  ----------------------------------------------------------------------- */
	function reproc() {
		var txt = document.getElementById('content');

		/* go on and refilter new textNodes */
		if (txt && (typeof textproc != 'undefined') && textproc)
			textproc(txt);
		/* go on and refilter new rotators */
		if (txt && (typeof effectproc != 'undefined') && effectproc)
			effectproc(txt);

		/* go on and refilter new anchors/forms/submits */
		relink();
	}

	/* async is a requirement */
	if (!MSI6 && (typeof aios != 'undefined')) {
		var dotrans = (!document.referrer.match(tp3exp));
		var dointro = (window.location.pathname == '/') &&
			      ((window.location.hash == '') ||
			       (window.location.hash.decode('#') == '') ||
			       (window.location.hash.decode('#') == '/'));

		/* include all feature tests needed for your DOM script */
		if (dotrans && document.getElementById) {
			if (dointro)
				createStyleRule("body > div.back, body > div.text, body > div.foot", "display: none;");
			else
				createStyleRule(                 "body > div.text, body > div.foot", "display: none;");

//			window.onload = setElementStyleById("el", "display", "none"); // fallback for IE5/Mac
		}

		/* prepare-text-filtering (asynchronous, to let the animation run)
		 * I would liked to have it inside the onload, but it freezes every
		 * browser except firefox (?)
		 */
		appendJS('fileadmin/templates/texts.js', function() {
		appendJS('fileadmin/templates/acronyms/technical.js', function() {
		appendJS('fileadmin/templates/hyphenations/es.js', function() {
			/* the loading may delay as so long as we passed reproc allready
			 * so just do this as prophylactic post-proc
			 */
			textinit();
			textproc(document.getElementById('content'));
		});
		});
		});

		/* trigger initial switch ----------------------------------- */
		window.location.rel = '';
		window.location.uri = '';
		window.onload = function() {
			/* quit us first, we'll not react on onload again */
			window.onload = null;

			/* make the whole animation thingy, or just blend in */
			if (dointro)
				intro();
			else if (dotrans)
				prolog();
//			else
//				document.body.innerHTML = document.getElementsByTagName("noscript")[0].textContent;

			/* prepare the initial content-transformation */
			reproc();

			/* watch blending-application */
			if (dotrans)
				monitorHistory();
		}
	}
