
var destinationURL ="http://www.sdahc.org/04-05/HolidayTourney/index.html";
var windowname = "5th Annual Holiday Tournament";
var popimage ="http://www.sdahc.org/04-05/HolidayTourney/images/5thAnnual.jpg";

var timestamp = "2004.08.07.21.00.00";
var popname = "poptime";
var popvalue = escape(timestamp);
var popexpire = "Fri, 31-Dec-2020 000:00:00 GMT";

CheckRequester();
//GetCookie();

function CheckRequester()
{
  var docURL = document.URL;
  docURL.toLowerCase();
  if (docURL.indexOf("sdhc.com") > 0) {
     displaySDHCCOMExpireNotice();
  }
}

function GetCookie() 
{
  var extract = document.cookie.indexOf(popname);
  if (extract == -1){
    setcookie(popname, popvalue, popexpire);
  }else{
   extract == popname.length;
   var stopextract = document.cookie.indexOf(';', extract);
   if (stopextract == -1) stopextract = document.cookie.length;
    var finalextract = document.cookie.substring(extract, stopextract);
    return getCookieVal (finalextract); 
  }
}

function getCookieVal(parsethis) 
{
  timevalue = parsethis.substring(8, 27);
  if (timevalue != popvalue) {
    setcookie(popname, popvalue, popexpire);
  }
}

function setcookie(popvar, setvalue, setexpire)
{
  document.cookie = popvar +"=" + setvalue +"; PATH=/; expires="+ setexpire;
  DeliverNotice();
}

function DeliverNotice()
{
  var popoff=window.open("","newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=450");
  var popit=popoff.document;
  var sjava="S";
  var blurcommand="'closeWin()'"
  popit.write ('<HTML>');
  popit.write ('<HEAD>');
  popit.write ('<'+ sjava +'CRIPT LANGUAGE="JavaScript">');
  popit.write ('function closeWin() {');
  popit.write ('parent.close();');
  popit.write ('}');
  popit.write ('</'+ sjava +'CRIPT>');
  popit.write ('<TITLE>'+ windowname +'</TITLE>');
  popit.write ('</HEAD>');
  popit.write ('<BODY topmargin="0" leftmargin="0" BGCOLOR="#000000" TEXT="#FFFFFF" LINK="#FFFFFF" VLINK="#FFFFFF" ALINK="#FF0000">');
   popit.write ('<DIV ALIGN="center">');
  popit.write ('<center><a href="'+ destinationURL +'" TARGET="Newwindow">');
  popit.write('<IMG SRC="'+ popimage +'" BORDER="0"></a></center>');
  popit.write ('</DIV>');
  popit.write ('<br><CENTER><a href="javascript:closeWin()">Click Here To Close Window</a></center>');
  popit.write ('</DIV>');
  popit.write ('</BODY>');
  popit.write ('</HTML>');
}

function displaySDHCCOMExpireNotice()
{
  var popoff=window.open("","newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=350");
  var popit=popoff.document;
  popit.write ('<HTML>');
  popit.write ('<HEAD>');
  popit.write ('<TITLE>SDHC.COM is expiring... use SDAHC.ORG instead..</TITLE>');
  popit.write ('</HEAD>');
  popit.write ('<BODY topmargin="0" leftmargin="0" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#FF0000">');
  popit.write ('<DIV ALIGN="center">');
  popit.write ('<center>');
  popit.write ('<IMG SRC="http://www.sdahc.org/images/sdahc_logo.gif" BORDER="0">');
  popit.write ('<H1>Please use<br><a href="http://www.sdahc.org" TARGET="Newwindow">www.sdahc.org</a><br>to access the website</H1>');
  popit.write ('<H1>www.sdhc.com<br>will be expiring soon...</H1>');
  popit.write ('</center>');
  popit.write ('</BODY>');
  popit.write ('</HTML>');
}