document.cookie = "existCookie=yes;";
isCookie("existCookie");

function isCookie(x)
{
    var nalezeno = false;
    var pom = document.cookie.split('; ');

    for (var i=0; i<pom.length; i++) {
	var v = pom[i].split('=');

	if (v[0] == x) {
	    nalezeno = true;
	    break;
	}
    }

    if (! nalezeno) {
	location.replace("http://e-learning.vslib.cz/elearning/error/cookies.html");
    }
};
