// JavaScript Document

// popup window function
function popUp(url, name, features) {

  newPopUp = window.open(url, name, features);
  if (window.focus) { newPopUp.focus(); }
	return false;

}

// image swap on rollover function
function rollOver(img_name, img_src) {
  document[img_name].src = img_src;
}

// check text area inputs for max length (use until spry validation implemented)
// usage: onkeyup/onkeydown="checkMaxLength(this, 'Comments', 1000)"
function checkMaxLength(form, inputName, maxLength) {
	if (form.value.length > maxLength) {
		form.value = form.value.substring(0, maxLength-1);
		alert("Sorry, there is a " + maxLength + " character limit for the " + inputName + " field.");
	}
}