function w(text) {
	document.write(text);
};

var n = cols.length;
w('<table class="data" id="data" cellpadding="0" cellspacing="0"><thead><tr class="title">');

for ( var j = 0; j < n; j++) {
	if (titles[j]) {
		w('<td style="text-align:center;"><b>');
		w(titles[j]);
		w('</b></td>');
	}
}
w('</tr></thead>');
var i = 0;
$.each(data, function() {
	var line = this;
	w('<tr class="');
	w(line['class']);
	if (i % 2 == 1)
		w(' alt');
	w('">');
	for ( var j = 0; j < n; j++) {
		if (titles[j]) {
			w('<td class="');
			w(classes[j]);
			w('">');
			if (cols[j] == 'name') {
				var name = line['name'] + '<br/><span class="sn" title="@'
						+ line['user_name'] + '">@' + line['user_name']
						+ '</span>';
				line['name'] = '<a href="http://twitter.com/'
						+ line['user_name'] + '" title="' + line['name'] + '">'
						+ name + '</a>';
				if (line['avatar'])
					line['name'] = '<img border="0" src="' + line['avatar']
							+ '"/>' + line['name'];
				else
					line['name'] = '<img border="0" src="' + line['avatar']
							+ '"/>' + line['name'];
				w(line['name']);
			} else if (cols[j] == 'text') {
				w(line[cols[j]]);
				w("<div class=\"ops\">操作: <a class=\"retweet\" id=\"rt-"
						+ line.tid + "\" href=\"javascript:rt(" + line.tid
						+ ")\">锐推</a></div>");
			} else if (cols[j] == 'retweets') {
				w("<a href=\"javascript:$('.id-list').hide();$('#ids-"+line['index']+"').show();\">");
				w(line['times']);
				w("</a>");
				w("<div onclick=\"$('#ids-"+line['index']+"').hide();\" class=\"id-list floating\" style=\"display:none;\" id=\"ids-"+line['index']+"\">"+line['retweets']+"</div>");
			} else {
				w(line[cols[j]]);
			}
			w('</td>');
		}
	}
	w('</tr>');
	i++;
});
w('</table>');
$('.waiting').remove();
$('script').remove();