//  Cookie Functions -- "Night of the Living Cookie" Version (25-Jul-96)
//
//  Written by:  Bill Dortch, hIdaho Design <bdortch@hidaho.com>
//******************************************************************
//
// "Internal" function to return the decoded value of a cookie
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
//
//  Function to correct for 2.x Mac date bug.  Call this function to
//  fix a date object prior to passing it to SetCookie.
//  IMPORTANT:  This function should only be called *once* for
//  any given date object!  See example at the end of this document.
//
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}
//
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
//
//  Function to create or update a cookie.
//
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

//  Function to delete a cookie. (Sets expiration date to start of epoch)
//
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}


//
//--------------------------------------
//--------------------------------------
// PPP - SageDiagram javascripts

browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 3 )))
internetV3 = (((navigator.appName == "Microsoft Internet Explorer") || (navigator.appName == "Netscape")) && (parseInt(navigator.appVersion) >= 3 ))
var notice="Try to complete the PayPal transaction without using your browser's [Back] or [REFRESH] buttons, and without navigating to other pages, otherwise you may not be able to download your SageIcd9 license key file!";
SetCookie("mpwbp", "m3w5p9n1bp");
window.top.name="sage";

function licIcd9(htmlName) {
  open(htmlName, "sagebuy", "menubar=no,resizable=no,toolbar=no,status=yes,scrollbars=yes,height=400,width=630");
}

   function copyrightyr() {
     brsrType=navigator.appName;
     brsrMSIE=(navigator.appName == "Microsoft Internet Explorer");
     brsrNS=(navigator.appName == "Netscape");
     var timestamp=document.lastModified;
     var timesecs=Date.parse(timestamp)
     var datetime=new Date();
     datetime.setTime(timesecs);
     if (brsrMSIE) {
        document.write(datetime.getYear());     
     } else {
        document.write(datetime.getYear()+1900);
     }
   }  // end of copyrightyr()


