<!-- Begin exitpop code
function replace(string,text,by) {
  var strLength = string.length, txtLength = text.length;
  if ((strLength == 0) || (txtLength == 0)) return string;
  var i = string.indexOf(text);
  if ((!i) && (text != string.substring(0,txtLength))) return string;
  if (i == -1) return string;
  var newstr = string.substring(0,i) + by;
  if (i+txtLength < strLength)
    newstr += replace(string.substring(i+txtLength,strLength),text,by);
  return newstr;
}
function getCookieVal (offset) {  
  var endstr = document.cookie.indexOf (";", offset);  
  if (endstr == -1)    
  endstr = document.cookie.length;  
  return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {  
  var arg = name + "=";  
  var alen = arg.length;  
  var clen = document.cookie.length;  
  var i = 0;  
  while (i < clen) {    
    var j = i + alen;    
    if (document.cookie.substring(i, j) == arg)      
      return getCookieVal (j);    
    i = document.cookie.indexOf(" ", i) + 1;    
    if (i == 0) break;   
  }  
  return null;
}
function SetCookie (name, value) {  
  var argv = SetCookie.arguments;  
  var argc = SetCookie.arguments.length;  
  var expires = (argc > 2) ? argv[2] : null;  
  var path = (argc > 3) ? argv[3] : null;  
  var domain = (argc > 4) ? argv[4] : null;  
  var secure = (argc > 5) ? argv[5] : false;  
  document.cookie = name + "=" + escape (value) + 
  ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
  ((path == null) ? "" : ("; path=" + path)) +  
  ((domain == null) ? "" : ("; domain=" + "196.40.46.231")) +    
  ((secure == true) ? "; secure" : "");
}



var exit = true;
var popup_url = "http://196.40.46.231/games/sfb/popup.asp"

function exitpop() {
  if((GetCookie('registered') != 'loaded') && (exit == true))
  if (exit == true)
  {
    registered();
    openWindow(popup_url);
  }
}


function popup(url) {

	//specify page to pop-under
	var popunder="http://www.totalchannels.com/buy.html";
	
	//specify popunder window features
	//set 1 to enable a particular feature, 0 to disable
	var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0";

  if((url != "") && (GetCookie('displayed') != 'yes'))
  {
	  var expDays = 1000; // number of days the cookie should last
	  var expDate = new Date();
	  expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
	
	  reg = 'yes';
	  SetCookie('displayed', reg, expDate);

	  win2=window.open(popunder,"",winfeatures)
	  win2.blur()
	  window.focus()

	  openWindow(url);
  }
}

function registered() {
  var expDays = 1000; // number of days the cookie should last
  var expDate = new Date();
  expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 

  reg = 'loaded'
  SetCookie('registered', reg, expDate)
}
//-- This function opens the new, empty window named floater.
function openWindow(URL) {
   winStats='toolbar=no,location=no,directories=no,menubar=no,'
   winStats+='scrollbars=no,width=420,height=310'
   if (navigator.appName.indexOf("Microsoft")>=0) {
      winStats+=',left=0,top=0'
    }else{
      winStats+=',screenX=0,screenY=0'
    }
   floater = window.open(URL,"",winStats);

}
// end exitpop code -->
<!--
function popItUp(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=625,height=440');
	self.name = "mainWin";
}
-->
