
var onload_events=new Array();
var onunload_events=new Array();
var home_url="";
 
function loading(){
m=onload_events;
for(i=0;i<m.length;i++){eval(m[i]);}
}
function unloading(){
m=onunload_events;
for(i=0;i<m.length;i++){eval(m[i]);}
}
function onloading(s){
onload_events[onload_events.length]=s;
}
function pop(url,name,width,height,scrollbars,resisable){
if (url=='') {return;}
if (name=='') name='';
if (!(width>0)) width=300;
if (!(height>0)) height=200;
if (scrollbars==null) scrollbars = 'yes';
if (resisable==null) resisable = 'yes';
url=home_url+url;
var a=window.open(url,name,"toolbar=no,scrollbars=" + scrollbars + ",titlebar=no,resizable="+resisable+",width="+width+",height="+height+",top=100,left=200");
a.focus();
}

//Function for setting the cookie
function setCookie(name) 
{
var quickexpdate = new Date();
quickexpdate.setTime(quickexpdate.getTime() + 1000*60*10); //10min
document.cookie = name + "=On;expires=" + quickexpdate.toGMTString();
}

//Function to get the cookie
function getCookie(name) 
{
var index = document.cookie.indexOf(name + "=");
if (index == -1) return null;
index = document.cookie.indexOf("=", index) + 1;
var endstr = document.cookie.indexOf(";", index);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(index, endstr));
}

//Function for pop under
function goNewWin() 
{
//TheNewWin = window.open("http://www.partypoker.com/affiliates/ppm20bonus_s.htm?wm=2021733","","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
TheNewWin = window.open(home_url + action_script + "/2htm.pop/empire", "empp", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=700,height=300");
//TheNewWin = window.open("http://www.empirepoker.com/index.htm?wm=1702025","","toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1");
TheNewWin.blur();
}

//checks for the existance of the cookie
//Requires goNewWin, getCookie, setCookie
function CheckCook(name)
{
if(!getCookie(name)) 
{
setCookie(name);
goNewWin();
}
}
