// set the max number of charaters that can be written to a textarea
	function setMaxlen(imax, iObj, iSpan){
		Limit = imax - iObj.value.length;
		if (Limit > 0) {	
			iSpan.innerHTML = Limit;			
		}
		else {
			iSpan.innerHTML = 0;
			iObj.value = iObj.value.substring(0, imax);
		}
	}
	function initMaxlen(imax, iObj, iSpan){
		Limit = imax - iObj.value.length;
		if (Limit > 0) {	
			iSpan.innerHTML = Limit;			
		}
		else {
			iSpan.innerHTML = 0;
			iObj.value = iObj.value.substring(0, imax);
		}
	}

// for the date of birth it build the exact days for the chosen month and year
function getDays(iYear, iMonth, iDay, bNone) {
	var daysInMonth;
	var dPrevDate;
	var myDays;
	var i, j , Len;
	
	//Get the number of days in the chosen month for the chosen year
	dPrevDate = new Date(iYear, iMonth, 0);
	daysInMonth = dPrevDate.getDate();
	myDays = document.form1.day;

	//Remove all values from the select box
	Len = myDays.length - 1
	for(i = Len ; i > 0; i--){
		myDays.options[i]	= null;
	}

	// Add an empty value if bNone is true
	j = 0;
	if (bNone) {
		myDays[j]=new Option('','');
		j = 1;
	}
	//Add the New values
	for (i = 1; i <= daysInMonth; i++) {
		myDays[j]=new Option(i,i);
		if (i==iDay){
			myDays[j].selected= true;
		}
		j += 1;
	}
}
