/**********************************************************
  File:     CookieCode.js
            ? 2006 BeneCare Dental Plans  
  Author:   Stephen G. Carl
  Date:     June 2006
  Remarks:  Code to process cookies.
 **********************************************************/
function setCookie(key, value) {
  document.cookie = key + "=" + value;
}

function getCookie(key) {
  var val = '';
  var allCookies = document.cookie;
  var pos = allCookies.indexOf(key);
  if (pos != -1) {
    var start = pos + key.length + 1;
    var end = allCookies.indexOf(";", start);
    if (end == -1) {
    	end = allCookies.length;
    }
    val = unescape(allCookies.substring(start, end));
  }
  return val;
}

function killCookie() {
  document.cookie += '; expires=Fri, 02-Jan 1970 00:00:00 GMT';
}