// this version uses window.open

//var urls = Array( 	"http://www.backpageads.com/?ccat1=017",
//			"http://www.backpageads.com/?ccat1=001",
//			"http://www.backpageads.com/?ccat1=015",
//			"http://www.backpageads.com/?ccat1=002"	);


var urls = Array( 	"http://www.hdlns.com",
		"http://www.hdlns.com");

// Specify the width and height of new popunder window (in pixels).
var width = window.width; 
var height = window.height;

var opts = 	'scrollbars=yes,' + 
		',resizable=yes,' + 
		'toolbar=yes,' + 
		'menubar=yes,' + 
		'status=yes,' + 
		'location=yes,' + 
		'left=' + window.left + ',' + 
		'top=' + window.top + ',' + 
		'height=' + height + + "," +
		'width=' + width;

var one_time=0;

function get_cookie(Name) 
{
	var search = Name + "=";
 	var returnvalue = "";
	if (document.cookie.length > 0) 
	{
		offset = document.cookie.indexOf(search)
    		// if the cookie exists
		if (offset != -1) 
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset); // set the index of beginning value
      
			if (end == -1) // set the index of the end of cookie value
				end = document.cookie.length;

			returnvalue=unescape(document.cookie.substring(offset, end));
		}
 	}
	return returnvalue;
}

function loadornot()
{
	if (get_cookie('popunder')=='')
	{
		do_win();
		document.cookie="popunder=yes";
	}
}

function do_win()
{
	win2=window.open(urls[Math.floor(Math.random()*(urls.length))],"bw",opts);
	try
	{
		win2.blur();
	}
	catch(ex)
	{
		// do nothing
	}
	window.focus();
}

if (one_time==0)
	do_win();
else
	loadornot();







