  var allcookies = document.cookie;
  var pos = allcookies.indexOf("PERM=");
  if (pos == -1) {
    var expDate = new Date();
    var oneDay  = 24 * 60 * 60 * 1000;  // 1 day in milliseconds
    expDate.setTime(expDate.getTime() + (oneDay * 365));  // Cookie will expire in 1 year
    var sVal = (Math.random() * 4);
    // Set the 'PERM' Cookie
    document.cookie = "PERM=" + sVal + ";domain=sendomatic.com;path=/;expires=" + expDate.toGMTString();
  }
  pos = allcookies.indexOf("TEMP=");
  if (pos == -1) {
    var sVal = (Math.random() * 4);
    // Set the 'TEMP' Cookie
    document.cookie = "TEMP=" + sVal + ";domain=sendomatic.com;path=/;";
  }
