<!--
var expDays = 1; // number of days the cookie should last

var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function FixCookieDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0) date.setTime(date.getTime()-skew);}
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 getCookieVal(offset){var endstr=document.cookie.indexOf(";",offset);if (endstr==-1)endstr=document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}
function SetCookie(name,value,expires,path,domain,secure){document.cookie=name+"="+escape(value)+((expires)?";expires="+expires.toGMTString():"")+((path)?"; path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"");}
function DeleteCookie(name,path,domain){if (GetCookie(name)){document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-70 00:00:01 GMT";}}

flag = false;
function runPopupOut(){
	if (flag==false){
		strParam = "s=39"; //SiteID
		if (location.href.indexOf("s=")>0) strParam = location.href.substring(location.href.indexOf("s=")); //Grabs the SiteID if it is the location
		window.open('http://www.before-you-go.com/byGroups/frames.php?'+strParam,'BYG_PopUp','scrollbars=yes,location=yes,dependent=no,directories=no,status=yes,menubar=yes,toolbar=yes,resizable=yes');
		self.focus();
	}
}

function runPopupIn(){
	if (!(self.location.href.indexOf("byg_frame")>0)){
//		window.open('popup_email.htm','emailpopup','toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,width=200,height=366');
//		window.open('wc2k2_popup.htm','wc2k2_popup','toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,width=300,height=300');
//		window.open(\'http://www.better-betting.com/pop10000/emailpopup_1000.htm\',\'emailpopup\',\'toolbar=no,menubar=no,location=no,scrollbars=no,resize=no,width=200,height=366\')"

		var count = GetCookie('count');
		if (count == null){
			SetCookie('count', 1, exp);
			self.focus();
			window.open('http://www.better-betting.com/pop_flamingo_flash.htm', '', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width=400,height=300,left=0,top=0');
		}else{
			count++;
			SetCookie('count', count, exp);
		}
	}
}

if ((self.location == top.location)||(self.location.href.indexOf("byg_frame")>0)){
	if (self.location.href.indexOf("byg_frame")>0) flag = true;
	document.open();
		document.write('<frameset name="index" rows="100%,*" frameborder="NO" border="0" framespacing="0" onLoad="runPopupIn();" onUnload="runPopupOut();"><frame name="index_fs" src="'+location.pathname+'?" noresize scrolling="AUTO" marginwidth="0" marginheight="0" frameborder="NO"></frameset>');
	document.close();
	index_fs.location = top.location;
}
//-->
