﻿function Count(text, long, obj) {
	var maxlength = new Number(long); // Change number to your max length.
	document.getElementById(obj).innerHTML = "You have " + (long - text.value.length) + " remaining characters.";

	if (text.value.length > maxlength) {

		text.value = text.value.substring(0, maxlength);
		obj.innerHTML = "You have 0 remaining characters.";
	}
}

function deleteNodes(parent) {
	while (parent.hasChildNodes()) { parent.removeChild(parent.lastChild); }
}

function fixDate(dt) {
	var str = dt.format("d");
	if (str == '01/01/1900') {
		return '';
	} else {
		return str
	}
}