function SetCookie () {
	var p=document.location.pathname;
	p = p.substr(p.lastIndexOf('/')+1);
	if (p=='') p='index.htm';
	document.cookie = p+'=1';
}

function ChkCookie () {
	var p=document.location.pathname;
	p = p.substr(p.lastIndexOf('/')+1);
	if (p=='') p='index.htm';	
	var rx=new RegExp('; '+p+'=1')
	var mat = ('; '+document.cookie).match(rx);
	if (mat) return true; else return false;
}

if (ChkCookie() && (document.referrer != '' || document.location.toString().match(/\/trainingcd\/[a-z0-9\-]+\//)))
	document.location.replace(newlink);
else 
	SetCookie();
	