
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.treadmillbynet.com/pop_under.htm",'SFwin','toolbar=0,location=0, status=0,menubar=0,scrollbars=0,resizable=0, width=500,height=400');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",250);
  }
}

function leave_news()
{
if (exit && get_cookie('popped')=="") {
  SFwin=window.open("http://www.treadmillbynet.com/pop_under_news.htm",'SFwin','toolbar=0,location=0, status=0,menubar=0,scrollbars=0,resizable=0, width=385,height=350');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",250);
  }
}

function delay_enter()
{
if (get_cookie('popped')=="") {
  SFwin=window.open("http://www.treadmillbynet.com/pop_under.htm",'SFwin','toolbar=0,location=0, status=0,menubar=0,scrollbars=0,resizable=0, width=466,height=300');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",250);
  }
}

function enter()
{
//if (pop!="") { document.cookie="popped=yes"; }
  setTimeout("delay_enter()",10250);
}

function enter_news()
{
if (get_cookie('popped')=="") {
  SFwin=window.open("http://www.treadmillbynet.com/pop_under_news.htm",'SFwin','toolbar=0,location=0, status=0,menubar=0,scrollbars=0,resizable=0, width=385,height=350');
  document.cookie="popped=yes";
  SFwin.blur();
  setTimeout("window.focus()",250);
  }
}

