// <!--

var exitURL="http"+"://www.gonegambling.com/membersonly/membersregister.html";

var nextime = 0;
var fixlinks = 1;


var docVal = 0 ;
var Cdelay = 1000;
var exiting = 1;

var isNav, isIE;
if (parseInt(navigator.appVersion) >= 4) {
    if (navigator.appName == "Netscape") {
	isNav = true;
    } else {
	isIE = true;
    }
}

function stopError(e) { return true; }
window.onerror = stopError;

function openWin() {

    if ( nextime > (new Date()).getTime()) return;

    var featureStr="dependent=no,resizable=yes,location=yes,scrollbars=yes";
    self.focus();
    var ExitWindow = window.open(exitURL,'ExitWindow');
    self.focus();

}

function clickHandler(e) {
    exiting = 0;
    if (isNav) { document.routeEvent(e); }
    return true;
}

function doExit(e) {
    exiting = 1;
    if (!isNav) window.event.cancelBubble = true;
}

function fixLinks() {
	document.onclick = clickHandler;
}

function fixNoise() {
    if (document.all &&
	document.all.tags("bgsound") &&
	document.all.tags("bgsound")[0]
	)
	document.all.tags("bgsound")[0].volume = -10000;
}

function exitHandler() {
    if (exiting) {
	openWin();
    }
    return true;
}

var newload;
var oldload;
function installLoad(func) {
    newload = func;
    oldload = window.onload;

    window.onload = new Function ("newload(); if (oldload != null) oldload();");
}

var oldexit;
var newexit;
function installExit(func) {

    newexit = func;
    oldexit = window.onunload;
        window.onunload=func;
}

if (isNav) {
    document.captureEvents(Event.CLICK | Event.UNLOAD | Event.LOAD | Event.ERROR);
}

var wname = window.name;if (wname != null && wname == "EEmF1" ) {
    docVal = 1; 
} else {
    docVal = 0;
}
//	Get named cookie

function xxGetCookie (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 xxGetCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}//	get cookie value

function xxGetCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
// exit window
if (docVal == 1) { 
    window.open = null;
    installLoad(fixNoise);
}
// client window 
else {	var GGmember = xxGetCookie('Username');  
	if(GGmember==null) GGmember = xxGetCookie('ViewedRegister');
	if(GGmember==null){ 
		if (fixlinks) fixLinks();
		installExit(exitHandler);	}
} 
//-->
