/*
 * check for js and cookies
 *
 * note:
 * this routine checks only for acceptance of
 * the framework's OWN cookie. Even in the
 * case this script has been modified or hijacked,
 * we only take a value of 'yes' or 'no' with
 * no further information.
 *
 * written 2007 Stephan Seitz <s.seitz@netz-haut.de>
 */
function pageOnLoad() {
	/* if this function is reached, js is ok */
	var setresult = new Image(0,0);
	var allowcookie = 'no';
	var allow = 0;
	/* check for cookie acceptance */
	if (navigator.cookieEnabled == true) {
		/* has cookies on */
		allowcookie = 'yes';
		allow = 1;
	} else {
		if (navigator.cookieEnabled == false) {
			/* has cookies off */
			allowcookie = 'no';
			allow = 0;
		} else {
			/* has a big secret about cookies, so search for ours */
			if (document.cookie.indexOf('IDOP') != -1) {
				allowcookie = 'yes';
				allow = 1;
			}
		}
	}
	/* immediate response (if available) */
	if (document.getElementById("cookiewarningdiv")) {
		if (allow==0) {
			document.getElementById("cookiewarningdiv").style.display = 'block';
		}
	}
	/* give this information back to the framework, just for informational use */
	setresult.src = '/images/setcookie_' + allowcookie + '.gif';
	document.returnValue = true;
	return true;
}
