// Javascript for the Digital Manuscripts Collection


// print window function
function printWindow() {
                   if (window.print)
                     window.print()
                   else
                     alert("Sorry, This function is not supported on your computer.  Please use the File menu then select Print.");
} 

function submitForm() {
  var myform = document.searchform;

  // Trim leading and trailing blank spaces
  myform.qt.value = trim(myform.qt.value);

  // Check message
  if (myform.qt.value == "") {
    alert("Please enter a search term.");
  } else {
    myform.submit();
  }
}

function trim(str) {
  str = str.replace(/^\s+/, "");
  str = str.replace(/\s+$/, "");
  return str;
}