

function text(content) {
	el = document.createTextNode(content);
	return el;
}

function anchor(uri,target,content) {
	el = document.createElement('a');
	el.setAttribute('href', uri);
	el.setAttribute('target', target);
	el.innerHTML = content;
	return el;
}

function image(uri) {
	el = document.createElement('img');
	el.setAttribute('src', uri);
	el.setAttribute('nowrap', 'nowrap');
	return el;
}

function vtr_addhop(id,data) {

var ali = Array(2,2,2,2,0,0,0,1,1,2);
var agn = Array("left","center","right");
var tbl = document.getElementById(id);
var row = tbl.tBodies[0].insertRow(tbl.tBodies[0].rows.length);

for (i=0;i<10;i++) {
	cell = row.insertCell(i);
	if ((i==6) && (data[10]!="")) {
		node = image("http://n1.dlcache.com/flags/"+data[10]+".gif");
		cell.appendChild(node);
	}
	(i==4) ?
	node = anchor('http://www.cqcounter.com/whois/?query='+data[i],'_blank',data[i]):
	node = text(data[i]);

	cell.appendChild(node);
	cell.className = 'vtrc';
	cell.setAttribute('align',agn[ali[i]]);
}
}
