// 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


var timeout;
// Quickfinder
function showObj(obj, doTimeout) {
	if (timeout) { window.clearTimeout(timeout); }
	if(document.all) {  // IE
			document.all[obj].style.display="";
	} else if (document.layers) {
			document.layers[obj].visibility = "show";
	}//else (Netscape 4)
	else if (document.getElementById) { // NS 6
			document.getElementById(obj).style.display="";
	}//elsif (Netscpae 6)
	if ( ! document.all  ||  ! doTimeout || doTimeout != 'noTimeout' ) {
		timeout = window.setTimeout("hideObj('"+obj+"')", 4000);
	}
}//showObj


function hideObj(obj) {
	if(document.all) {  // IE
		if (timeout) { window.clearTimeout(timeout); }
		document.all[obj].style.display="none";
	} else if (document.layers){
		document.layers[obj].visibility = "hide";
	}//else (Netscape 4)
	else if (document.getElementById) { // NS 6
		//alert('Feieraben.');
		document.getElementById(obj).style.display="none";
	}//elsif (Netscpae 6)
}//hideObj


//
// 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);
}



