function loadComplete(l){
	lang = l;
	onresize();
	parseExternalLinks();
	if(document.getElementById('produktmenu')){
		parse_produkte();
	}
	if(document.getElementById('submenu')){
		for(i=0;i<document.getElementById('submenu').getElementsByTagName('li').length;i++){
			document.getElementById('submenu').getElementsByTagName('li')[i].onmouseover = function(){
				this.className += " hover";
			}
			document.getElementById('submenu').getElementsByTagName('li')[i].onmouseout = function(){
				this.className = this.className.split("hover").join("");
			}
		}
	}
}
parse_produkte = function(){
	for(i=0;i<document.getElementById('produktmenu').getElementsByTagName('a').length;i++){
		document.getElementById('produktmenu').getElementsByTagName('a')[i].onmouseover = function(){
			document.getElementById("sm_"+this.id.substr(3,this.id.length-3)).className = "hover";
		}
		document.getElementById('produktmenu').getElementsByTagName('a')[i].onmouseout = function(){
			document.getElementById("sm_"+this.id.substr(3,this.id.length-3)).className = "";
		}
	}
	for(i=0;i<document.getElementById('submenu').getElementsByTagName('a').length;i++){
		document.getElementById('submenu').getElementsByTagName('a')[i].onmouseover = function(){
			document.getElementById("pm_"+this.id.substr(3,this.id.length-3)).className = "hover";
			document.getElementById("produktmenu").className = "hover";
		}
		document.getElementById('submenu').getElementsByTagName('a')[i].onmouseout = function(){
			document.getElementById("pm_"+this.id.substr(3,this.id.length-3)).className = "";
			document.getElementById("produktmenu").className = "";
		}
	}
}
onresize = function(){
	if(lang){
		document.getElementsByTagName('div')[0].style.paddingTop = "0";
		if(document.documentElement.clientHeight && document.all){
			if((document.documentElement.clientHeight-515)/2>0){
				document.body.style.paddingTop = ((document.documentElement.clientHeight-515)/2) + "px";
			}
			else{
				document.body.style.paddingTop = "0";
			}
		}
		else{
			if((window.innerHeight-515)/2>0){
				document.body.style.paddingTop = ((window.innerHeight-515)/2) + "px";
			}
			else{
				document.body.style.paddingTop = "0";
			}
		}
	} 
}
/*/////////////////////////////////////////////////////////////////////////////////
                                       popup
	öffnet ein neuse Fenster,
	obj = Link der das Fenster öffnet
	w = Breite des Fensters
	h = Höhe des Fensters
/////////////////////////////////////////////////////////////////////////////////*/
/**
 * @projectDescription öffnet ein neues Browserfenster falls möglich, ansonsten wird die url des Links direkt aufgerufen.
 * @param {LinkObject} obj
 * @param {Breite} w
 * @param {Hoehe} h
 * @return {Boolean}
 */

function popup(obj,w,h) {
	var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
	if (!url) return true;
	if(w && h){
		var args = 'width='+w+',height='+h+',resizable=yes';
	}
	else{
		var args = 'resizable=yes,hotkeys=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes';
	}
	pop = window.open(url,'',args);
	return (pop) ? false : true;
}

/*/////////////////////////////////////////////////////////////////////////////////
                                 parseExternalLinks
	öffnet Links mit target="_blank" oder rel="external" in einem neuen Fenster
/////////////////////////////////////////////////////////////////////////////////*/
/**
 * @projectDescription öffnet Links mit target="_blank" oder rel="external" in einem neuen Fenster (sollte in der loadComplete-Funktion aufgerufen werden)
 */
function parseExternalLinks(){
	for(i=0; i<document.getElementsByTagName("a").length; i++){
		zwobj = document.getElementsByTagName("a")[i];
		if((zwobj.getAttribute) ? zwobj.getAttribute('rel') == "external" : zwobj.rel == "external"){
			zwobj.onclick = function(){
				return popup(this);	
			}
		}
		else if((zwobj.getAttribute) ? zwobj.getAttribute('target') : zwobj.target == "_blank"){
			zwobj.onclick = function(){
				return popup(this);
			}
			zwobj.target="";
		}
	}
}

function getCurrentStyle(obj, prop){  // Gibt den Wert des abgefragten CSS-Wertes zurück
	if(document.defaultView && document.defaultView.getComputedStyle){
		if(document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop)){
			return document.defaultView.getComputedStyle(obj,"").getPropertyValue(prop);
		}
		return "";
	}
	else if(obj.currentStyle){
		if(obj.currentStyle.getAttribute(prop.replace(/\-/g, ""))){
			return obj.currentStyle.getAttribute(prop.replace(/\-/g, ""));
		}
		return "";
	}
	else if(window.getComputedStyle){
		if(window.getComputedStyle(obj,"").getPropertyValue(prop)){
			return window.getComputedStyle(obj,"").getPropertyValue(prop);
		}
		return "";
	}
	else{
		if(obj.style.getAttribute(prop.replace(/\-/g, ""))){
			return obj.style.getAttribute(prop.replace(/\-/g, ""));
		}
		return "";
	}
}

function animate(objekt,eigenschaft,pref,von,bis,dauer,beschl,offset,komma){
	if(offset>0){
		window.setTimeout(function(objekt,eigenschaft,pref,von,bis,dauer,beschl,offset,komma) { return function() { animate(objekt,eigenschaft,pref,von,bis,dauer,beschl,offset,komma) } } (objekt,eigenschaft,pref,von,bis,dauer,beschl,0,komma), offset*1000);
		return true;
	}
	steps = Math.round(dauer*50);
	speed=((bis-von)/steps)-(((bis-von)/steps)*(beschl/100));
	rechwert = von;
	if(objekt.anitimeout){
		for(i=0;i<objekt.anitimeout.length;i++){		
			window.clearTimeout(objekt.anitimeout[i]);
		}
	}
	objekt.anitimeout = new Array();
	for(step=0;step<steps;step++){
		rechwert+=speed;
		speed+=((((bis-von)/steps)+(((bis-von)/steps)*(beschl/100)))-(((bis-von)/steps)-(((bis-von)/steps)*(beschl/100))))/(steps-1);
		wert=rechwert;
		if(step==steps-1){wert=bis;}
		if(!komma){wert=Math.round(wert);}
		objekt.anitimeout[step] = window.setTimeout(function(objekt,eigenschaft,pref,wert) { return function() { eval('objekt.'+eigenschaft+' = "' + wert + pref + '";'); } } (objekt,eigenschaft,pref,wert), (20*step));
	}
	return true;
}
