var timeridmain = null;
var timeridsub = null;

function isClosed() {
	return (getCookie("interstitial") == null ? false : true);
}

function setClosed() {
	//Set a cookie to not display the add for 24 hours
	var exp = getExpDate(1,0,0);
	setCookie("interstitial","hide", exp, "/");
	if (timeridmain != 0) {
		clearTimeout(timeridmain);
	}
	if (timeridsub != null) {
		clearTimeout(timeridsub);
	}
}

function showInterstitialAdd() {
	initDHTMLAPI();
	if (!isClosed()) {
		var obj = getRawObject("interstitialAdd");
		centerOnWindow(obj);
		timeridsub = setTimeout("showInterstitialAdd()", 350); //quarter second	
	}
}

function showInterstitialAddMainLayout() {
	initDHTMLAPI();
	if (!isClosed()) {
		var obj = getRawObject("interstitialAdd");
		var center = getCenterPosition(obj);
		shiftTo(obj, center[0], center[1] - 10);
		show(obj);
		timeridmain = setTimeout("showInterstitialAddMainLayout()", 350); //quarter second	
	}
}

function closeInterstitialAdd() {
	var obj = getRawObject("interstitialAdd");
	hide(obj);
	setClosed();
}

function openWindow(url) {
	var win = window.open(url,"reddoor");
	win.focus();
}

