function getdomain(url)
{
	return (url.search(/(\w+)\.com/) > 0) ? url.search(/(\w+)\.com/)[1] : "";
}

/* function nopcook(mins)
{
	setCookie("Promo",1,mins*5,'/');
}
*/


// Deal with frames
var inframe = false;
if (top != self)
{
	pop = false;
	if (getdomain(top.location.href) == getdomain(self.location.href)) { inframe = true; }
	else
	{
		if (parseInt(navigator.appVersion) > 3.01) { top.location.replace(self.location.href); }
		else { top.location.href = self.location.href; }
	}
}

nopopSites = [''];

// Define console properties
// if (getCookie("Promo") != null) { exit = false; }

var uagt = navigator.userAgent.toLowerCase();
var aolsmell = (uagt.indexOf("aol")>=0 || uagt.indexOf("webtv")>=0);
if (aolsmell) { exit = false; }


popName = "Promo";
popPeriod = 3600;
popUrl = "http://www.badoj.com/popup/";
win_resizable = true;
win_scrollbars = true;
win_menubar = false;
win_location = false;
win_toolbar = false;
win_status = false;
noAttrib = false;
popWidth = 800;
popHeight = 600;



var gol = false;
function goUL()
{
	//if (getCookie("Promo") != null) { exit = false; }
	if (gol) { return; }
	gol = true;
	if (inframe) { 
//if (!exit) { window.top.exit=false; nopcook(2); } 
}
	else if (exit)
	{
		if (isOpen()) { popWindow.focus(); }
		else
		{
			popMethod = "all";
			popUnder = true;
			popup();
		}
	}
}


// Do exit console
var noenter = true;
noenter = true;

if (exit && !isOpen() && !inframe)
{
	popUnder = true;
	if (noenter) { popup(); }
	var nopopimg = new Image();
}

// Make sure goUL is called
if (document.all && inframe)
{
	attachEvent('onunload',goUL);
}

self.focus();
stayUnder();

