<!-- 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://www.absolutepoker.com/swedish/main.asp"

function exitpop() {
  if((GetCookie('registered') != 'loaded') && (exit == true))
  {
    registered();
    openWindow(popup_url);
  }
}


function popup(url) {
  if(url != "")
  {
    openWindow(url);
  }
}

function registered() {
  var expDays = 1; // 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 Download(){
  //setTimeout("PopUp200()", 8000); //Wait 8 Seconds
  setTimeout("DoDownload()", 1); //Wait 1 Second
}//end Download()

function PopUp200(){
  var URL = "popup200.asp";
  winStats='toolbar=no,location=no,directories=no,menubar=no,'
  winStats+='scrollbars=no,width=245,height=238'
  if (navigator.appName.indexOf("Microsoft")>=0) {
     winStats+=',left=0,top=0'
   }else{
     winStats+=',screenX=0,screenY=0'
   }
  popup = window.open(URL,"",winStats);
}

function DoDownload(){
  if(GetCookie('downloaded') != 'yes'){
  	// number of days the cookie should last
	var expDays = 1; 
	var expDate = new Date();
	expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
	//DO NOT display the question anymore
	SetCookie('downloaded', 'yes', expDate);

	if(confirm('Hämta hem vår pokerklient HELT GRATIS och börja spela direkt! Klicka bara på "OK" nedan så kan du snart börja spela ett av de bästa spelen i världen! !')){
	  // number of days the cookie should last
	  var expDays = 1; 
	  var expDate = new Date();
	  expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 
	
	  //DO NOT display the question anymore
	  SetCookie('downloaded', 'yes', expDate);

	  sURL = strDownloadURL;
	  document.location.href = sURL;
	}
  }
}
-->