function textCounter() {
	if (document.getElementById('msg').value.length > 500) {
		$('msg').value = $('msg').value.substring(0, 500);
	} else {
		$('counter').value = 500 - $('msg').value.length;
	}
}

function sendIt() {
	var cont = true;
	if ($('phone').value == '' && $('email').value == '') {
		cont = confirm('You have not included any contact information (phone or email). This information is not required, ' +
		'however, if you would like to receive a response from City staff, they will need at least one method ' +
		'to contact you. Do you wish to proceed anyway?');
	}
	// FILTER HTML ENCODING
	var noAllow = new Array('<','>','|');
	var fields = new Array('input','select','textarea');
	var r = $('rep');
	var x, y;
	var htmlFound = false;
	for (a = 0; a < fields.length; a++) {
		x = r.getElementsByTagName(fields[a]);
		for (z = 0; z < x.length; z++) {
			for (i = 0; i < noAllow.length; i++) {
				if (x[z].value.indexOf(noAllow[i]) > -1)
					htmlFound = true;
			}
		}
	}
	if (htmlFound) {
		cont = false;
		alert("This form will not accept HTML encoded entities. Please remove the following characters from " +
		"your submission: '<', '>', and '|'");
	}
	if (cont) {
		getForm('rep',location.href + 'default.asp');
	}
	toTop();
}