function charCount(limit,counter,textfield) {
	var old = counter.value;
	counter.value=limit-textfield.value.length;
	if(counter.value < 0 && old >= 0) {
		alert('Field limited to (' + limit + ') characters!');
		if(document.styleSheets) {
			counter.style.fontWeight = 'normal';
			counter.style.color = '#ff0000';
		}
	}
	else if(counter.value >= 0 && old < 0 && document.styleSheets ) {
		counter.style.fontWeight = 'normal';
		counter.style.color = '#000000';
	} 
}