  // This function is called during the form submit to set required cookies
  function setForm()
  {
    var sCookieText = '';    
    sCookieText += document.wfform.wf_field1.options[document.wfform.wf_field1.selectedIndex].value + ":";
    sCookieText += document.wfform.wf_term1.value + ":";    
    document.cookie = 'wf_search_structure=' + sCookieText + '; Path=/';      
    document.cookie = 'wf_selected_databases=' + sDatabaseCookie + '; Path=/';
      document.wfform.Databases.options[document.wfform.Databases.selectedIndex].value + '; Path=/';
  }


function showCategoryBox2(selectName, categoryOmit)
{
  var index = 0;
 document.write('<table class="indcategorytable" name=<"' + selectName + '"><tr><td>');

 

 for (i=0; i < category.length; i++)
 {
  var tempName = category[i][0][0];
  // URL encode commas 
  tempName = tempName.replace(/,/, "%2C");
  // Trim whitespace
  tempName = tempName.replace(/^\s+|\s+$/g,"");

 

  // Split the list of categories to omit using the comma.  
  // Caller must URL encode commas.
  var omitArray = categoryOmit.split(",");
  var omit = 0;
  for (j=0; j<omitArray.length; j++) {
         var omitCat = omitArray[j];
         omitCat = omitCat.replace(/^\s+|\s+$/g,"");
         if (omitCat == tempName) {
                 omit = 1;
                 continue;
         }
  }

 

  // Omit this category
  if (omit == 1)
         continue; 
         
  sOptionValue = '';
  sOptionText = '';

 

  sOptionText = category[i][0][0];

 

  for (j = 0; j < category[i][1].length; j++) {
   sOptionValue += ',' + category[i][1][j];
  }

 

  sOptionValue = sOptionValue.substr(1);
   index++;
   
   index = index % 2;

  if (index == 1)
  {
  document.write('<table align="left"><tr><td><input type="checkbox" name="Databases" option value="' + sOptionValue + '">' + sOptionText + '</td></tr></table>\n');
  }

 

   if (index == 0)
  {
  document.write('<table align="left"><tr><td><input type="checkbox" name="Databases" option value="' + sOptionValue + '">' + sOptionText + '</td></tr></table>\n');
  }

 
 }
 document.write('</td></tr></table>');
}