
// Copyright 2000-2004 SecureIE.com and Capital Intellect Inc

function MaximizeWindow()
{
  top.window.moveTo(0,0);

  if (document.all)
  {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
  }

  else if (document.layers||document.getElementById)
  {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
    {
      top.window.outerHeight = screen.availHeight;
      top.window.outerWidth = screen.availWidth;
    }
  }
}

function SetCookie (cookieName, cookieValue, expiry) 
{
  var expDate = new Date();
  if(expiry)
  {
    expDate.setTime (expDate.getTime() + expiry);
    document.cookie = cookieName + "=" + escape (cookieValue) + "; expires=" + expDate.toGMTString();
  }
  else
  {
    document.cookie = cookieName + "=" + escape (cookieValue);
  }
}

function GetCookie(CookieName) 
{
    var CookieString = document.cookie;
    var CookieSet = CookieString.split (';');
    var SetSize = CookieSet.length;
    var CookiePieces
    var ReturnValue = "";
    var x = 0;

    for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) 
    {
      CookiePieces = CookieSet[x].split ('=');

      if (CookiePieces[0].substring (0,1) == ' ') 
      {
        CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
      }

      if (CookiePieces[0] == CookieName) 
      {
        ReturnValue = CookiePieces[1];
      }
  }
  return ReturnValue;
}

function SetPurchased()
{
  SetCookie("PurchasedSecureIEPrivateIE", 1, 1000 * 60 * 60 * 24 * 14);  // 2 Weeks
}

function SetSawCoupon()
{
  SetCookie("HasSeenExitCoupon", 1, 1000 * 60 * 60);  // 1 Hour
}

function CookiesEnabled()
{
  var cookies = (window.navigator.cookieEnabled);
  if (cookie ==true) {return true};

}

function CouponCode()
{
  var tc = new Array(5);
  var now = new Date();
  var nh = now.getHours();
  if (nh==0){tc[0]=12;tc[1]="x";tc[2]=1;tc[3]="c";}
  else if (nh>=1 && nh<=10){tc[0]=nh;tc[1]="x";tc[2]=nh+1;tc[3]="c";}
  else if (nh==11){tc[0]=11;tc[1]="x";tc[2]=12;tc[3]="d";}
  else if (nh==12){tc[0]=nh;tc[1]="y";tc[2]=1;tc[3]="d";}
  else if (nh>=13 && nh<=22){tc[0]=nh-12;tc[1]="y";tc[2]=nh-11;tc[3]="d";}
  else if (nh==23){tc[0]=11;tc[1]="y";tc[2]=12;tc[3]="c";}
  if (now.getMinutes()>=30){tc[4]="h";}
  else{tc[4]="b";}
  return tc.join("n");
}

function cc(cs)
{
  var ci = cs.split("n");
  document.write("F");document.write("r");document.write("o");
  document.write("m ");document.write(ci[0]);document.write(":");
  document.write(ci[4]=="b"?"00":"30");document.write(" ");
  document.write(ci[1]=="x"?"A":"P");
  document.write(".M.");document.write(" T");
  document.write("o ");document.write(ci[2]);document.write(":");
  document.write(ci[4]=="h"?"30":"00");document.write(" ");
  document.write(ci[3]=="d"?"P":"A");
  document.write(".M.");
}

function OpenGuarantee()
{
  Guarantee=window.open("0304_sie_guarantee_01.asp","Guarantee","'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=500'");
}

function returnOS()
{
  //following code borrowed from:
  // Ultimate client-side JavaScript client sniff.
  // (C) Netscape Communications 1999. Permission granted to reuse and distribute.
  var agt=navigator.userAgent.toLowerCase();
  var is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
  var is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1));
  // NOTE: Reliable detection of Win98 may not be possible. It appears that:
  // - On Nav 4.x and before you'll get plain "Windows" in userAgent.
  // - On Mercury client, the 32-bit version will return "Win98", but
  // the 16-bit version running on Win98 will still return "Win95".
  var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
  var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
  var is_mac = (agt.indexOf("mac")!=-1);

  if (is_mac)
    return "Macintosh";
  else if (is_win95)
    return "Windows 95";
  else if (is_win31)
    return "Windows 3.1";
  else if (is_win98)
    return "Windows 98";
  else if (is_winnt)
  {
    if (agt.indexOf("windows nt 5.1")!=-1)
      return "Windows XP";
    else if (agt.indexOf("windows nt 5.0")!=-1)
      return "Windows 2000";
    else if (agt.indexOf("windows 2000")!=-1)
      return "Windows 2000";
    else
      return "Windows NT"
  }
}

