

Event.observe(window, 'load', function() {    
	var sections1 = document.getElementsByClassName('inline_focus');	
	var e = 0;
    for(e=0;e<sections1.length;e++){
    	sections1[e].onclick=function() { this.className="textfeld";this.value=""; }
    }
	var sections2 = document.getElementsByClassName('inline_focus_text');
	var e = 0;
    for(e=0;e<sections2.length;e++){
    	sections2[e].onclick=function() { this.className="textfeld";this.value=""; }
    }
	var sections3 = document.getElementsByClassName('inline_focus-textfeld-klein');
	var e = 0;
    for(e=0;e<sections3.length;e++){
    	sections3[e].onclick=function() { this.className="textfeld-klein";this.value=""; }
    }	
});

function getCookie(name){
	var n = new RegExp(name+"="), _val="";
	if(n.test(document.cookie)){ _val=document.cookie.split(name+"=")[1].substring(0, document.cookie.split(name+"=")[1].indexOf(";")); }
	return unescape(_val);
}

function setCookie(name, value){
	document.cookie=name+"="+value;
}

function media_flash(){
	// default Parameter
	var width="100%", height="100%", version="8", background="#ffffff", _id="", _n=new Array(), params=null, alt="", _aP=new Array();
	for(i=0;i<12;i++){	_id+=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","-","1","2","3"][Math.ceil(Math.random()*30)];	}

	args=media_flash.arguments;
	switch(args.length){
		case 5:
			params=args[4];
		case 4:
			height=args[3];
		case 3:
			width=args[2];
		case 2:
			alt=(args[1].indexOf("HTML:")==0)?decodeURIComponent(args[1].substr(5)):args[1];
		default:
			name=(args[0].toLowerCase().lastIndexOf(".swf")+1)?args[0].substring(0,args[0].toLowerCase().lastIndexOf(".swf")):args[0];
			break;
	}
	if(params!=null){
		_p=params.split(",");
		for(var i=0;i<_p.length;i++){
			_split=_p[i].replace(/[\s]/g, "").split(":");
			if(_split[0]=="background"){	background=_split[1];	}
			//if(_split[0]=="wmode"){	_aP[_aP.length]=new Array(_split[0],_split[1]);	}
			if(_split[0]=="version"){ version=_split[1]; }
			else{	_n[_n.length]=_split[0]+", "+_split[1];_aP[_aP.length]=new Array(_split[0],_split[1]);	}
		}
	}
	document.write('<div id="'+_id+'">'+alt+'</div>');
	if(typeof(SWFObject)!="function"){return;} //ab hier abhaengig von SWFObject.js!!!

	var so = new SWFObject(name+".swf",_id,width,height,version,background);
	for(var i=0;i<_n.length;i++){	so.addVariable(_n[i]);		}
	for(var i=0;i<_aP.length;i++){	so.addParam(_aP[i][0],_aP[i][1]);	}
	so.write(_id);
}

function tabbox(arg1,arg2) {
	if($(arg1))$(arg1).className = "active";
	if($(arg1+"_link"))$(arg1+"_link").className = "active";
	if($(arg2))$(arg2).className = "";
	if($(arg2+"_link"))$(arg2+"_link").className = "";
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function popup(ort,x,y) {
	win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width='+x+',height='+y);
	win.focus();
}

function popupNoScroll(ort,x,y) {
	win = window.open(ort, 'Fenster','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+x+',height='+y);
	win.focus();
}

function winopen(url, w, h) {
	if (typeof w=="undefined"){w=640;}
	if (typeof h=="undefined"){h=480;}
 	if (navigator.userAgent.indexOf("Mac") != -1) {
  		newwindow = window.open(url,'viewer_win','directories=0,location=1,menubar=1,scrollbars=1,status=0,toolbar=1,resizable=1,width='+w+',height='+h+',screenx=0,screeny=0');
  		if(navigator.appName == "Netscape" && parseInt(navigator.appVersion.substring(0,1)) >= 3) {
  			newwindow.focus()
  		}
 	} else {
  		newurl = url;
  		newwindow = window.open(newurl,'viewer_win','directories=0,location=1,menubar=1,scrollbars=1,status=0,toolbar=1,resizable=1,width='+w+',height='+h+',screenx=0,screeny=0');
  		newwindow.focus();
 	}
}

function openTab(tab) {
	if (tab < 1 || tab > 3) {
		tab = 1;
	}
	for (i=1; i<4; i++) {
		if (i == tab) {
			if (document.getElementById("start_tab_" + i)) {
				document.getElementById("start_tab_" + i).style.display = "block";
			}
		} else {
			if (document.getElementById("start_tab_" + i)) {
				document.getElementById("start_tab_" + i).style.display = "none";
			}
		}
	}
}

function openFilm() {
	if (document.getElementById("film")) {
		document.getElementById("film").style.display = "inline";
	}
}
function closeFilm() {
	if (document.getElementById("film")) {
		document.getElementById("film").style.display = "none";
		window.location.reload();
	}
}

function insert(inhalt) {
	if (inhalt == "") {
		document.auswahl.reset();
		return;
	} else {
		location.href = inhalt;
		document.auswahl.reset();
	}
}

function go() {
	box = document.lex.navi;
	destination = box.options[box.selectedIndex].value;
	if (destination) {
		location.href = destination;
	}
}
