<!--

/*
**	Copyright: SHG Endometriose Zürich, 2002/2007 - all rights reserved
**	Author: Nils, Wilco GmbH
**	SHG Endometriose Zürich - Javascript
*/

function endoCheckSetCookie( page ) {

	if ( ( parent == self ) || ( parent != top ) || ( window.name != "endo_main" ) ) {
		top.location.href = "./index.html";
	}

	var allcookies = document.cookie;
	var pos = allcookies.indexOf("lastpage=");

	if ( pos != -1 ) {
		var start = pos + 9;
		var end = allcookies.indexOf(";", start);
		if ( end == -1 )
			end = allcookies.length;

		if ( start != end ) {
			page = allcookies.substring(start, end);
			page = unescape(page);

			// document.writeln(page + '<br>');

			var nextyear = new Date();
			nextyear.setFullYear(nextyear.getFullYear() - 1);
			document.cookie = "lastpage=" + page + "; expires=" + nextyear.toGMTString() + ";path=/";

			top.endo_main.location.href = page;
		}
	}
}

function endoSetCookie( page, ignore ) {
	if ( ( parent == self ) || ( parent != top ) || ( window.name != ignore ) ) {
		var nextyear = new Date();
		nextyear.setFullYear(nextyear.getFullYear() + 1);
		document.cookie = "lastpage=" + page + "; expires=" + nextyear.toGMTString() + ";path=/";

		top.location.href = "/index.html";
	}
}

-->


