
/* Globale Einstellungen */

var scriptname = 'hp.cgi';

/* Funktionen für fr_inhalt */

function fr_inhalt_titel_aktualisieren() {
	if ( document.title != top.document.title ) { top.document.title = document.title }
	setTimeout("fr_inhalt_titel_aktualisieren()",1000);
}

/* Funktionen für fr_oben */

var fr_oben_ystart = 10;
var fr_oben_yende  = 608;
var fr_oben_breite = 0;
var fr_oben_pos    = 0;
var fr_oben_v      = 0.5;
var fr_oben_warten = 0;
var fr_oben_r      = -1;
function fr_oben_scroll_init() {
	fr_oben_breite = document.getElementById("text").offsetWidth;
	fr_oben_pos = fr_oben_yende + fr_oben_v;
	fr_oben_scroll();
}
function fr_oben_scroll() {
	if ( fr_oben_warten > 0 ) { fr_oben_warten = fr_oben_warten - 1 }
	else {
		fr_oben_pos = fr_oben_pos + fr_oben_v*fr_oben_r; /* - */
		/* if ( fr_oben_pos < fr_oben_ystart - fr_oben_breite ) { fr_oben_pos = fr_oben_yende } */
		if ( ( fr_oben_r < 0 && fr_oben_pos < fr_oben_yende - fr_oben_breite ) || ( fr_oben_r > 0 && fr_oben_pos > fr_oben_ystart ) ) { fr_oben_warten = 500; fr_oben_pos = fr_oben_pos - fr_oben_v*fr_oben_r; fr_oben_r = fr_oben_r * -1 }
		document.getElementById("text").style.left = fr_oben_pos.toFixed(0) + "px";
	}
	setTimeout("fr_oben_scroll()",10);
}

function fr_oben_statistik() {
	var fr_oben_statistik_bild = new Image().src = scriptname + '?BCT&p=statistik&aufl=' + screen.width + 'x' + screen.height;
}

function fr_oben_binnochda() {
	document.getElementById('binnochda_status').src = scriptname + '?binnochda&' + new Date().getTime();
	setTimeout("fr_oben_binnochda()",30000);
}

/* allgemeine Funktionen */

var aufzustatus = new Array();
function aufzu(id,weg) {
	if ( aufzustatus[id] ) {
		aufzustatus[id] = false;
		document.getElementById(id).style.display='none';
	} else {
		aufzustatus[id] = true;
		document.getElementById(id).style.display='block';
	}
	if ( document.getElementById(weg) ) {
		document.getElementById(weg).style.display='none';
	}
}

function abstand_links() {
	var fensterbreite;
	if      ( document.innerHeight                                              ) { fensterbreite = parent.frames[0].document.innerWidth;                  }
	else if ( document.documentElement && document.documentElement.clientHeight ) { fensterbreite = parent.frames[0].document.documentElement.clientWidth; }
	else if ( document.body                                                     ) { fensterbreite = parent.frames[0].document.body.clientWidth;            }
	if ( fensterbreite > 700 ) {
		var abstand = ((fensterbreite-700)*0.4).toFixed(0);
		document.getElementById('layout_links'         ).style.width = abstand + "px";
		document.getElementById('layout_links_fixieren').style.width = abstand + "px";
	}
	setTimeout("abstand_links()",500);
}

/* Starten */

if ( parent.documentid != 5679750 ) {
	var neu = location.search;
	neu = neu.replace('\?p=','?p=frs//');
	neu = neu.replace('&p=','&p=frs//');
	top.location.replace(neu);
} else {
	if ( parent.frames[0].document == document ) { // fr_oben
		setTimeout("fr_oben_scroll_init()",1000);
		setTimeout("fr_oben_statistik()",3000);
		setTimeout("fr_oben_binnochda()",10000);
		setTimeout("abstand_links()",1000);
	}
	if ( parent.frames[1].document == document ) { // fr_inhalt
		setTimeout("abstand_links()",1000);
		fr_inhalt_titel_aktualisieren();
	}
}

