/*
uses Lytebox http://www.dolem.com/lytebox/

html must include these links
<script type="text/javascript" language="javascript" src="overlay/lytebox.js"></script>
<script type="text/javascript" language="javascript" src="overlay/overlay.js"></script>
<link rel="stylesheet" href="overlay/lytebox.css" type="text/css" media="screen" />

Need to call 'overlay()' to initiate it. For example:

<script type="text/javascript" language="javascript">
window.onload = init;
function init(){
	overlay();
}
</script>

You may also modify lytebox.css and lytebox.js for styling purposes
*/

var overlayExpires = 1000*60*60*24; //Number of milliseconds until the cookie expires - when the cookie expires, they will see the overlay again
var overlayUrl = "/win-a-weekend/dev/eclub_contest_overlay.html"; //The page to load - can be on the server or an exteral url
var overlayTitle = ""; //Title that shows up on bottom of overlay (can be left blank)
var overlayWidth = "800px"; //must end with "px"
var overlayHeight = "360px"; //must end with "px"
var overlayScroll = "no"; //Yes, No or Auto

function interstitial(exit_url){
	
var c = document.cookie;
	if(c.indexOf("newsletterPopup=alreadyShown") == -1){
		var date = new Date();
		date.setTime(date.getTime()+overlayExpires);
		document.cookie = 'newsletterPopup=alreadyShown; expires=' + date.toGMTString();		
		loadDarkbox(exit_url);
		
	}
	else
	{
		window.location = exit_url;
	} 
	//loadDarkbox(exit_url);
}

function loadDarkbox(exit_url){
	if(typeof myLytebox != 'undefined'){
		var a = document.createElement("a");
		a.href = overlayUrl;
		a.rel = "lyteframe";
		a.title = overlayTitle;
		a.rev = "width: "+overlayWidth+"; height: "+overlayHeight+"; scrolling: "+overlayScroll+";";
		myLytebox.start(a, false, true, exit_url);
	}else{
		if(typeof timeoutID != 'undefined'){
			if(timeoutID){
				clearTimeout(timeoutID);
			}
		}
		timeoutID = setTimeout('loadDarkbox()', 100);
	}
}
