var fenster;

function mopen(o){
	var obj=document.getElementById(o);
	obj.style.display='block';
}
function mclose(o){
	var obj=document.getElementById(o);
	obj.style.display='none';
}


function getNews(h1, h2)
{
	var i;
	var hm="<br><br><br><table>";
	var old =    document.body.innerHTML;
	for (i=0; i<news.length; i++) hm +="<tr><th>" + news[i].dat + "</th><td>" + news[i].text + "</td></tr>";
	hm+="</table>";
	document.body.innerHTML=old+hm;
	setCaption(h1,h2);
}

function getRefs(h1, h2, b, h3)
{
	var i;
	var hm="<br><br><br><table>";
	var old =    document.body.innerHTML;
	for (i=0; i<refs.length; i++) 
	{
		hm +="<tr><th>&nbsp;</th><th>" + refs[i].text + "</th>" +"<th>" + refs[i].beschr + "</th><th>"+
		"<a href='"+refs[i].url+"'>" +"<img src='" + refs[i].bild + "' border=0>" +"</a>"+"</th></tr>";
	}
	hm+="</table>";
	document.body.innerHTML=old+hm;
	setCaption(h1,h2);
}

var leer="                                                                                                                                                                                                                                                          ";
var pos=0;
var t=0;

function Status_anzeige()
{
	var x=leer+stat[t].text;
	window.status=x.substring(pos);
	pos++; if (pos> x.length) {pos=0; t++;}
	if ( t>= stat.length) t=0;

	window.setTimeout('Status_anzeige()',50);
}

function Header(hl1, hl2)
{
	this.lhl1=hl1;
	this.lhl2=hl2;
//	var f=parent.frames['Head'].document.getElementById('HeadLine_1');
	var f=document.getElementById('HeadLine_1');
//	if (f==null) {window.setTimeout('Header(lhl1, lhl2)',50); return;}
	if (f== null) return;
	
	f.firstChild.nodeValue = hl1;
//	var f=parent.frames['Head'].document.getElementById('HeadLine_2');
	var f=document.getElementById('HeadLine_2');
	f.firstChild.nodeValue = hl2;
//	window.clearInterval(o1);
//	window.clearTimeout(o1);

}

function setCaption(hl1, hl2)
{
	var text = document.URL;
	var suche = text.lastIndexOf("/");
//	parent.document.title='....'+text.substr(suche);
	parent.Header(hl1, hl2);
}


function openWin()
{

	lektion=window.open('../aufgegabelt/start.htm','_blanc','width=780,height=560,resizable=no,scrollbars=no,toolbar=no,status=no,directories=no,menubar=no,location=no,dependent=yes');
}

function startFenster(url)
{
fenster=window.open(url,'fenster','width=420 height=300 resizable=no scrollbars=no toolbar=no status=no directories=no menubar=no location=no');
}

//function Fenster(url)
//{}


function Fenster(url)
{

	if (fenster==null) {startFenster(url); return;}
	if (fenster.closed==true) {startFenster(url);  return;}
	else 
	{
		fenster.focus(); 
		startFenster(url);
		return;
	}
}

function Fenster_zu()
{
	if (fenster!=null) fenster.close();
}

function neuAufbau () 
{
    function Fensterweite () {
	if (window.innerWidth) {return window.innerWidth;} 
	else if (document.body && document.body.offsetWidth) {return document.body.offsetWidth;} 
	else {return 0;}
    }

    function Fensterhoehe () {
	if (window.innerHeight) {return window.innerHeight;} 
	else if (document.body && document.body.offsetHeight) {return document.body.offsetHeight;} 
	else {return 0;}
    }
    var obj = document.getElementById("MainWin").style;
    var Weite = (Fensterweite()-parseInt(obj.width))/2;
    var Hoehe = (Fensterhoehe()-parseInt(obj.height))/2;
    if (Weite<0) Weite=0;
    if (Hoehe<0) Hoehe=0;
    obj.top=Hoehe;
    obj.left=Weite;
}
