flag=1;

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 SetRemindMe()
{
	setCookie('visited','yes',1);
	self.close();
}

function DoTheCookieStuff()
{
 if (flag==1){ 
  setCookie('cookietest','yes',365); /* Test if supports cookies */
  temp = getCookie('cookietest');
  if (temp != null)
  {
   visited=getCookie('visited');
   if (visited==null) 
   {
    setCookie('visited','yes',365);
    MyWindow = window.open("","mywindow","width=250,height=370,status=no,toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no");
    MyWindow.location.href = "signup.html";
   }
  }
 }
}
