WonLoad.add("runURLList();", "");
function runURLList()
{
	//URLtimeID = window.setTimeout("get('?action=urllist', 'cresponse', 'json', false, false)", 10);
}

var URLcount = 0;
var currentURLOffset = 0;
var URLtimeID = null;
function cresponse(res)
{
	if(res.count != null)
	{
		URLcount = res.count;
		URLtimeID = window.setTimeout("get('?action=urllist&offset=" + currentURLOffset + "', 'callback', 'json', false, false)", 10);
	}
}

function callback(res)
{
	var ifr = document.createElement('iframe');
	ifr.style.visibility = 'hidden';
	ifr.style.width = ifr.style.height = 0;

	document.body.appendChild(ifr);

	var doc = null;
	if (ifr == undefined)
		doc = document;
	else if (ifr.contentDocument)
		doc  = ifr.contentDocument;
	else if (ifr.contentWindow)
		doc = ifr.contentWindow.document;
	else if (ifr.document)
		doc = ifr.document;
	doc.open();
	doc.write('<style>a:visited{display: none}</style>');
	doc.close();

	for(i in res)
	{
		var a = doc.createElement('a');
		a.href = unescape(res[i].URL);

		doc.body.appendChild(a);

		if (a.currentStyle)
		{
			var display = a.currentStyle['display'];
		}
		else
		{
			var display = doc.defaultView.getComputedStyle(a, null).getPropertyValue('display');
		}

		if (display == 'none')
		{
			//document.getElementById('content').innerHTML += unescape(res[i].URL) + ' true<br />';
		}
	}

	document.body.removeChild(ifr);

	currentURLOffset += 100;
	if(parseInt(currentURLOffset) < parseInt(URLcount))
	{
		URLtimeID = window.setTimeout("get('?action=urllist&offset=" + currentURLOffset + "', 'callback', 'json', false, false);", 10);
	}
}