
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

var exit=true;

function leave()
{
if (exit && get_cookie('popped')=="") {
  SFwin=window.open("http://www.contact-lens-source.com/pop_under.htm",'SFwin','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=560');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",50);
  }
}

function delay_enter()
{
if (get_cookie('popped')=="") {
  SFwin=window.open("http://www.contact-lens-source.com/pop_under.htm",'SFwin','toolbar=0,location=0, status=0,menubar=0,scrollbars=0,resizable=0, width=400,height=560');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",50);
  }
}

function enter()
{
  setTimeout("delay_enter()",550);
}
