   var daysInMonth = new Array(12);
   daysInMonth[0] = 31;
   daysInMonth[1] = 29;   // must programmatically check this
   daysInMonth[2] = 31;
   daysInMonth[3] = 30;
   daysInMonth[4] = 31;
   daysInMonth[5] = 30;
   daysInMonth[6] = 31;
   daysInMonth[7] = 31;
   daysInMonth[8] = 30;
   daysInMonth[9] = 31;
   daysInMonth[10] = 30;
   daysInMonth[11] = 31;

// this function returns a value indicating the number of list items elected in the form passed. 
//  0  = none selected
//  -1 = all selected
//  any other number = count of items selected
//
// it assumes that each list row has a checkbox in it named "checkbox0" for 1st row, 
//  "checkbox1" for 2nd row and so on. It looks for a form element that matches that
//  checkbox name and then increments a count for each one checked.
//
function listItemsSelectedCount(form) {
	var checkedCount = 0;
	var checkboxName = "";
	var checkBoxIndex = 0;
	var searchString = "";
	
	// go through all elements on the form
	//
   	for(i = 0; i < form.elements.length; i++) {
	    checkboxName = "checkbox" + checkBoxIndex;	
		
		// if the current element is a checkbox with a name that matches then
		//    increment the checkbox index, which is different from the element count because
		//     there maybe many row elements but only one checkbox per row
		//
		//    if the checkbox is checked then
		//       add 1 to the checkedCount
		//
		
		//Took out the following if statement because in the Liability Summary screen some items
		//do not have a checkbox and this caused this function to always return 0 for the number
		//items selected.  Now search the the first 8 characters of the name of the form element 
		//for "checkbox" and if name
		//has "checkbox in it and its type is "checkbox" then add one to the checkBoxIndex.
		searchString = form.elements[i].name;
		searchString = searchString.substring(0,8);
		//if (form.elements[i].type == "checkbox" &&
		//    form.elements[i].name == checkboxName) {
		if (form.elements[i].type == "checkbox" &&
		   searchString == "checkbox") {
		   	   checkBoxIndex++;
		   if (form.elements[i].checked == true) {
				checkedCount++;
		   }
		}
	}
	
   // if no elements in the list then 
   //    just return 0 
   //
   if (checkBoxIndex == 0) {
      return 0;
   }
      
   // if the number of checkboxes checked equals the total number of checkboxes then 
   //    return -1
   // else if none checked then
   //    return 0
   // else return the number checked 
   //
   if (checkedCount == checkBoxIndex) {
      return -1;
   } else {
      return checkedCount;
   }
   
}


//--------------------------------------------------
//CHECKS IF THERE ARE CHECKBOXES IN THE LIST AT ALL.
//IF THERE IS NO ITEMS IN THE LIST (EMPTY LIST)
//RETURNS 0, OTHERWISE RETURNS 1
//
//Istvan Keszei, 05/10/2002
//--------------------------------------------------
function listItemsSelectedCountIsThereAny(form) {
	var checkedCount = 0;
	var checkboxName = "";
	var checkBoxIndex = 0;
	var searchString = "";
	
   	for(i = 0; i < form.elements.length; i++) {
	    checkboxName = "checkbox" + checkBoxIndex;	
	    searchString = form.elements[i].name;
	    searchString = searchString.substring(0,8);
	    if (form.elements[i].type == "checkbox" &&  searchString == "checkbox") {
			return 1;
	    }
	}
	return 0;
}



function listItemsSelectedCountForCheckBoxName(form, customCheckBoxName) {
    var customCheckBoxNameStr = customCheckBoxName;
	var checkedCount = 0;
	var checkboxName = "";
	var checkBoxIndex = 0;
	var searchString = "";
	var checkBoxNameLength = customCheckBoxName.length;

   	for(i = 0; i < form.elements.length; i++) {
	    checkboxName = customCheckBoxNameStr + checkBoxIndex;	
				
		searchString = form.elements[i].name;
		searchString = searchString.substring(0,checkBoxNameLength);
		if (form.elements[i].type == "checkbox" &&
		   searchString == customCheckBoxNameStr) {
		   	   checkBoxIndex++;
		   if (form.elements[i].checked == true) {
				checkedCount++;
		   }
		}
	}
	
   if (checkBoxIndex == 0) {
      return 0;
   }
      
   if (checkedCount == checkBoxIndex) {
      return -1;
   } else {
      return checkedCount;
   }
   
}

function validateRequiredTextFields(form, fields, fieldNames) {
	var errorMsg = "";
	var fieldNum = 0;
	for(fieldNum = 0; fieldNum < fields.length; fieldNum++) {
		if (!(notBlank(form.elements[fields[fieldNum]].value))) {
				errorMsg +=  fieldNames[fieldNum] + " must have a value.\n";
		}
	}
    return errorMsg;
}

function validateRequiredIntFields(form, fields, fieldNames) {
	var errorMsg = ""
	var fieldNum = 0;
	for(fieldNum = 0; fieldNum < fields.length; fieldNum++) {
		if (!(isDigitsOnly(form.elements[fields[fieldNum]].value)) || 
			!(notBlank(form.elements[fields[fieldNum]].value))){
				errorMsg +=  fieldNames[fieldNum] + " must have a numeric value.\n"
		}
	}
    return errorMsg;

}

function validateIntFields(form, fields, fieldNames) {
	var errorMsg = ""
	var fieldNum = 0;
	for(fieldNum = 0; fieldNum < fields.length; fieldNum++) {
		if (!(isDigitsOnly(form.elements[fields[fieldNum]].value))) {
				errorMsg +=  fieldNames[fieldNum] + " must be a numeric if a valued is entered.\n"
		}
	}
	return errorMsg;
}

function validateString(field, fieldName) {
   var aString = field.value;
   if (notNull(aString) && notBlank(aString)) {
      return true;
   }
   else {
      return displayError(field, fieldName + " field is blank. Please enter " + fieldName);
   }
}

function validateDigitsOnly(field, fieldName, aBlankOK) {
   var digits = field.value;
   if (isDigitsOnly(digits) && aBlankOK)
      return true;
	  
   if (notNull(digits) && notBlank(digits) && isDigitsOnly(digits)) {
      return true;
   }
   else {
      return displayError(field, fieldName + " field must be digits only. Please enter a valid " + fieldName);
    }
}

function validateNumber(field, fieldName) {
   var aNumber = trim(field.value);
   if (notNull(aNumber) && notBlank(aNumber) && isNumber(aNumber)) {
      return true;
   }
   else {
      return displayError(field, fieldName + " field must be a number or a decimal number. Please enter " + fieldName);
   }
}

function validateNumberOrBlank(field, fieldName) {
   var aNumber = trim(field.value);
   if (isNumber(aNumber)) {
      return true;
   }
   else {
      return displayError(field, fieldName + " field must be a number (or blank). Please enter " + fieldName);
   }
}

function validateDate2(field, fieldName, aBlankOK) {
   var errorMsg = "";
   var aDate = field.value;

   // if date field can be blank then as long as it is empty then that is ok
   //
   if (!(notNull(aDate)) && aBlankOK)
      return errorMsg;

   // if date must be entered it cannot be null, blank, other than 10 chars and must be
   // a valid format
   // otherwise display an error message
   //
   if (notNull(aDate) && notBlank(aDate) && isSize(aDate, 10) && isValidDateFormat(aDate)) {
      return errorMsg; 
   }
   else {
      errorMsg = " field must be a valid date within the following range and format: 01/01/1950 to 12/31/2025.";
      return "\n" + fieldName + errorMsg;
   }
}

function validateCurrency(field, fieldName, aBlankOK) {
	
	var errorMsg = "";
	var anAmount = field.value;
	
	if (notBlank(anAmount)) {
		if (isNumber(anAmount)) {
			if (numberOfCharactersAfterDecimal(anAmount) <= 2)
				return true;
			else {
				errorMsg = fieldName + " field must follow currency format: xxxx.yy";
				return displayError(field, errorMsg);
			}
		}
		else {
			errorMsg = fieldName + " field must follow currency format: xxxx.yy";
			return displayError(field, errorMsg);
		}
	}
	else {
		// Is left blank
		if (aBlankOK) {
			return true;
		}
		else {
			errorMsg = fieldName + " field must have a value.";
			return displayError(field, errorMsg);
		}
	}
}
/*
function validateDate(theField, fieldName, emptyOK) {
	var errorMsg = iInvalidDate +"\n Please re-enter the "+fieldName;
	// parse the date string ans send it to the isDate function to determine if the date is valid or not.
	if (validateDate.arguments.length == 2) 
		emptyOK = defaultEmptyOK;
	if ((emptyOK == true) && (isEmpty(theField.value))) 
		return true;
	var problemCharacters = dateDelimiters + lowercaseLetters + uppercaseLetters ;
	var normalizedDate = stripCharsInBag(theField.value, problemCharacters)
	var checkDate = "";
	if ((!(normalizedDate.length == 6 )) && (!(normalizedDate.length == 8 )))
		return warnInvalid (theField, errorMsg);
	else {
		// the length of the normalized string is 6 or 8  (with or without the century)
		if (normalizedDate.length == 6) {// consider this as not having the century entered (eg. 010100)
			// determine the century to add to the year
			var newYear = parseInt(normalizedDate.substring(4, normalizedDate.length));
			var month = normalizedDate.substring(0, 2);
			var day = normalizedDate.substring(2, 4);

			if (newYear > 30)  {// cutoff for 2000 was determined to be 30, if it needs to be different, change it here
				newYear += 1900;
			}else{
				newYear += 2000;
			}
			newYear = newYear.toString();
			if (isDate (newYear, month, day)){
				theField.value = month+"/"+day+"/"+newYear;
				return true;
			}else{
				return warnInvalid (theField, errorMsg);			
			}			
		}
		
		if (normalizedDate.length == 8) {// consider this as not having the century entered (eg. 010100)
			var newYear = parseInt(normalizedDate.substring(4, normalizedDate.length));
			var month = normalizedDate.substring(0, 2);
			var day = normalizedDate.substring(2, 4);
			if ((newYear < 1930) || (newYear > 2025))  {   // cutoff for 2000 was determined to be 30, if it needs to be different, change it here
				errorMsg = "Please enter a date that is between 1930 and 2025. \n Please re-enter the "+fieldName;
				return warnInvalid (theField, errorMsg);						
			}
			newYear = newYear.toString();
			if (isDate (newYear, month, day)){
				theField.value = month+"/"+day+"/"+newYear;
				return true;
			}else{
				return warnInvalid (theField, errorMsg);			
			}			
		}
	}	
}
*/;

function isValidDateFormat(aDate) {
   var mm = aDate.substring(0,2);
   var dd = aDate.substring(5,3);
   var yy = aDate.substring(6);
   var dash1 = aDate.substring(3,2)
   var dash2 = aDate.substring(5,6)

   // VIP: this function assumes the date string passed is 10 chars. Should be called via
   // the validateDate function above
   // a date is valid if
   //   it is in the format of mm?dd?yyyy where ? can be a /, -, or .
   //   it has 1-12 for month, 1-31 for day and 1950-2025 for year (inclusive)
   //   
   if ((dash1 == "/" || dash1 == "-" || dash1 == ".") &&
                                          (dash2 == "/" || dash2 == "-" || dash2 == ".")) {
      if (isDigitsOnly(mm) && isDigitsOnly(dd) && isDigitsOnly(yy)) {
         //if (mm >= 1 && mm <= 12 && dd >= 1 && dd <= 31 && yy >= 1950 && yy <= 2025) {
		 // Makesure that the month and year are valid before try to validate the Day because
		 // it will need a valid Month and Year
		 if ((mm >= 1 && mm <= 12) && (yy >= 1950 && yy <= 2025) && (isValidDay(mm, dd, yy))) {
            return true;
         }
      }
   }
   return false;
}

// For a given month this function will see if the day is valid. This function expects a valid
// Month and Year to be passed in.
function isValidDay(aMonth, aDay, aYear){
   if (aDay > daysInMonth[parseInt(aMonth) - 1]) return false;
   
   if ((aMonth == 2) && (aDay > daysInFebruary(aYear))) return false;

   return true;
}

// daysInFebruary (INTEGER year)
// 
// Given integer argument year,
// returns number of days in February of that year.

function daysInFebruary (year)
{   // February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (  ((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0) ) ) ? 29 : 28 );
}

function notNull(str) {
   if (str.length == 0) 
      return false;
   else
      return true;
}

// ---------------------------------------------------------------------------
//
// This will basically perform a String().trim() operation
//
function trim(str){
	var trimStr = str;
	var flag = true;
	while (flag){
		if (trimStr.charAt(0) == " ")
			trimStr = trimStr.substring(1);
		else
			flag = false;
	}
	flag = true;
	while (flag){
		if (trimStr.charAt(trimStr.length - 1) == " ")
			trimStr = trimStr.substring(0,trimStr.length - 1);
		else
			flag = false;
	}
	return trimStr
}
// end of function trim() ----------------------------------------------------

function notBlank(str) {
   for (i=0; i < str.length; i++) {
      if (str.charAt(i) != " ")
         return true;
   }
   return false;
}

function isSize(str, size) {
   if (str.length == size) 
      return true;
   else
      return false;
}

function numberOfCharactersAfterDecimal(str) {

	// This function assumes that the str has only one decimal point.	   
	var decimalIndex = 0;
	for (i=0; i< str.length; i++) {
    	aChar = str.charAt(i);
      	if (aChar == ".") {
	    	decimalIndex = i;
			return (str.length - decimalIndex - 1);
		}
      }
	  // No chars after the decimal
	  return decimalIndex;

}

function isNumber(str) {
   decimals=0;

   // Note: one and only one decimal point is allowed
   //
   for (i=0; i< str.length; i++) {
      aChar = str.charAt(i);
      if ((aChar >= "0" && aChar <= "9") || aChar == ".") {
         if (aChar == ".")
	    decimals++;
      }
      else 
         return false;
   }
   if (decimals > 1)
      return false;

   return true;
}

function isDigitsOnly(str) {
   for (i=0; i< str.length; i++) {
      aChar = str.charAt(i);
      if (aChar < "0" || aChar > "9") 
         return false;
   }
   return true;
}


function stripChars(str, chars) {
   var newString = "";
   for (i=0; i < str.length; i++) {
      aChar = str.charAt(i);
      if (chars.indexOf(aChar) == -1)
         newString += aChar;
   }
   return newString;
}

function isInRange(str, num1, num2) {
   var i = parseInt(str);
   return ((i >= num1) && (i <= num2));
}

function displayError(field, message) {
   alert("The " + message);
   field.focus();
   return false;
} 

function lastWord(str) {
   var lastWord = "";
   
   // note that last string count starts at 0 so last char is at length minus 1
   //
   var i = str.length - 1;
   for (var aChar = str.charAt(i); aChar != " " && i >= 0; aChar = str.charAt(i)) {
      lastWord = aChar + lastWord;
	  i--;
   }
   return lastWord;
}

function getProtectionClass(str) {
   var index = str.lastIndexOf("-");
   if (index <= 0) {
      return "";
   }
   
   // note that last string count starts at 0 so last char is at length minus 1
   //
   var pc = str.charAt(++index);
   var aChar = str.charAt(++index);
   if (aChar >= "0" && aChar <= "9") {
      pc += aChar;
   }
   return pc;
}

// this function creates and fills an array from a delimited string
// it expects a string like "Entry1%Entry2%Entry3" where % is the delimiter
// From this it will return an array of 3 entrys
//
function createArrayFromString(delimitedString, delimiter) {
   var colArray = new Array();
   var startIndex = 0;
   var endIndex = delimitedString.indexOf(delimiter);
   var i = 0;
   while (endIndex < delimitedString.length) {
      // if no more commas then 
	  //    get the last part of the string and set endIndex to string length
	  // else
	  //    get the string between the start and end index
	  //    move end index onto the next comma
	  //
	  if (endIndex == -1) {
	     endIndex = delimitedString.length;
		 colArray[i++] = delimitedString.substring(startIndex, endIndex);
	  } else {
         colArray[i++] = delimitedString.substring(startIndex, endIndex);
	     startIndex = endIndex + delimiter.length;		 
		 endIndex = delimitedString.indexOf(delimiter, startIndex);
	  }	  
   }   
   return colArray;
}

function validateZip(field, fieldName, aBlankOK) {
   var errorMsg = "";
   var aZip = field.value;

   // if zip field can be blank then as long as it is empty then that is ok
   //
   if (!(notNull(aZip)) && aBlankOK)
      return errorMsg;

   // if zip must be entered it cannot be null, blank, other than 10 chars and must be
   // a valid format
   // otherwise display an error message
   //
   if (notNull(aZip) && notBlank(aZip) && isValidZipFormat(aZip)) {
      return errorMsg; 
   }
   else {
      errorMsg = " field is invalid.  Use format: xxxxx or xxxxx-xxxx.";
      return "\n" + fieldName + errorMsg;
   }
}

function isValidZipFormat(zip) {
   // Make sure it is proper length
   //
   if ((zip.length < 5) || ((zip.length > 5) && (zip.length < 10))){
      return false;
   }
   
   // Check that the first five items are numbers
   //
   if (!(isDigitsOnly(zip.substring(0,5)))) {
      return false;
   }
      
   if (zip.length > 5) {
      // Check that the 6th item is a "-"
      //
      if (!(zip.substring(5,6) == "-")) {
         return false;
      }
   
      // Check that last 4 items are numbers
      //
      if (!(isDigitsOnly(zip.substring(6)))) {
         return false;
      }
   }

   return true;
}

// converts value in field passed to upper case, works with alphanumeric
// works for entry fields or text areas
//
function setToUpper(textControl) {
   textControl.value = textControl.value.toUpperCase();
}




//checks if the field is alphanumeric and the length is greater than 0.
function checkIfAlphanumeric(field, fieldName, aBlankOK) 
{

   capitalizeName(field);
   if (!(notNull(field)) && aBlankOK)
      return true;

   if (isAlphanumeric(field.value, aBlankOK))
   {
      return true;
   }
   else
   {
      var message = " field must be a valid string with alphanumeric characters.";
      alert("The " + fieldName + message);
      field.focus();
   }
   field.focus();
}





//The validateBirthDate returns only the String, not the error msg. window.
//this function will call it.
function validateDOB(field, fieldName, aBlankOK) {
  var error = "";
  error = validateBirthDate(field, fieldName, aBlankOK)
  if (error!="")
	alert(error);
}








// Check for correct Past Date (when it can't be future date)
//
function validatePastDate(field, fieldName, aBlankOK) {
   var errorMsg = "";
   var aDate = field.value;
   var currentDate = new Date();

   var curYear = currentDate.getYear();
   var curMonth = currentDate.getMonth()+1;
   var curDay = currentDate.getDate();

   // if date field can be blank then as long as it is empty then that is ok
   //
   if (!(notNull(aDate)) && aBlankOK)
      return errorMsg;

   // if date must be entered it cannot be null, blank, other than 10 chars and must be
   // a valid format
   // otherwise display an error message
   //
   if (notNull(aDate) && notBlank(aDate) && isSize(aDate, 10) && isValidPastDateFormat(aDate)) {
      //alert(errorMsg); 
   }
   else {
      errorMsg = " field must be a valid date within the following range and format: 01/01/1950 to "+curMonth+"/"+curDay+"/"+curYear+".";
      //return "\n" + fieldName + errorMsg;
      alert("\n" + fieldName + errorMsg);
      field.focus();
   }
}



function isValidPastDateFormat(aDate) {
   var mm = aDate.substring(0,2);
   var dd = aDate.substring(5,3);
   var yy = aDate.substring(6);
   var dash1 = aDate.substring(3,2)
   var dash2 = aDate.substring(5,6)
   var currentDate = new Date();

   var curYear = (currentDate).getYear();
   var curMonth = (currentDate).getMonth()+1;
   var curDay = (currentDate).getDate();
 
   if (curMonth<10) curMonth = "0"+curMonth;
   if (curDay<10) curDay = "0"+curDay;


    // VIP: this function assumes the date string passed is 10 chars. Should be called via
   // the validateDate function above
   // a date is valid if
   //   it is in the format of mm?dd?yyyy where ? can be a /, -, or .
   //   it has 1-12 for month, 1-31 for day and 1890-last year for year (inclusive)
   //   
   if ((dash1 == "/" || dash1 == "-" || dash1 == ".") &&
                                          (dash2 == "/" || dash2 == "-" || dash2 == ".")) {
      if (isDigitsOnly(mm) && isDigitsOnly(dd) && isDigitsOnly(yy)) {
         if (mm >= 1 && mm <= 12 && dd >= 1 && dd <= 31 && yy >= 1890) {
	   if (yy==curYear)
	   {
		if (mm==curMonth)
		{
			if (dd<=curDay)
			{
				return true;
			}
			else
				return false;
		}
		if (mm<curMonth)
			return true;
		else
			return false;
	   }
	   if (yy<curYear)
	   	return true;
	   else
		return false;
         }
      }
   }
   return false;
}
















// Check for correct date formatt and that it is not past current year.
//
function validateBirthDate(theField, fieldName, aBlankOK) {
/*   var errorMsg = "";
   var aDate = field.value;
   var year = new Date().getYear()-1;
   // if date field can be blank then as long as it is empty then that is ok
   //
   if (!(notNull(aDate)) && aBlankOK)
      return errorMsg;

   // if date must be entered it cannot be null, blank, other than 10 chars and must be
   // a valid format
   // otherwise display an error message
   //
   if (notNull(aDate) && notBlank(aDate) && isSize(aDate, 10) && isValidBirthDateFormat(aDate)) {
      return errorMsg; 
   }
   else {
      errorMsg = " field must be a valid date within the following range and format: 01/01/1890 to 12/31/"+year+".";
      return "\n" + fieldName + errorMsg;
   }
}
*/
	var maxYear = new Date().getYear()-1;
	var errorMsg = iInvalidDate +"\n Please re-enter the "+fieldName;
	// parse the date string ans send it to the isDate function to determine if the date is valid or not.
	if (validateBirthDate.arguments.length == 2) 
		aBlankOK = defaultEmptyOK;
	if ((aBlankOK == true) && (isEmpty(theField.value))) 
		return "";
	var problemCharacters = dateDelimiters + lowercaseLetters + uppercaseLetters ;
	var normalizedDate = stripCharsInBag(theField.value, problemCharacters)
	var checkDate = "";
	if ((!(normalizedDate.length == 6 )) && (!(normalizedDate.length == 8 )))
		return warnInvalid (theField, errorMsg);
	else {
		// the length of the normalized string is 6 or 8  (with or without the century)
		if (normalizedDate.length == 6) {// consider this as not having the century entered (eg. 010100)
			// determine the century to add to the year
			var newYear = parseInt(normalizedDate.substring(4, normalizedDate.length),10);
			var month = normalizedDate.substring(0, 2);
			var day = normalizedDate.substring(2, 4);

			if (newYear > 30)  {// cutoff for 2000 was determined to be 30, if it needs to be different, change it here
				newYear += 1900;
			}else{
				newYear += 2000;
			}
			newYear = newYear.toString();
			if (isDate (newYear, month, day)){
				theField.value = month+"/"+day+"/"+newYear;
				return "";
			}else{
				return warnInvalid (theField, errorMsg);			
			}			
		}
		
		if (normalizedDate.length == 8) {// consider this as not having the century entered (eg. 010100)
			var newYear = parseInt(normalizedDate.substring(4, normalizedDate.length),10);
			var month = normalizedDate.substring(0, 2);
			var day = normalizedDate.substring(2, 4);
			if ((newYear < 1890) || (newYear > maxYear))  {   // cutoff for 2000 was determined to be 30, if it needs to be different, change it here
				errorMsg = "Please enter a date that is between 1890 and "+maxYear+". \n Please re-enter the "+fieldName;
				return warnInvalid (theField, errorMsg);						
			}
			newYear = newYear.toString();
			if (isDate (newYear, month, day)){
				theField.value = month+"/"+day+"/"+newYear;
				return "";
			}else{
				return warnInvalid (theField, errorMsg);			
			}			
		}
	}	
}






























function isValidBirthDateFormat(aDate) {
   var mm = aDate.substring(0,2);
   var dd = aDate.substring(5,3);
   var yy = aDate.substring(6);
   var dash1 = aDate.substring(3,2)
   var dash2 = aDate.substring(5,6)
   currentDate = new Date();
      
   // VIP: this function assumes the date string passed is 10 chars. Should be called via
   // the validateDate function above
   // a date is valid if
   //   it is in the format of mm?dd?yyyy where ? can be a /, -, or .
   //   it has 1-12 for month, 1-31 for day and 1890-last year for year (inclusive)
   //   
   if ((dash1 == "/" || dash1 == "-" || dash1 == ".") &&
                                          (dash2 == "/" || dash2 == "-" || dash2 == ".")) {
      if (isDigitsOnly(mm) && isDigitsOnly(dd) && isDigitsOnly(yy)) {
         if (mm >= 1 && mm <= 12 && dd >= 1 && dd <= 31 && yy >= 1890) {
            return true;
         }
      }
   }
   return false;
}







function listSelections(listObj) {
   // given a multi select combo box returns a string as
   // - empty if no selections or
   // - all selection indexes delimited by a comma, eg 2,7,12,
   //	  
   var indices = "";
   for (var i = 0; i < listObj.length; i++) {	  
      if (listObj[i].selected) {
	     indices += i;
  	     indices += ",";
	  }
   }   
   return indices;
}
