// get cookie 
function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = "";
		if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		// if cookie exists
			if (offset != -1) { 
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset);
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}
function set_cookie(c_name, c_val, expiredays) {
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = c_name+"="+c_val+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if (get_cookie("PreviewVideoCookie") == "") {
    set_cookie("PreviewVideoCookie", "false", 365);
    document.location = "/preview/";
}
