//this file is used to contain scripts used in forms 
function submitFormsOnEnter(evt, formName) {
	var evt = (evt) ? evt : event
	var charCode = (evt.which) ? evt.which : evt.keyCode
	if (charCode == 13) {
		//submit the form with the name passed in as 2nd parameter
		document.forms['' + formName].submit();
	}
}

/* moved these from /search/persons/index.php
 * to here - lm june 2011
 */

function change_location (checkbox) {
	  if (checkbox.checked) {
	    document.getElementById('location-fieldset').style.display = '';
	  } else {
	    document.getElementById('location-fieldset').style.display = 'none';
	  }
	}

	function change_dob_option (drop) {
	  if (drop.options[drop.selectedIndex].value == 'between') {
	    document.getElementById('dob-between').style.display = '';
	  } else {
	    document.getElementById('dob-between').style.display = 'none';
	  }
	}
