function charcount() {
	if (document.getElementById("charcounter")) {
		var current = document.msg.msg.value.length;
		if (10000-current >= 0) { document.getElementById("charcounter").value = 10000-current; }
		else { document.getElementById("charcounter").value = 0; document.msg.msg.value = document.msg.msg.value.substring(0,10000); }  
	}
}
