/* ======================================================================

JScript Source File -- Created with SAPIEN Technologies PrimalSCRIPT(TM)

NAME: cookiefunctions.js
AUTHOR: Rodney Hampton , R.A. Hampton and Associates
DATE  : 9/18/2002

COMMENT: common cookie functions, currently appears to only be called by default.asp

========================================================================= */
function getCookie(NameOfCookie){
    if (document.cookie.length > 0) {
    begin = document.cookie.indexOf(NameOfCookie+"=");
    if (begin != -1) {
      begin += NameOfCookie.length+1;
      end = document.cookie.indexOf(";", begin);
      if (end == -1) end = document.cookie.length;
        return unescape(document.cookie.substring(begin, end));
    }
  }
  return null;
} 

function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000)); 

  document.cookie = NameOfCookie + "=" + escape(value) +
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
} 

function delCookie (NameOfCookie) {
  if (getCookie(NameOfCookie)) {
    document.cookie = NameOfCookie + "=" +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
} 

function DoTheCookieStuff()
{
 visited=getCookie('visited');
  if (visited==null)
 {
setCookie('visited','yes',30)
MyWindow=window.open('../newsletter-pop-under.htm','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=380,left=10,top=10');
 }
}

