function selectall() {
 document.write("<tr><td colspan=\"2\">&#160;</td><td>Select all</td><td><input type=\"checkbox\" name=\"c3\" onclick=\"choose()\" /></td></tr>");
}

function choose(){
  v = document.f1.c3.checked;

  for(var i=0; i<document.f1.collection.length; i++)
    if (!document.f1.collection[i].disabled) {
      document.f1.collection[i].checked=eval(v);
    }
}

function checksearchdata(obj){
  count=0
  len=obj.length // get the number of fields in the form
  for(var a=0; a<len; a++){
    if(obj[a].type=="checkbox" && obj[a].checked){ // only look at form elements that are checkbox type
      count++; // count the number of checked boxes
    }
  }

  if(count==0){
    alert("You must check at least one text box! ");
    return false // don't submit the form if no boxes are checked
  }

  author = document.f1.author.value;
  title = document.f1.title.value;
  subject = document.f1.subject.value;

  flag = 0

  if (author=="" && title=="" && subject==""){
    alert("Please enter at least one search term.");
    flag = 1
    return false;
  }

  if (flag == 0){
    document.f1.submit.value="Searching...."
    return true
  }
}

function openWindowCollection(id) {
        window.open("http://www.cecilia-uk.org/html/search/verb/ListIdentifiers/set/location/" + id ,null,"scrollbars=1, resizable=1, width=750, height=500");
}


function openWindowHelp(id)
{
        window.open("helpa.html#" + id ,null,"scrollbars=1, resizable=0, width=300, height=500");
}
