// Javascript Objekte und Funktionen

function openBild(width, height)    // Bildfenster anzeigen
{
 	if (! width ) width = 800;
	if (! height ) height = 600;
	window.open('/blank.html','bild','location=0,directories=0,menubar=0,resizable=1,toolbar=0,status=1,scrollbars=1,width='+width+',height='+height+',top=0,left=0');
} // openBild


// Kopfbild (oben links) austauschen
function showBild( img ) {
	// bild = new Image(); bild.src = '/ftp/Image/' + img;
	document.getElementById("kopfbild").src = '/ftp/Image/' + img;
}// showBild


function onBodyLoad() {
// Platzhalter fuer ggf. diverse Aktionen nach dem Laden der Seite
	autoGroesse();
} // onBodyLoad


function autoGroesse() {
// Linke (weise Flaeche) (#left) min. auf Inhalts-Hoehe (#content) vergroessern
	wH = document.body.offsetHeight; //  - 180;
	cH = parseInt(document.getElementById("content").offsetHeight + 150);
	if ( cH > wH ) { wH = cH;	}
	// document.getElementById("left").style.minHeight = wH + 'px';
	document.getElementById("content").style.minHeight = (wH-180) + 'px';
	document.getElementById("left").style.height = wH + 'px';
}// autoGroesse


//
// allgemeine Cookie-Funktionen
//
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		// date.setTime(date.getTime()+(days*24*60*60*1000));
		date.setDate(1 + date.getDate());
		var expires = "; expires=" + date.toGMTString();
	} else var expires = "";
	var val = name+"="+value+expires+"; path=/"; //; domain=entwicklung.bielefeld07.rz-betrieb.de; secure";
	// var val = name+"="+value; // +"; path=/; domain=entwicklung.bielefeld07.rz-betrieb.de; secure";
	// alert ("create Cookie: " + val);
	document.cookie = val;
	// alert(document.cookie);
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	// alert ("read Cookie: " + document.cookie);
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		// alert ( i + ": " + c );
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


