function CountLeft(field, counter_name, max) {
	// if the length of the string in the input field is greater than the max value, trim it
	if (field.value.length > max){
		field.value = field.value.substring(0, max);
	}else{
		// calculate the remaining characters
		var num_left=max - field.value.length;
		var num_used=field.value.length;
		document.getElementById(counter_name).innerHTML ="("+num_left+" left)" ; 
		//document.getElementById(counter_name).innerHTML =num_used+" Typed. "+num_left+" Left." ; 
	}
}
