//--------------------------------------------------
var timeridmain = null;
var timeridsub = null;
//--------------------------------------------------
function isClosed() {
	return (getCookie("interstitial") == null ? false : true);
}
//--------------------------------------------------
function setClosed() {
	//getExpDate(d,h,m)
	var exp = getExpDate(0,0,0);
	setCookie("interstitial","hide", exp, "/");
	if (timeridmain != null) {
		clearTimeout(timeridmain);
	}
	if (timeridsub != null) {
		clearTimeout(timeridsub);
	}
}
//--------------------------------------------------
function showInterstitialAd() {
	initDHTMLAPI();
	if (!isClosed()) {
		var obj = getRawObject("interstitialAd");
		centerOnWindow(obj);
		timeridsub = setTimeout("showInterstitialAd()", 250); //quarter second
	}
}
//--------------------------------------------------
function showInterstitialAdMainLayout() {
	initDHTMLAPI();
	if (!isClosed()) {
		var obj = getRawObject("interstitialAd");
		var center = getCenterPosition(obj);
		setZIndex(obj,100);
		//shiftTo(obj, center[0], center[1] - 50);
		shiftTo(obj, 570, 100);
		show(obj);
		timeridmain = setTimeout("showInterstitialAdMainLayout()", 250); //quarter second
	}
}
//--------------------------------------------------
function closeInterstitialAd() {
	var obj = getRawObject("interstitialAd");
	hide(obj);
	setClosed();
}
//--------------------------------------------------
function openWindow(url) {
	var win = window.open(url,"");
	win.focus();
}
//--------------------------------------------------
