// This function selects the method used to invoke the Google custom search
// The two methods available are:
//   Place the search results into an iframe on a ppnf.org hosted page
//   Place the search results on a Google hosted page
// As of May 20, 2007 the Google results do not function in an iframe with IE6!!!
// Because of this we default to using the Google hosted page for IE6
//
// 'override' may conatin the following values:
//   override = ''  - just test for IE6
//   override = 'I' - force use of iframe
//   override = 'G' - force use of Google hosted page
//   override = 'B' - supply two forms to allow the user to select the method (for test)
//
// 'bd' is an array built by the browser_dector script
function SelectSearchMethod(override, bd)
{
// document.writeln('The value for bd.browser = '+bd.browser+' and bd.majorver = '+bd.majorver+'.');
  var formbuilt = false;
  if( override != 'G' && ( (override == 'I' || override == 'B') || !(bd.browser == 'IE' && bd.majorver == '6')) )
  {
    // This method places the search results into an iframe on a ppnf.org hosted page
    document.writeln('<!-- Google CSE Search Box Begins -->');
    document.writeln('  <center>');
    if( override == 'B') document.writeln('<br>PPNF.ORG Hosted Page<br>');
    document.writeln('  <form id="searchbox_001184285657853181069:dfdapmrrjem"  action="http://www.ppnf.org/catalog/ppnf/gsrch_results.htm">');
    document.writeln('    <input type="hidden" name="cx" value="001184285657853181069:dfdapmrrjem" />');
    document.writeln('    <input type="hidden" name="cof" value="FORID:11" />');
    document.writeln('    <input name="q" type="text" size="40" />');
    document.writeln('    <input type="submit" name="sa" value="Search" />');
    document.writeln('    <img src="http://www.google.com/coop/images/google_custom_search_smnar.gif" alt="Google Custom Search" />');
    document.writeln('  </form>');
    document.writeln('  </center>');
    document.writeln('<!-- Google CSE Search Box Ends -->');
    formbuilt = true;
  }
  if( (override == 'G' || override == 'B') || formbuilt == false)
  {
    // This method places the search results on a Google hosted page
    document.writeln('<!-- Google CSE Search Box Begins  -->');
    document.writeln('  <center>');
    if( override == 'B') document.writeln('<br>GOOGLE Hosted Page<br>');
    document.writeln('  <form id="searchbox_001184285657853181069:dfdapmrrjem" action="http://www.google.com/cse">');
    document.writeln('    <input type="hidden" name="cx" value="001184285657853181069:dfdapmrrjem" />');
    document.writeln('    <input type="hidden" name="cof" value="FORID:0" />');
    document.writeln('    <input name="q" type="text" size="40" />');
    document.writeln('    <input type="submit" name="sa" value="Search" />');
    document.writeln('    <img src="http://www.google.com/coop/images/google_custom_search_smnar.gif" alt="Google Custom Search" />');
    document.writeln('  </form>');
    document.writeln('  </center>');
    document.writeln('<!-- Google CSE Search Box Ends -->');
  }
  return;
}
