window.onload = function() { 
	var txt = document.getElementsByTagName('TEXTAREA')[0];
	var span = document.createElement('span');

	var inputs = document.getElementsByTagName('INPUT');
	var submit = null;

	for (var i = 0; i < inputs.length; i++) {
		if (inputs[i].type.toLowerCase() === "submit") {
			submit = inputs[i];
			break;
		}
	}

	span.innerHTML = "0 / 140";
	span.style.color = "white";
	span.style.float = "right";

	txt.parentNode.insertBefore(span, submit.nextSibling);

	var func = function() {
		span.innerHTML = txt.value.length + " / 140";
		span.style.color = txt.value.length > 140 ? "red" : "white";
	}

	txt.oninput = func;
	txt.onkeyup = func;
	txt.onmousemove = func;
	txt.onpropertychange = func;

	func();
}