function getElm(id) {
	return document.getElementById(id);
}

function resElm() {
	return getElm("result");
}

function clearResult() {
	resElm().innerHTML = "";
}

function escapeForHtml(s) {
	return s.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\"", "&quot").replace("/", "\\/");
}

function showStatus(textHtml, userName, screenName, formatedCreatedAt, source, profileImageUri) {
	resElm().innerHTML =
		'<table class="onestatus"><tr><td class="icontd" rowspan="3" valign="top"><img class="iconimg" src="' +
		profileImageUri +
		'" /></td><td class="nametd">' +
		screenName + '/' + userName +
		'</td><td class="createdattd">' +
		formatedCreatedAt +
		'</td></tr><tr><td class="texttd" colspan="2">' +
		textHtml +
		'</td></tr><tr><td class="sourcetd" colspan="2">' +
		source +
		'</td></tr></table>';
}

function addStatus(textHtml, userName, screenName, formatedCreatedAt, source, profileImageUri) {
	resElm().innerHTML +=
		'<table class="onestatus"><tr><td class="icontd" rowspan="3" valign="top"><img class="iconimg" src="' +
		profileImageUri +
		'" /></td><td class="nametd">' +
		screenName + '/' + userName +
		'</td><td class="createdattd">' +
		formatedCreatedAt +
		'</td></tr><tr><td class="texttd" colspan="2">' +
		textHtml +
		'</td></tr><tr><td class="sourcetd" colspan="2">via ' +
		source +
		'</td></tr></table>';
}