function help()
{
  // get xmlhttp object for ajax request 
  xmlhttp=getAjaxObj();
 
  // load the output from help.php  
  makeRequest("help.php",'maindiv',xmlhttp);    
  
}

function privpol()
{
  // get xmlhttp object for ajax request 
  xmlhttp=getAjaxObj();
 
  // load the output from help.php  
  makeRequest("privpol.php",'maindiv',xmlhttp);    
  
}

function tsandcs()
{
  // get xmlhttp object for ajax request 
  xmlhttp=getAjaxObj();
 
  // load the output from help.php  
  makeRequest("tsandcs.php",'maindiv',xmlhttp);    
  
}

function simpleSearch(itemPage)
{
    
  // alert("itempage is " + itemPage);
  
  // is itempage valid
  if(itemPage>1 || itemPage<400) ; // do nothing 
  else
  {
    return;
  }
  
  //var index = document.simpleSearchForm.index.value;
  //var keywords2 = document.keywords2.value;
  var index = document.getElementById('index').value;
  var keywords2 = document.getElementById('keywords2').value;
  
  // alert("index is " + index + ", kewords2 is " + keywords2);
  
  if(keywords2!="")
  {
    var r = checkText(keywords2,2,100);
    if(r.substr(0,1)!=1){
      alert("search input field " + r + " please re-key ");
      document.getElementById('keywords2').focus();
      return false;
    }
  }
  
  if(keywords2=="")
  {
    alert("the search input field is blank, please re-key");
    return;
  }
  
  // get xmlhttp object for ajax request 
  //xmlhttp=getAjaxObj();
  //makeRequest("search.php?index=" + index + "&keywords2=" + keywords2 + "&itemPage=" + itemPage,'maindiv',xmlhttp); 
  
  // document.getElementById('maindiv').innerHTML = '<br/>&nbsp<br/><h2>Searching please wait</h2><center><img src="assets/progressbar.gif" /></centre><br/><hr/><br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;<br/>&nbsp;';
  
  window.location="index.php?type=search&index=" + index + "&keywords2=" + keywords2 + "&itemPage=" + itemPage;    

}

/////////////////////////////////////////////////////////////////////////////////////
//  function to check if the return key has been hit after the search input field has 
//  had charaters keyed 
/////////////////////////////////////////////////////////////////////////////////////

function checkEnter(e){ 
  //e is event object passed from function invocation
  var characterCode // literal character code will be stored in this variable

  if(e && e.which)
  { //if which property of event object is supported (NN4)
    e = e
    characterCode = e.which //character code is contained in NN4's which property
  }
  else
  {
    e = event
    characterCode = e.keyCode //character code is contained in IE's keyCode property
  }

  if(characterCode == 13)
  { //if generated character code is equal to ascii 13 (if enter key)
    simpleSearch('1') //process form info 
    return false 
  }
  else
  {
    return true 
  }

}
