function getCookie() {
	// Return the value of haveSeenVideo
	var dc = document.cookie;
	var prefix = "haveSeenVideo=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1) {begin = dc.indexOf(prefix);
	if (begin != 0) return null; }
	else {begin += 2;}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) {end = dc.length;}
	return unescape(dc.substring (begin + prefix.length, end));
}

function setCookie(){
	// Set the value of haveSeenVideo to yes
	var expDate = new Date();
	expDate.setFullYear(expDate.getFullYear() + 5);
	document.cookie = "haveSeenVideo=yes; expires=" + expDate.toGMTString() + "; path=/;"; 
}

var cVal = getCookie();
// if haveSeenVideo doesn't equal yes, set it to yes
if ( cVal != "yes" ) { setCookie(); }
// if haveSeenVideo does equal yes, advance to next page
else { location.replace("index.php"); }

