window.undefined = window.undefined;
window.oe = function (Fehler,Datei,Zeile)
{
	alert('Es ist der JS- Fehler: '+Fehler+', in der Datei: '+Datei+', in der Zeile: '+Zeile+'Aufgetreten.');
}
window.o2 = function ()
{
	return true;
}
window.onerror=window.o2;
if(!Function.prototype.apply)Function.prototype.apply = function(thisArg, argArray) {
    if (typeof this != "function") {
        throw new Error("apply called on incompatible " +
                    "object (not a function)");
    }
    if (argArray != null && !(argArray instanceof Array)
        && typeof argArray.callee != "function") {
        throw new Error("The 2nd argument to apply must " +
                    "be an array or arguments object");
    }

    thisArg = (thisArg == null) ? window : Object(thisArg);
    thisArg.__applyTemp__ = this;

    // youngpup's hack
    var parameters = [],
        length = (argArray || "").length >>> 0;
    for (var i = 0; i < length; i++) {
        parameters[i] = "argArray[" + i + "]";
    };
    var functionCall =
            "thisArg.__applyTemp__(" + parameters + ")";

    try {
        return eval(functionCall)
    } finally {
        try {
            delete thisArg.__applyTemp__
        } catch (e) {
           thisArg.__applyTemp__ = null;
        }
    }
}

if(!Function.prototype.call)Function.prototype.call = function(thisArg) {
    return this.apply(thisArg,
            Array.prototype.slice.apply(arguments, [1]));
}

if(!Array.prototype.push)Array.prototype.push = function()
{
	for(var i=0;i<arguments.length;i++){
		this[this.length]=arguments[i]
	};
	return this.length;
}
if(!Array.prototype.pop)Array.prototype.pop = function()
{
    lastElement = this[this.length-1];
	this.length = Math.max(this.length-1,0);
    return lastElement;
}
if(!Array.prototype.shift)Array.prototype.shift = function()
{
	var firstElement = this[0];
	this.reverse();
	this.length = Math.max(this.length-1,0);
	this.reverse();
	return firstElement;
}

if(!Array.prototype.unshift)Array.prototype.unshift = function()
{
	this.reverse();
	for(var i=arguments.length-1;i>=0;i--){
		this[this.length] = arguments[i];
	}		
	this.reverse();
	return this.length;
}

window.$GLOBALS = {}; // Variable $GLOBALS als Objekt (assoziatives Array) deklariert, new Object() w�rde das selbe bewirken

window.NULL = null;
window.FALSE = false;
window.TRUE = true;

window.opera = window.opera;

if(navigator.appVersion.match(/MSIE/)&&!navigator.appVersion.match(/Macintosh/)&&!opera&&!navigator.appVersion.match(/Konqueror/)){
	if(!navigator.appVersion.match(/MSIE 7/)){
		document.IE=true;
	}
	else{
		document.IE7=true;
	}
}
navigator.versionNr = (document.IE==true) ? parseFloat(navigator.appVersion.substr((navigator.appVersion.indexOf('MSIE')+4),4)) : parseFloat(navigator.appVersion);
/* Prototype Begin */
//for(var i in navigator)alert(i + ' : ' + navigator[i]);

var Prototype = {
  BrowserFeatures: {
    XPath: !!document.evaluate
  },
  ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)'
}

window.Class = {
	create: function() {
		return function() {
			this.initialize.apply(this, arguments);
		}
	}
}

Object.extend = function(destination, source) {
	for (property in source) destination[property] = source[property];
	return destination;
}

Function.prototype.bind = function(object) {
  var __method = this, args = $A(arguments), object = args.shift();
  return function() {
    return __method.apply(object, args.concat($A(arguments)));
  }
}

Function.prototype.bindAsEventListener = function(object) {
  var __method = this, args = $A(arguments), object = args.shift();
  return function(event) {
    return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments)));
  }
}
window.$ = function() {
	if (arguments.length == 1) return get$(arguments[0]);
	var elements = [];
	$A(arguments).foreach(function(el){
		elements.push(get$(el));
	});
	return elements;

	function get$(el){
		if (typeof el == 'string') el = document.getElementById(el);
		return el;
	}
}
if (!window.Element) window.Element = new Object();

window.Enumerable = {
include: function(object) {
    var found = false;
	$this = $A(this);
    $this.foreach(function(value) {
      if (value == object) {
        found = true;
        throw $break;
      }
    });
    return found;
  }
}

Object.extend(Array.prototype, Enumerable);

Object.extend(Element, {
	remove: function(element) {
		element = $(element);
		element.parentNode.removeChild(element);
	},

	hasClassName: function(element, className) {
		element = $(element);
		if (!element) return;
		var hasClass = false;
		if(typeof element.className != 'undefined'){
			element.className.split(' ').foreach(function(cn){
				if (cn == className) hasClass = true;
			});
		}
		return hasClass;
	},

	addClassName: function(element, className) {
		element = $(element);
		Element.removeClassName(element, className);
		element.className += ' ' + className;
	},
  
	removeClassName: function(element, className) {
		element = $(element);
		if (!element) return;
		var newClassName = '';
		element.className.split(' ').foreach(function(cn, i){
			if (cn != className){
				if (i > 0) newClassName += ' ';
				newClassName += cn;
			}
		});
		element.className = newClassName;
	},

	cleanWhitespace: function(element) {
		element = $(element);
		$A(element.childNodes).foreach(function(node){
			if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) Element.remove(node);
		});
	},

	find: function(element, what) {
		element = $(element)[what];
		while (element.nodeType != 1) element = element[what];
		return element;
	}
});

window.Position = {
	cumulativeOffset: function(element) {
		var valueT = 0, valueL = 0;
		do {
			valueT += element.offsetTop  || 0;
			valueL += element.offsetLeft || 0;
			element = element.offsetParent;
		} while (element);
		return [valueL, valueT];
	}
};

Object.extend(String.prototype, {
	camelize: function() {
    var oStringList = this.split('-');
    if (oStringList.length == 1) return oStringList[0];

    var camelizedString = this.indexOf('-') == 0
      ? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
      : oStringList[0];

    for (var i = 1, length = oStringList.length; i < length; i++) {
      var s = oStringList[i];
      camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
    }

    return camelizedString;
  },
  trim: function() {
    return this.replace(/^\s+/, '').replace(/\s+$/, '');
  },

  stripTags: function() {
    return this.replace(/<\/?[^>]+>/gi, '');
  },
  strpos: function(needle)
  {
	  return this.indexOf(needle) == -1 ? FALSE : this.indexOf(needle);
  },
  strstr: function(needle)
  {
	  return this.indexOf(needle) == -1 ? FALSE : needle.substr(this.indexOf(needle));
  },
  ucfirst: function(string)
  {
	  return this.substr(0,1).toUpperCase() + this.substr(1);
  }
});

document.getElementsByClassName = function(className) {
	var children = document.all || document.getElementsByTagName('*');
	var elements = [];
	$A(children).foreach(function(child){
		if (Element.hasClassName(child, className)) elements.push(child);
	});  
	return elements;
}
//useful array functions
Object.extend(Array.prototype,{
	foreach : function(func)
	{
		for(var i=0;i<this.length;i++){
			func(this[i], i);
		}
	},
	count : function()
	{
		return this.length;
	},
	in_array : function()
	{
		for(var i=0;i<this.length;i++){
			if(this[i] == arguments[0])
			{
				return true;	
			}
		};
		return false;
	}
});

window.$A = function(array){
	var nArray = [];
	for (var i=0;i<array.length;i++) nArray.push(array[i]);
	return nArray;
}

window.$T = function (tag_name, Parent)
{
	return tag_name != '*'  ? $A((Parent || document).getElementsByTagName(tag_name)) : (document.IE && (navigator.versionNr < 6) ? $A((Parent || document).all) : $A((Parent || document).getElementsByTagName('*')));
}

window.$C = document.getElementsByClassName;

window.__continue = function (Index)
{
	if((Index == 'push')||(Index=='count')||(Index=='length')||(Index=='foreach')||(Index=='in_array'))return true;
	return false;
}
Object.extend(Object.prototype,{
	push : function()
	{
		for(var i=0;i<arguments.length;i++){
			for(var x in arguments[i]){
				this[x] = arguments[i][x];	
			}
		};
		return this.count();
	},
	foreach : function(func){
		var z = 0;
		for(var i in this){
			if(window['__continue'](i))continue;
			func([this[i],i], z);
			z++;
		}
	},
	count : function()
	{
		var j = 0;
		for(var i in this){
			if(window['__continue'](i))continue;
			j++;
		};
		return j;
	},
	in_array : function()
	{
		for(var i in this){
			if(window['__continue'](i))continue;
			if(this[i] == arguments[0])
			{
				return true;	
			}
		};
		return false;
	}
});

if (!window.Event) {
  window.Event = new Object();
}

Object.extend(Event, {
  KEY_BACKSPACE: 8,
  KEY_TAB:       9,
  KEY_RETURN:   13,
  KEY_ESC:      27,
  KEY_LEFT:     37,
  KEY_UP:       38,
  KEY_RIGHT:    39,
  KEY_DOWN:     40,
  KEY_DELETE:   46,
  KEY_HOME:     36,
  KEY_END:      35,
  KEY_PAGEUP:   33,
  KEY_PAGEDOWN: 34,

  element: function(event) {
    return event.target || event.srcElement;
  },

  isLeftClick: function(event) {
    return (((event.which) && (event.which == 1)) ||
            ((event.button) && (event.button == 1)));
  },

  pointerX: function(event) {
    return event.pageX || (event.clientX +
      (document.documentElement.scrollLeft || document.body.scrollLeft));
  },

  pointerY: function(event) {
    return event.pageY || (event.clientY +
      (document.documentElement.scrollTop || document.body.scrollTop));
  },

  stop: function(event) {
    if (event.preventDefault) {
      event.preventDefault();
      event.stopPropagation();
    } else {
      event.returnValue = false;
      event.cancelBubble = true;
    }
  },

  // find the first node with the given tagName, starting from the
  // node the event was triggered on; traverses the DOM upwards
  findElement: function(event, tagName) {
    var element = Event.element(event);
    while (element.parentNode && (!element.tagName ||
        (element.tagName.toUpperCase() != tagName.toUpperCase())))
      element = element.parentNode;
    return element;
  },

  observers: false,

  _observeAndCache: function(element, name, observer, useCapture) {
    if (!this.observers) this.observers = [];
    if (element.addEventListener) {
      this.observers.push(
						  [element, name, observer, useCapture]
						  );
      element.addEventListener(name, observer, useCapture);
    } else if (element.attachEvent) {
      this.observers.push([element, name, observer, useCapture]);
      element.attachEvent('on' + name, observer);
    }
  },

  unloadCache: function() {
    if (!Event.observers) return;
    for (var i = 0, length = Event.observers.length; i < length; i++) {
      Event.stopObserving.apply(this, Event.observers[i]);
      Event.observers[i][0] = null;
    }
    Event.observers = false;
  },

  __observe__: function(element, name, observer, useCapture) {
    element = $(element);
    useCapture = useCapture || false;

    if (name == 'keypress' &&
        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
        || element.attachEvent))
      name = 'keydown';

    Event._observeAndCache(element, name, observer, useCapture);
  },

  observe: function(element, name, observer, useCapture) {
    if (name == 'mousewheel') {
      var element = $(element);
      useCapture = useCapture || false;
    
      if (element.addEventListener)
        name = window.navigator.appName == 'Netscape' ? 'DOMMouseScroll' : 'mousewheel';

      var _observer = observer;
	  
      observer.__wheel_event__ = (function(event) {
        var wheel_count = event.wheelDelta?
          (event.wheelDelta > 0 ? 1 : -1) : // IE, safari
          (event.detail > 0 ? -1 : 1);    // Firefox
        _observer(element, wheel_count);
        event.preventDefault ? 
          event.preventDefault() : (event.returnValue = false);
      }).bindAsEventListener(this);
      observer = observer.__wheel_event__;
      observer.__wheel_event__ = observer;
      
	  if (navigator.appVersion.match(/Konqueror|Safari|KHTML/)) {
        // safari
        element.onmousewheel = observer;
		
      }else{
        this._observeAndCache(element, name, observer, useCapture);
      }
	  
	 
    }else{
      this.__observe__(element, name, observer, useCapture);
    }
  },
  __stopObserving__: function(element, name, observer, useCapture) {
    element = $(element);
    useCapture = useCapture || false;

    if (name == 'keypress' &&
        (navigator.appVersion.match(/Konqueror|Safari|KHTML/)
        || element.detachEvent))
      name = 'keydown';

    if (element.removeEventListener) {
      element.removeEventListener(name, observer, useCapture);
    } else if (element.detachEvent) {
      try {
        element.detachEvent('on' + name, observer);
      } catch (e) {}
    }
  },
  stopObserving: function(element, name, observer, useCapture) {
    if (name == 'mousewheel') {
      var element = $(element);
      if (navigator.appVersion.match(/Konqueror|Safari|KHTML/)) {
        // safari
        element.onmousewheel = null;
      }else{
        useCapture = useCapture || false;

        if (element.addEventListener)
          name = window.navigator.appName == 'Netscape' ? 'DOMMouseScroll' : 'mousewheel';
		  
        observer = observer.__wheel_event__;

        if (element.removeEventListener) {
          element.removeEventListener(name, observer, useCapture);
        } else if (element.detachEvent) {
          element.detachEvent('on' + name, observer);
        }
      }
    }else{
      this.__stopObserving__(element, name, observer, useCapture);
    }
  }
});

$GLOBALS.iframeLoaders = {};

window.Iframe = Class.create();
window.Iframe.prototype = {
	initialize: function(form)
	{
		this.form = form;
		this.tmr=null;
		this.uniqueId = new Date().getTime();
		$GLOBALS.iframeLoaders[this.uniqueId] = this;
		this.transport = this.getTransport();
		form.target= 'frame_'+this.uniqueId;
		form.setAttribute("target", 'frame_'+this.uniqueId); // in case the other one fails.
		form.submit();
	},
	
	onStateChange: function()
	{
		this.transport = $('frame_'+this.uniqueId);
		try {   var doc = this.transport.contentDocument.document.body.innerHTML; this.transport.contentDocument.document.close(); }	// For NS6
		catch (e){ 
			try{ var doc = this.transport.contentWindow.document.body.innerHTML; this.transport.contentWindow.document.close(); } // For IE5.5 and IE6
			 catch (e){
				 try { var doc = this.transport.document.body.innerHTML; this.transport.document.body.close(); } // for IE5
					catch (e) {
						try	{ var doc = window.frames['frame_'+this.uniqueId].document.body.innerText; window.frames['frame_'+this.uniqueId].close();} // for really nasty browsers
						catch (e) { } // forget it.
				 }
			}
		}
		this.transport.responseText = doc;
		this.onComplete();
	},
	
	onComplete: function()
	{
		return true;
	},
	
	getTransport: function() 

	{
		var divElm = document.createElement('DIV');
	    divElm.style.position = 'absolute';
        divElm.style.top = '0';
        divElm.style.marginLeft = '-10000px';
		if (navigator.userAgent.match(/MSIE/)&&!opera&&!navigator.userAgent.match(/Konquerror/)) {// switch to the crappy solution for IE
		 divElm.innerHTML = '<iframe name="frame_'+this.uniqueId+'" id="frame_'+this.uniqueId+'" src="about:blank" onload="setTimeout(function(){$GLOBALS.iframeLoaders['+this.uniqueId+'].onStateChange()},20);"></iframe>';
		} else {
			var frame = document.createElement('iframe');
			frame.setAttribute('name', 'frame_'+this.uniqueId);
			frame.setAttribute('id', 'frame_'+this.uniqueId);
			frame.addEventListener('load', 	function(){	this.onStateChange(); }.bind(this), false);
			divElm.appendChild(frame);
		}
		return document.getElementsByTagName('body').item(0).appendChild(divElm);
	}
};

window.getStyle = function(element, style)
{
    var element = $(element);
	if(!style || !element){
		return null;
	}
    var value = element.style[style.camelize()];
    if (!value) {
		if (document.defaultView && document.defaultView.getComputedStyle) {
        	var css = document.defaultView.getComputedStyle(element, null);
        	value = css ? css.getPropertyValue(style) : null;
      	} else if (element.currentStyle) {
        	value = element.currentStyle[style.camelize()];
      	}
    }
    if (opera && ['left', 'top', 'right', 'bottom'].include(style)){
		if (window.getStyle(element, 'position') == 'static') value = 'auto';
	}
    return (navigator.appVersion.match(/Konqueror|Safari|KHTML/) && !value && ((element.className=='subnavi_b') || (element.className=='subnavi_a')) && (style == 'display')) ? value = 'none' : (value == 'auto' ? null : value);
}
window.getDimensions = function(element) {
	element = $(element);
	if (window.getStyle(element, 'display') != 'none')
	  return {width: element.offsetWidth, height: element.offsetHeight};
	
	// All *Width and *Height properties give 0 on elements with display none,
	// so enable the element temporarily
	var els = element.style;
	var originalVisibility = els.visibility;
	var originalPosition = els.position;
	els.visibility = 'hidden';
	els.position = 'absolute';
	els.display = '';
	var originalWidth = element.clientWidth;
	var originalHeight = element.clientHeight;
	els.display = 'none';
	els.position = originalPosition;
	els.visibility = originalVisibility;
	return {width: originalWidth, height: originalHeight};
}
window.setOpacity = function (element, perCent)
{
	if(document.IE || document.IE7){
		element.style.filter="alpha(opacity="+ perCent +")";
	}
	else {
		perCent = perCent / 100;
		if (element.style.opacity != undefined) {
			element.style.opacity = perCent;
		}
		else if (element.style.MozOpacity != undefined) {
			element.style.MozOpacity = perCent;
		}
		else if (element.style.KhtmlOpacity != undefined){
			element.style.KhtmlOpacity = perCent;
		}
	}
}
window.isset = function(Var)
{
	return (typeof window[Var] !== 'undefined') ? true : false;
}
window.is_array = function(Var)
{
	return typeof window[Var] == ('object' || 'array') ? true : false;
}
window.is_object = function (Var){
	return typeof window[Var] == 'object' ? true : false;	
}
window.is_numeric = function (Var){
	return typeof window[Var] == 'number' ? true : false;	
}
window.is_int = function (Var)
{
	return ((is_numeric(window[Var])) && (window[Var].toString().indexOf('.') > -1)) ? false : true;
}
window.is_float = function (Var){
	return ((is_numeric(window[Var])) && (window[Var].toString().indexOf('.') > -1)) ? true : false;
}
window.empty = function(Var)
{
	return (!window[Var]||(window[Var].count()===0)) ? true : false;
}
window.show = function(element){
	$(element).style.display = '';
	return element;
}
window.hide = function(element){
	$(element).style.display = 'none';
	return element;
}
window.$$ = function(selector) {
  // Split selector in to tokens
  var IE = (document.IE || document.IE7);
  var tokens = selector.split(' ');
  var token = '';
  var currentContext = [document];
  for (var i = 0; i < tokens.length; i++) {
   	token = tokens[i].trim();
   	if (token.strstr('#')!== false) {
	  // Token is an ID selector
      var tagName = token.split('#')[0].toLowerCase();
      var element = $(token.split('#')[1]);
	  
      if (tagName && element.tagName.toLowerCase() != tagName) {
		return [];
      }
      // Set currentContext to contain just this element
      currentContext = [element];
      continue; // Skip to next token
    }
	if (token.strstr('.')!== false) {
      // Token contains a class selector
      var tagName = token.split('.')[0].toLowerCase();
      var className = token.split('.')[1];
      tagName = tagName ? tagName : '*';
	  
      // Get elements matching tag, filter them for class selector
      var found = [];
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
        var elements = $T(tagName,currentContext[h]);
        for (var j = 0; j < elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }
      currentContext = [];
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
      continue; // Skip to next token
    }
    // Code to deal with attribute selectors
    if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
      var tagName = RegExp.$1;
      var attrName = RegExp.$2;
      var attrOperator = RegExp.$3;
      var attrValue = RegExp.$4;
	  var attrName = IE && (attrName == 'class') ? 'className' : (IE && (attrName == 'for') ? 'htmlFor' : attrName);
      tagName = tagName ? tagName.toLowerCase() : '*';
	   
      // Grab all of the tagName elements within current context
      var found = [];
      var foundCount = 0;
      for (var h = 0; h < currentContext.length; h++) {
		var elements = $T(tagName,currentContext[h]);
		for (var j = 0; j < elements.length; j++) {
         if(typeof elements[j] == 'object' && elements[j].tagName)found[foundCount++] = elements[j];
        }
      }
      currentContext = [];
      var currentContextIndex = 0;
      var checkFunction; // This function will be used to filter the elements
		switch (attrOperator) {
        case '=': // Equality
          checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
          break;
        case '~': // Match one of space seperated words 
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
          break;
        case '|': // Match start with value followed by optional hyphen
          checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
          break;
        case '^': // Match starts with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
          break;
        case '$': // Match ends with value - fails with "Warning" in Opera 7
          checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
          break;
        case '*': // Match ends with value
          checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
          break;
        default :
          // Just test for existence of attribute
          checkFunction = function(e) { return e.getAttribute(attrName); };
      }
      currentContext = [];
      var currentContextIndex = 0;
      for (var k = 0; k < found.length; k++) {
        if (checkFunction(found[k])) {
          currentContext[currentContextIndex++] = found[k];
        }
      }
       //alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
      continue; // Skip to next token
    }
    // If we get here, token is JUST an element (not a class or ID selector)
    tagName = token;
    var found = [];
    var foundCount = 0;
    for (var h = 0; h < currentContext.length; h++) {
      var elements = $T(tagName,currentContext[h]);
      for (var j = 0; j < elements.length; j++) {
        found[foundCount++] = elements[j];
      }
    }
    currentContext = found;
  }
  return currentContext;
}
/* Prototype Ende */
/* -------------------- */

/* -------------------- */
/* Config */

// Config Vars , an das "$GLOBALS" Objekt angebunden, muss man nicht so machen, aber so unterscheide ich ab jetzt f�r Dich Globale Variablen 
$GLOBALS.current_sub_links = []; // aktuelle Sublinks, die gerade "abgearbeitet" werden, als Array deklariert; [] = new Array()
$GLOBALS.opened_sub_links = []; // Schon ge�ffnete Sublinks, wenn beim Laden eine Unterseite angesprochen wurde...
$GLOBALS.ctr = 0; // Der Z�hler f�r die H�he der einzelnen Links
$GLOBALS.tmr = null; // setInterval, sollte nach dem Abarbeiten immer auf null gesetzt werden, da sonst bei jeder neuen Initialisierung eine neue interval Variable daf�r besetzt wird, f�hrt irgendwann zum �berlauf
$GLOBALS.tmr2 = null;
$GLOBALS.tmr3 = null;
$GLOBALS.tmr4 = null;
$GLOBALS.tmr5 = null;
$GLOBALS.tmr6 = null;
$GLOBALS.tmr_all = null;
$GLOBALS.opened_top_link = null; // Der aktuell ge�ffnete Hauptlink
$GLOBALS.steps = 2; // F�r die bewegung der navi die Schrittfolgen in Pixel
$GLOBALS.looptime = 40; // F�r die bewegung der navi die Schrittfolgen in Milisekunden (immer 10er Schritte einhalten, alles andere wird gefaked, min. 30)
$GLOBALS.ctr3 = 0;

$GLOBALS.link_max_height = document.IE && (navigator.versionNr < 6) ? 22 : 21; // Die maximale H�he eines Links in Pixel, document.compatMode einsetzen, falls padding im li-tag

$GLOBALS.link_container_tag_name = 'div';
$GLOBALS.whole_left_content_name = 'left_content';
$GLOBALS.left_content_name = 'left_navi';
$GLOBALS.main_links_class_names = ['navi','navi_a','sign'];
$GLOBALS.sub_links_class_names = ['subnavi','subnavi_a'];

$GLOBALS.status = 'wait';
$GLOBALS.counter = 2;
$GLOBALS.link_click_return = false;
$GLOBALS.sort_direction = '';
$GLOBALS.iMarquee = NULL;
$GLOBALS.marqueeHeight=0;
$GLOBALS.marqueeTop=0;
$GLOBALS.myArr = [];
$GLOBALS.myDir = '';

$GLOBALS.infoBoxOpened = false;

$GLOBALS.dynamicInfoBox = NULL;
$GLOBALS.dynamicInfoBoxOpacity = 0;

$GLOBALS.marqueeStart = false;
$GLOBALS.naviFix = (document.IE && (navigator.versionNr==5)) ? -1 : 1;

$GLOBALS.img = NULL;
$GLOBALS.img_a = NULL;

window.setDumimage = function(width,height,left,top,zIndex){// F�r das dar�berlegen eines durchsichtigen GIFs, um die Animation nicht zu st�ren
	var Style 		= $('dimag').style;
	Style.width 	= width+'px';
	Style.height 	= height+'px';
	Style.left 		= left+'px';
	Style.top		= top+'px';
	Style.zIndex	= zIndex;
}
$GLOBALS.leftOpacity = function()
{
	window.clearTimeout($GLOBALS.tmr5);
	$GLOBALS.tmr5 = null;
	$GLOBALS.ctr3 += $GLOBALS.steps * 4;
	setOpacity(document.body, $GLOBALS.ctr3);
	if($GLOBALS.ctr3 >= 100) {
		window.clearTimeout($GLOBALS.tmr5);
		$GLOBALS.tmr5 = null;
		return;
	}
	$GLOBALS.tmr5 = window.setTimeout($GLOBALS.leftOpacity, 40);
}
window.init = function()
{
	if(window.load_img){
		$$('div.infobox')[0].className = 'infobox_testeo';
	}
	$$('img.nav_img').foreach(
		function(Value)
		{
			Value.style.width  = '202px';
			Value.style.height = '21px'; 
		}
	);
//	$GLOBALS.leftOpacity();
	if($('rss_uebersicht') && ((document.IE && (navigator.versionNr == 6)) || document.IE7)) {
		$('rss_uebersicht').style.marginBottom = '0px';
	}
	$GLOBALS.mouseWheel = (
		((document.IE || document.IE7 || navigator.appVersion.match(/Konqueror|Safari|KHTML/)) && (document.body.onmousewheel === null)) ||
		(window.opera && (navigator.versionNr >= 9)) || 
		(navigator.productSub && (navigator.productSub.substr(0,4) >= 2003))
	) ? true : false;
	var a = $$('tr.headlines a');
	a.foreach(function(Tag)
		{
			Tag.onclick = function()
			{
				return false;
			}
			Tag.parentNode.style.backgroundPosition = (Math.floor(parseFloat(Tag.firstChild.data.length)*8) / (1 + 0.04 * Tag.firstChild.data.length) + 7) + 'px';
		}
	);
	hideLinkFocus();
	hideMapFocusForIE($('Map'));
	
	if($GLOBALS.iMarquee = $('iMarquee')){
		$GLOBALS.marqueeHeight=$GLOBALS.iMarquee.firstChild.offsetHeight + 17;
		if(!((document.IE && (navigator.versionNr == 6)) || document.IE7)) {
			window.onblur = marqueeStop;
			window.onfocus = function(){
				setTimeout(function(){
				if($GLOBALS.marqueeStart === false){
					marqueeStart();
				}
			},20);}
		}
		else{
			document.onfocusout = function(){
				if($GLOBALS.marqueeStart === true) {
					marqueeStop();
				}
			}
			window.onfocus = function(){
				if($GLOBALS.marqueeStart === false) {
					marqueeStart();
				}
			}
			document.onfocusin = function()
			{
				if($GLOBALS.marqueeStart === false) {
					marqueeStart();
				}			
			}
		}
		
		marqueeStop();
		$GLOBALS.iMarquee.onmouseover=function(){
			marqueeStop();
			if(
				($GLOBALS.infoBoxOpened === false) && 
				$GLOBALS.mouseWheel 
			){
				$GLOBALS.infoBoxOpened = true;
				$GLOBALS.dynamicInfoBox = $$('div.dynamicInfoBox')[0];
				$GLOBALS.dynamicInfoBox.style.left = (Position.cumulativeOffset($GLOBALS.iMarquee)[0]+13) + 'px';
				$GLOBALS.dynamicInfoBox.style.top = (Position.cumulativeOffset($GLOBALS.iMarquee)[1]+25) + 'px';
				$GLOBALS.dynamicInfoBox.style.display = 'block';
				setOpacity($GLOBALS.dynamicInfoBox, $GLOBALS.dynamicInfoBoxOpacity);
				$GLOBALS.tmr4 = window.setInterval(
					function()
					{
						$GLOBALS.dynamicInfoBoxOpacity += 3;
						$GLOBALS.dynamicInfoBoxOpacity = $GLOBALS.dynamicInfoBoxOpacity > 100 ? 100 : $GLOBALS.dynamicInfoBoxOpacity;
						setOpacity($GLOBALS.dynamicInfoBox, $GLOBALS.dynamicInfoBoxOpacity);
						if($GLOBALS.dynamicInfoBoxOpacity == 100) {
							window.clearInterval($GLOBALS.tmr4);
							$GLOBALS.tmr4 = null;
						}
					},
					$GLOBALS.looptime
				);
				$GLOBALS.tmr3 = window.setTimeout(
				function(){
					$GLOBALS.dynamicInfoBox.style.top = '-100px';
					$GLOBALS.dynamicInfoBox.style.left = '-140px';
					$GLOBALS.dynamicInfoBox.style.display = 'none';
					window.clearTimeout($GLOBALS.tmr3);
					$GLOBALS.tmr3 = null;
					},
					5000
				);
				$GLOBALS.dynamicInfoBox.onmouseover = function ()
				{
					marqueeStop();
				}
			}
		}
		$GLOBALS.iMarquee.onmouseout=function(){
			marqueeStart();
		}
	}
	if($GLOBALS.marqueeHeight>17){
		marqueeStart();
	}

	var navi = [];
	var subnavi = [];
	
	/* alle $GLOBALS.link_container_tag_name - Tags innerhalb des Tags mit der id="$GLOBALS.left_content_name" in einer foreach schleife, um die Reihenfolge beizubehalten */
	$T($GLOBALS.link_container_tag_name, $($GLOBALS.left_content_name)).foreach(
		function(Tag)
		{
			if($GLOBALS.sub_links_class_names.in_array(Tag.className)){
				subnavi.push(Tag);
			}
			if($GLOBALS.main_links_class_names.in_array(Tag.className)){
				navi.push(Tag);
			}
		}
	);
	subnavi.foreach(
		function(Tag, Index)
		{
			if(Tag.style.display == 'block'){
				if(!$GLOBALS.opened_top_link){
					$GLOBALS.opened_top_link=Tag.previousSibling;
				}
				$GLOBALS.opened_sub_links.push(Tag);
			}
			Tag.onclick = function()
			{
				if($GLOBALS.marqueeHeight > 0) {
					marqueeStop();
				}
			}
		}
	);
	navi.foreach(
				
		function(Tag)
		{
			Tag.onclick= function() 
			{
				if($GLOBALS.link_click_return) {
					return true;
			}
				$GLOBALS.status = 'active';
				if($GLOBALS.opened_top_link==this){
					$GLOBALS.status = 'wait';
				}
				var whole_left_content = $($GLOBALS.whole_left_content_name);
				var next_link=this.nextSibling;
				if(next_link && $GLOBALS.sub_links_class_names.in_array(next_link.className)){
					navi.foreach(
						function(Value){
							if(Value.className == $GLOBALS.main_links_class_names[1] && !$GLOBALS.opened_top_link) {
								$GLOBALS.opened_top_link = Value;
							}
						}
					);
					if($GLOBALS.opened_top_link) {
						$GLOBALS.opened_top_link.className = $GLOBALS.main_links_class_names[$GLOBALS.opened_top_link == this ? 1 : 0];
						var imgs = $T('img', $GLOBALS.opened_top_link.firstChild);
						if(imgs[1] && imgs[1].className == ($GLOBALS.opened_top_link == this ? 'minus' : 'plus')) {
							imgs[0].style.display = 'none';
							imgs[1].style.display = 'block';	
						}
						else if(imgs[1]){
							imgs[1].style.display = 'none';
							imgs[0].style.display = 'block';
						}
					}
					
					$GLOBALS.opened_top_link = this;
					
					this.className = $GLOBALS.main_links_class_names[1];
					imgs = $T('img', this.firstChild);
					if(imgs[1].className == 'minus') {
						imgs[0].style.display = 'none';
						imgs[1].style.display = 'block';	
					}
					else{
						imgs[1].style.display = 'none';
						imgs[0].style.display = 'block';
					}

					$GLOBALS.current_sub_links=[];
					
					while(next_link && $GLOBALS.sub_links_class_names.in_array(next_link.className)){
						$GLOBALS.current_sub_links.push(next_link);
						next_link=next_link.nextSibling;
					}
					if($GLOBALS.current_sub_links.length > 0){
							setDumimage
							(
							 	whole_left_content.offsetWidth,
								whole_left_content.offsetHeight,
								Position.cumulativeOffset(whole_left_content)[0],
								Position.cumulativeOffset(whole_left_content)[1],
								10
							);
						$GLOBALS.tmr=window.setInterval(handleMenu,$GLOBALS.looptime);
					}
					if(!$GLOBALS.link_click_return) {
						$('home').className = 'home';
					}
					if($GLOBALS.link_click_return == true) {
						if($GLOBALS.marqueeHeight > 0) {
							marqueeStop();
						}
					}
					return $GLOBALS.link_click_return;
				}
				return true;
			}
		}
	);
	if($($GLOBALS.left_content_name)){
		Event.observe($($GLOBALS.left_content_name), 'mousedown', function(event) {
			var element = Event.element(event);
			if($GLOBALS.main_links_class_names[0] == element.parentNode.className || $GLOBALS.main_links_class_names[1] == element.parentNode.className){
				if($GLOBALS.marqueeHeight > 0) {
					marqueeStop();
				}
				$GLOBALS.link_click_return = true;
			}
			else if($GLOBALS.main_links_class_names[2] == element.parentNode.className && element.parentNode.childNodes.length == 2) {
				var sign = element.parentNode;
					$GLOBALS.link_click_return = false;
				}
				else{
				window.clearInterval($GLOBALS.tmr);
				$GLOBALS.tmr = null;
				$GLOBALS.link_click_return = false;
				}
		});
	}
	var tab = $T('table');
	for (var x=0;x<tab.length;x++){
		if(tab[x].id.indexOf('listTable')>-1){
			document.myArr = [];
			var tr = $T('tr',tab[x]);
			var trLen = tr[0].childNodes.length;
			
			if((trLen > 1) && tr[0].childNodes[1].id == 'aufloes'){
				tr[0].childNodes[1].onclick = function()
				{
					txtfunc(this, 1, 'aufloes');
				}
			}
			if((trLen > 1) && tr[0].childNodes[1].id == 'aufloesng'){
				tr[0].childNodes[1].onclick = function()
				{
					txtfunc(this, 1, 'aufloesng', 3);
				}
			}
			if((trLen > 1) && tr[0].childNodes[1].id == 'modell'){
				tr[0].childNodes[1].onclick = function()
				{
					txtfunc(this, 1, 'modell');
				}
			}
			if((trLen > 2) && tr[0].childNodes[2].id == 'modell'){
				tr[0].childNodes[2].onclick = function()
				{
					txtfunc(this, 2, 'modell');
				}
			}
			if((trLen > 3) && tr[0].childNodes[3].id == 'kg'){
				tr[0].childNodes[3].onclick = function()
				{
					txtfunc(this, 3, 'kg', 1);
				}
			}
			if((trLen > 4) && tr[0].childNodes[4].id == 'ansi'){
				tr[0].childNodes[4].onclick = function()
				{
					txtfunc(this, 4, 'ansi', 1);
				}
			}
			if((trLen > 4) && tr[0].childNodes[4].id == 'dichte'){
				tr[0].childNodes[4].onclick = function()
				{
					txtfunc(this, 4, 'dichte', 4);
				}
			}
			if((trLen > 5) && tr[0].childNodes[5].id == 'technik'){
				tr[0].childNodes[5].onclick = function()
				{
					txtfunc(this, 5, 'technik');
				}
			}
			if((trLen > 5) && tr[0].childNodes[5].id == 'masse'){
				tr[0].childNodes[5].onclick = function()
				{
					txtfunc(this, 5, 'masse', 2);
				}
			}
			if((trLen > 6) && tr[0].childNodes[6].id == 'masse'){
				tr[0].childNodes[6].onclick = function()
				{
					txtfunc(this, 6, 'masse', 2);
				}
			}
			if((trLen > 7) && tr[0].childNodes[7].id == 'tsche'){
				tr[0].childNodes[7].onclick = function()
				{
					txtfunc(this, 7, 'tsche');
				}
			}
		}
	}
	if(
		$GLOBALS.iMarquee && 
		$GLOBALS.mouseWheel
	){
		Event.observe($GLOBALS.iMarquee, 'mousewheel', function(element, wheel_count) {
			marqueeStop();
			var diff = wheel_count > 0 ? -30 : 30;
			element.firstChild.style.top=(
				($GLOBALS.marqueeTop >= ($GLOBALS.marqueeHeight/-2) && ($GLOBALS.marqueeTop <= 0))?($GLOBALS.marqueeTop-=diff):((($GLOBALS.marqueeTop-diff) <= 0)?($GLOBALS.marqueeTop=0):$GLOBALS.marqueeTop=($GLOBALS.marqueeHeight/-2))
			)+'px';
			if($GLOBALS.tmr3 != null) {
				$GLOBALS.dynamicInfoBox.style.top = '-100px';
				$GLOBALS.dynamicInfoBox.style.left = '-140px';
				$GLOBALS.dynamicInfoBox.style.display = 'none';
				window.clearTimeout($GLOBALS.tmr3);
				$GLOBALS.tmr3 = null;
			}
		},
		true
		);
	}
	if(
		$$('div.produkte')[0] && 
		$GLOBALS.mouseWheel
	){
		$$('div.produkte').foreach(
			function(Value)
			{
				if(
					getDimensions(Value).height > getDimensions(Value.parentNode).height + 4
				) {
					Event.observe(Value.parentNode, 'mousewheel', function(element, wheel_count) {
						var diff = wheel_count > 0 ? 16 : -16;
						var heightDiff = getDimensions(element).height - getDimensions(element.firstChild).height + 2;
						var top = element.firstChild.style.top ? parseFloat(element.firstChild.style.top) : 0;
						element.firstChild.style.top=(
							((top + diff) <= heightDiff) ? heightDiff : (((top + diff) >= 0) ? 0 : (top += diff))
						)+'px';
					},
					true
					);
				}
			}
		);
	}
	else {
		$$('div.teaser').foreach(
			function(Value)
			{
				if(getDimensions(Value.firstChild).height > getDimensions(Value).height + 4) {
					Value.style.overflow = 'auto';
					Value.style.overflowY = '';
				}
			}
		);
	}
}
window.handleMenu=function()
{
	if($GLOBALS.ctr==$GLOBALS.link_max_height){
		if(!(document.IE && (navigator.versionNr < 6))) {
			$GLOBALS.current_sub_links.foreach(
				function(Tag)
				{
					Tag.style.borderTop = '1px solid #fff';
				}
			);
			if($GLOBALS.opened_sub_links){
				$GLOBALS.opened_sub_links.foreach(
					function(Tag)
					{
						Tag.style.display = 'none';
					}
				);
			}
		}
		window.clearInterval($GLOBALS.tmr);
		$GLOBALS.tmr=null;
		$GLOBALS.ctr=0;
		if($GLOBALS.status == 'wait'){
			$($GLOBALS.opened_top_link).className = $GLOBALS.main_links_class_names[0];
			var imgs = $T('img', $($GLOBALS.opened_top_link).firstChild);
			if(imgs[1].className == 'plus') {
				imgs[0].style.display = 'none';
				imgs[1].style.display = 'block';	
			}
			else{
				imgs[1].style.display = 'none';
				imgs[0].style.display = 'block';
			}
			$GLOBALS.opened_top_link = null;
			$GLOBALS.current_sub_links = [];
		}
		$GLOBALS.opened_sub_links = $GLOBALS.current_sub_links;

		setDumimage(1,1,0,0,-1);
		if($GLOBALS.marqueeHeight > 0) {
			marqueeStart();
		}
		return;
	}
	else if($GLOBALS.marqueeHeight > 0) {
		marqueeStop();
	}
	var nextHeight = $GLOBALS.ctr+$GLOBALS.steps;
	$GLOBALS.ctr = (nextHeight >= $GLOBALS.link_max_height) ? $GLOBALS.link_max_height : nextHeight;
	
	$GLOBALS.current_sub_links.foreach(
		function(Tag)
		{
			Tag.style.height = $GLOBALS.ctr+'px';
		}
	);
	
	if($GLOBALS.ctr == $GLOBALS.steps){
		$GLOBALS.current_sub_links.foreach(
			function(Tag)
			{
				if(!(document.IE && (navigator.versionNr < 6))) {
					Tag.style.borderTop = 'none';
				}
				Tag.style.display = 'block';
			}
		);
	}
	
	$GLOBALS.downHeight = $GLOBALS.link_max_height-$GLOBALS.ctr;
	
	if($GLOBALS.opened_sub_links){
		if($GLOBALS.downHeight > 0){
			$GLOBALS.opened_sub_links.foreach(
				function(Tag)
				{
					Tag.style.height = $GLOBALS.downHeight + 'px';
				}
			);
		}
		else {
			$GLOBALS.opened_sub_links.foreach(
				function(Tag)
				{
					if(!(document.IE && (navigator.versionNr < 6))) {
						Tag.style.height = $GLOBALS.downHeight + 'px';
					}
					else {
						Tag.style.display = 'none';
					}
				}
			);
		}
	}
}
window.hideLinkFocus = function(Parent)
{
	var a=$T('a', Parent);
	var params = '';
	var q = 0;
	for(var i=0;i<a.length;i++){
		if(document.IE || document.IE7){// http://www.tomislav.net/gestrichelte-linie-um-link-verstecken.htm
			a[i].onmousedown=function(){this.onfocus=function(){this.blur();}}
			a[i].onmouseout=function(){this.onfocus=function(){}}
			a[i].onmouseup=a[i].onmouseout;
		}
		else {
			a[i].onmousedown=function(){return false;}
		}
		if((a[i].href.indexOf('/mail@beamer.htm') > -1) && (a[i].href.indexOf('buddy') == -1)){
			params = a[i].href.substr(a[i].href.indexOf('/mail@beamer.htm')).replace(/\/mail\@beamer\.htm/,'');
			a[i].href= 'mailto:info@lcdmedia.de' + unescape(params);
			a[i].innerHTML = ((a[i].innerHTML == 'mail@beamer.htm') ? ('info@lcdmedia.de') : (a[i].innerHTML));
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				if((a[i].innerHTML.length - q)>1){
					a[i].innerHTML = a[i].innerHTML.substr(0,q);
				}
			}
		}
		else if((a[i].href.indexOf('/mail@beamer.htm') > -1) && (a[i].href.indexOf('buddy') > -1)){
			var buddie = '';
			params = a[i].href.substr(a[i].href.indexOf('/mail@beamer.htm')).replace(/\/mail\@beamer\.htm/,'');
			params = unescape(params);
			if(params.indexOf('buddy2') > -1){
				buddie = params.substr(params.indexOf('buddy2')).replace(/buddy2\=/,'');
				a[i].href= 'mailto:' + buddie + '@lcdmedia.de' + params.replace('&buddy2=' + buddie,'').replace('?buddy2=' + buddie,'');
			}
			else if (params.indexOf('buddy') > -1){
				buddie = params.substr(params.indexOf('buddy')).replace(/buddy\=/,'');
				a[i].href= 'mailto:' + buddie + '@beamer.de' + params.replace('&buddy=' + buddie,'').replace('?buddy=' + buddie,'');
			}
			a[i].innerHTML = ((a[i].innerHTML == 'mail@beamer.htm') ? ('info@lcdmedia.de') : (a[i].innerHTML));
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				if((a[i].innerHTML.length - q)>1){
					a[i].innerHTML = a[i].innerHTML.substr(0,q);
				}
			}
		}
		else if((a[i].href.indexOf('/mail@heimkino.htm') > -1) && (a[i].href.indexOf('buddy') == -1)){
			params = a[i].href.substr(a[i].href.indexOf('/mail@heimkino.htm')).replace(/\/mail\@heimkino\.htm/,'');
			a[i].href= 'mailto:info@lcdmedia.de' + unescape(params);
			a[i].innerHTML = ((a[i].innerHTML == 'mail@heimkino.htm') ? ('info@heimkino.net') : (a[i].innerHTML));
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				if((a[i].innerHTML.length - q)>1){
					a[i].innerHTML = a[i].innerHTML.substr(0,q);
				}
			}
		}
		else if((a[i].href.indexOf('/mail@heimkino.htm') > -1) && (a[i].href.indexOf('buddy') > -1)){
			var buddie = '';
			params = a[i].href.substr(a[i].href.indexOf('/mail@heimkino.htm')).replace(/\/mail\@heimkino\.htm/,'');
			params = unescape(params);
			if(params.indexOf('buddy2') > -1){
				buddie = params.substr(params.indexOf('buddy2')).replace(/buddy2\=/,'');
				a[i].href= 'mailto:' + buddie + '@lcdmedia.de' + params.replace('&buddy2=' + buddie,'').replace('?buddy2=' + buddie,'');
			}
			else if (params.indexOf('buddy') > -1){
				buddie = params.substr(params.indexOf('buddy')).replace(/buddy\=/,'');
				a[i].href= 'mailto:' + buddie + '@heimkino.net' + params.replace('&buddy=' + buddie,'').replace('?buddy=' + buddie,'');
			}
			a[i].innerHTML = ((a[i].innerHTML == 'mail@heimkino.htm') ? ('info@heimkino.net') : (a[i].innerHTML));
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				if((a[i].innerHTML.length - q)>1){
					a[i].innerHTML = a[i].innerHTML.substr(0,q);
				}
			}
		}
		else if(a[i].href.indexOf('/errormail@beamer.htm')>-1){
			params = a[i].href.substr(a[i].href.indexOf('/errormail@beamer.htm')).replace(/\/errormail\@beamer\.htm/,'');
			a[i].href= 'mailto:beamererror@tomislav.net' + unescape(params);
			a[i].innerHTML = 'webmaster@lcdmedia.de';
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				a[i].innerHTML = a[i].innerHTML.substr(0,q);
			}
		}
		else if((a[i].href.indexOf('ueberuns/feedback.asp')>-1) && (a[i].innerHTML == 'mail@beamer.htm')){
			a[i].innerHTML = 'info@lcdmedia.de';
			if(a[i].innerHTML.indexOf('mailto:')>-1){
				a[i].innerHTML = a[i].innerHTML.replace(/mailto\:/,'');
			}
			if((q=a[i].innerHTML.indexOf('?')) > -1){
				a[i].innerHTML = a[i].innerHTML.substr(0,q);
			}
		}
		if(a[i].innerHTML == 'beamer@lcdmedia.htm' && (buddie != '')){
			a[i].innerHTML = buddie + '@lcdmedia.de';	
		}
		else if(a[i].innerHTML == 'beamer@beamer.htm' && (buddie != '')){
			a[i].innerHTML = buddie + '@beamer.de';	
		}
	}	
}
window.hideMapFocusForIE = function (Parent)
{
	if(!document.IE) return;
	var a = $T('area', Parent);
	for(var i=0;i<a.length;i++){
		a[i].onmousedown=function(){this.onfocus=function(){this.blur();}}
		a[i].onmouseout=function(){this.onfocus=function(){}}
		a[i].onmouseup=a[i].onmouseout;
	};
}
window.txtfunc = function(Obj, Nr, Id, Num, Only)
{
	while(Obj.parentNode.tagName.toLowerCase() != 'table'){
		Obj = Obj.parentNode;
	}
	
	Obj = Obj.parentNode;
	
	var tbr = $T('tr',Obj);
	var obj = $GLOBALS.sort_direction.replace(/desc/,'').replace(/asc/,'');
	if($(obj)){
		$(obj).style.backgroundImage='url(/img/dummy.gif)';
	}
	$(Id).style.backgroundImage='url(/img/' + (($GLOBALS.sort_direction == Id + 'asc')?'a':'de') + 'sc.gif)';
	if(Only!=1){
		var td = null;
		var line = '';
		var innerHTM = '';
		var tds = [];
		for(var i = 2;i < tbr.length; i++){
			td = $T('td',tbr[i]);
			innerHTM = '';
			for(var x = 0;x < td.length;x++){
				innerHTM += td[x].innerHTML + '~*+~#';
			}
			var rowfill = '';
			if(Id == 'modell')rowfill = td[Nr].firstChild.firstChild.firstChild.innerHTML + '~*+~#' + innerHTM;
			else if(Id == 'aufloes') rowfill = td[Nr].childNodes[1].firstChild.innerHTML + '~*+~#' + innerHTM;
			else rowfill = td[Nr].firstChild.firstChild.innerHTML.replace(/\,/,'') + '~*+~#' + innerHTM;
			document.myArr = document.myArr.concat([rowfill]);
		}
		
		if(Num == 1){
			document.myArr.sort($GLOBALS.Numsort);
		}
		else if(Num == 2){
			document.myArr.sort($GLOBALS.Numsort2);
		}
		else if(Num == 3){
			document.myArr.sort($GLOBALS.Numsort3);
		}
		else if(Num == 4){
			document.myArr.sort($GLOBALS.Numsort4);
		}
		else{
			document.myArr.sort();
		}
		if($GLOBALS.sort_direction == Id + 'asc'){
			document.myArr.reverse();
		}
		for(i = 0;i < document.myArr.length;i++){
			line = document.myArr[i];
			tds = line.split('~*+~#');
			td = $T('td',tbr[i + 2]);
			for (x=0;x<tds.length - 2;x++){
				td[x].innerHTML = tds[x + 1];
			}
		}
	}
	document.myArr = [];
	if($GLOBALS.sort_direction != Id + 'asc'){
		$GLOBALS.sort_direction = Id + 'asc';
	}
	else{
		$GLOBALS.sort_direction = Id + 'desc';
	}
	hideLinkFocus(Obj);
}
$GLOBALS.Numsort = function(a, b) {
  return a.substring(0,a.indexOf('~*+~#')) - b.substring(0,b.indexOf('~*+~#'));
}
$GLOBALS.Numsort2 = function(a, b) {
  var tmpa = a.substring(0,a.indexOf('~*+~#'));
  tmpa = tmpa.split('x');
  a = tmpa[0] * tmpa[1] * tmpa[2];
  var tmpb = b.substring(0,b.indexOf('~*+~#'));
  tmpb = tmpb.split('x');
  b = tmpb[0] * tmpb[1] * tmpb[2];
  return a  - b;
}
$GLOBALS.Numsort3 = function(a, b) {
  var tmpa = a.substring(0,a.indexOf('~*+~#'));
  tmpa = tmpa.split(' x ');
  a = tmpa[0] * tmpa[1];
  var tmpb = b.substring(0,b.indexOf('~*+~#'));
  tmpb = tmpb.split(' x ');
  b = tmpb[0] * tmpb[1];
  return a  - b;
}
$GLOBALS.Numsort4 = function(a, b) {
  var tmpa = a.substring(0,a.indexOf('~*+~#'));
  a = parseFloat(tmpa);
  var tmpb = b.substring(0,b.indexOf('~*+~#'));
  b =  parseFloat(tmpb);
  return a  - b;
}
$GLOBALS.H1 = '';
$GLOBALS.STOP = false;
window.truncate = function(Obj, Chars, Ext)
{
	$A(Obj.firstChild.data.split(' ')).foreach(
		function(Value)
	{
			if(!$GLOBALS.STOP && ($GLOBALS.H1.length + Value.length + 1) <= Chars){
				$GLOBALS.H1 += (' ' + Value);
	}
			else{
				$GLOBALS.STOP = true;	
				}
	}
	);
	Obj.firstChild.data = $GLOBALS.H1 + ($GLOBALS.STOP ? Ext : '');
}
// Den ganzen dreck rausgenommen, ist trotzdem voll funktionst�chtig
window.marqueeStart = function()
{
	stopLoopTimer();
	$GLOBALS.marqueeStart = true;
	if(empty($GLOBALS.tmr_all)){
		startLoopTimer();
	}
}
window.marqueeStop = function()
{
	$GLOBALS.marqueeStart = false;
	stopLoopTimer();
}
window.startLoopTimer = function()
{
	$GLOBALS.tmr_all = window.setInterval(
		function()
		{
			if($GLOBALS.marqueeStart)
			{
				$GLOBALS.iMarquee.firstChild.style.top=(
					(-$GLOBALS.marqueeTop < ($GLOBALS.marqueeHeight/2))?($GLOBALS.marqueeTop-=1):($GLOBALS.marqueeTop=0)
				)+'px'
			}
			
		},
		$GLOBALS.looptime
	);
}
window.stopLoopTimer = function()
{
	if(empty($GLOBALS.marqueeStart)) {
		window.clearInterval($GLOBALS.tmr_all);
		$GLOBALS.tmr_all = null;
	}
}
window.onload = window.init;