

function example(){
  document.F1.meta_include.value="windfarm, bird, collision, A Delicate Balance"
  document.F1.meta_exclude.value="local authority, council"
  alert(":: SEARCH HELP\n\nThere are two text entry boxes, one for terms to include in your search,\nthe other for terms to exclude from your search.\n\nYou can enter a list of words/phrases (separated by commas) in each box\nor you can just enter a single word or phrase.\n\nSome example search terms have been entered to guide you.")


}

function trim(strText) {
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}



function process(){
  //build contents string
  X=document.F1.Input.value
  if (X=="" || X==" Search term...") {
   	return false;
  }
  Y=X.split(",")
  Q1="((@Contents "
  L=Y.length
  for(i=0;i<L;i++){
    Z=trim(Y[i])+"*"
	Q1=Q1+Z+")"
	if(i<L-1){Q1=Q1+" AND (@Contents "}
  }
  Q1=Q1+")"

  //add exclude string
  X="" //document.F1.meta_exclude.value
  Y=X.split(",")
  Q2="((@Contents "
  L=Y.length
  for(i=0;i<L;i++){
    Z=trim(Y[i])
	Q2=Q2+Z+")"
	if(i<L-1){Q2=Q2+" AND (@Contents "}
  }
  Q2=Q2+")"


  //join them together
  Q=Q1
  if(L>1){Q="("+Q+") AND NOT (" + Q2+")"}

  //display
 // alert(Q)



  X=""//document.F1.meta_filename.value
  Q=Q+" AND "
  if(X.length>0){Q=Q+" (@Filename "+X+") AND "}
  Q=Q+"(@rank>0)"

  //document.write(Q)
  URL="searchresults.asp?key="+Q
  //URL=URL+"&sort=Rank"
  //URL=URL+"&sortorder="
  URL=URL+"&query="+document.F1.Input.value

  window.open(URL,'_self','width=700,height=550,resizable=yes,scrollbars=yes')

}

