//-------------------------------------------
//-- count number of chars in string passed in and
//-- compare with a maximumm value passed
function countChars2(formElem,dElem,maxLen,formName){

//-- define counter name
dElem = document.getElementById(dElem)

	//-- check string length vs max length allowed
	//-- check for exceeded value (will happen if user pastes data into box)
	if(formElem.value.length > maxLen){
		alert("sorry - you have exceeded the maximum amount of text allowed in this field.");
		fullString = formElem.value;
		formElem.value = fullString.substring(0,maxLen-1);
		formElem.focus();
		return false;
	}
	if(formElem.value.length == maxLen){
		alert("sorry - you have reached the maximum amount of text allowed in this field.");
		len = formElem.value.length;
		dElem.innerHTML = maxLen - len;
		return false; 
	}else{
		//-- if its ok then increment thc counter
		len = formElem.value.length;
		dElem.innerHTML = maxLen - len;
	}
}