
	<!--//--><![CDATA[//><!--

	var psyma_use_cookies = <?= $use_cookies ?>;
	var psyma_cookie_type = <?= $cookie_type ?>;
	var psyma_participation = 0;
	var psyma_participation_cookie = "psyma_participation";
	var psyma_cookie_exp = psyma_get_expiration_date();

	// ###### get cookie ######
	function get_psyma_cookie(a)
	{
		if ( psyma_use_cookies )
		{
			var c=document.cookie.split(a+"=");
			return (c.length>1)?unescape(c[1].split(";")[0]):"";
		}
		else
		return null;
	}

	// ###### set cookie ######
	function set_psyma_cookie(name, value, path, domain, secure, expires)
	{
		if ( psyma_use_cookies ) 
		{
			document.cookie =
			  name + "="
			  + escape(value)
			  + ((path) ? "; path=" + path : "")
			  + ((expires) ? "; expires=" + expires.toGMTString() : "")
			  + ((domain) ? "; domain=" + domain : "")
			  + ((secure) ? "; secure" : "");
		}
	}

	// ###### get expiration date ######
	function psyma_get_expiration_date()
	{
		var psyma_day_offset = <?= $cookie_exp_days ?>;		// how many days should cookies be active
		var psyma_milli_offset = psyma_day_offset * 1000 * 60 * 60 * 24;
		var psyma_now = new Date();
		psyma_participation_exp = new Date(psyma_now.valueOf() + psyma_milli_offset);
		return psyma_participation_exp;
	}

	//--><!]]>


	<!--//--><![CDATA[//><!-- 

	// Psyma Research+Consulting
	// a) Layer currently deactivated
	// b) You are not included in the sample	

	// ##### Cookie auslesen #####
	psyma_participation = get_psyma_cookie(psyma_participation_cookie);

	// ##### Cookie setzen, wenn noch keiner vorhanden ist #####
	if (psyma_participation != 1 && psyma_participation != 2)
	{
		if (psyma_cookie_type == 1)
		{
			//set_psyma_cookie(psyma_participation_cookie, 1, "/", "", "", "");
		}
		else if (psyma_cookie_type == 2)
		{
			//set_psyma_cookie(psyma_participation_cookie, 2, "/", "", "", psyma_cookie_exp);
		}
	}

	//--><!]]>

	
