function getCookie(name) {
  var cookies = document.cookie;
  if (cookies.indexOf(name) != -1) {
    var startpos = cookies.indexOf(name)+name.length+1;
    var endpos = cookies.indexOf(";",startpos)-1;
    if (endpos == -2) endpos = cookies.length;
      return unescape(cookies.substring(startpos,endpos));
    } else {
      return false; // the cookie couldn't be found! it was never set before, or it expired.
    }
  }

function storeCookie(){
    var name = "SkipVideo";
	var value = "true";
	// no expiration date specified? use this date and it will just be deleted soon.
    var expdate = new Date (); // pre-set to the current time and date
    expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 365); // add one year to it 
	document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/"; 
}

function unSetCookie() {
  var name = "SkipVideo";	
  document.cookie = name + "=;expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/"; 
}

function storeCookieApplyNow(){
    var name = "ApplyNowForm";
	var value = "true";
	// no expiration date specified? use this date and it will just be deleted soon.
    var expdate = new Date (); // pre-set to the current time and date
    expdate.setTime(expdate.getTime() + 1000 * 60 * 60 * 24 * 365); // add one year to it 
	document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + "; path=/"; 
}

function unSetCookieApplyNow() {
  var name = "ApplyNowForm";	
  document.cookie = name + "=;expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/"; 
}