/*
  info_search
  17-Apr-2008 17:32
  Steven Schuckman
*/
/*
  To set a row visible as in |rows[zxc0].style.display='block';|
  'block' works with Internet Explorer
  'table-row' works with Firefox
  '' works with both.
*/
/*
function selectClass(classSel){
 var table=document.getElementById('t1'); // Select the table (object) with id "t1" and assign table data to variable "table".
 var search=RegExp(classSel,"i"); // Get class to search for and make case insensitive and assign to variable "search".
 var rows=table.rows; // Assign row data to variable "rows".
 for (var zxc0=1;zxc0<rows.length;zxc0++){ // Cycle through all of the rows in the table.
  var cells=rows[zxc0].cells; // Assign cell data for the selected row to variable "cells".
   rows[zxc0].style.display='none'; // Set the selected row to not visible.
   if (cells[1].innerHTML.match(search)){ // Check the Class column only.
    rows[zxc0].style.display='';  // If a cell in the selected row matches, then set to visible.
   }
 }
}
*/

function selectAll(){
 var table=document.getElementById('detail'); // Select the table (object) with id "storage" and assign table data to variable "table".
 var rows=table.rows; // Assign row data to variable "rows".
 for (var zxc0=1;zxc0<rows.length;zxc0++){ // Cycle through all of the rows in the table.
  var cells=rows[zxc0].cells; // Assign cell data for the selected row to variable "cells".
   rows[zxc0].style.display=''; // Set the selected row to visible.
 }
}

function selectNone(){
 var table=document.getElementById('detail'); // Select the table (object) with id "storage" and assign table data to variable "table".
 var rows=table.rows; // Assign row data to variable "rows".
 for (var zxc0=1;zxc0<rows.length;zxc0++){ // Cycle through all of the rows in the table.
  var cells=rows[zxc0].cells; // Assign cell data for the selected row to variable "cells".
   rows[zxc0].style.display='none'; // Set the selected row to not visible.
 }
}

/*
function selectOther(){
 var table=document.getElementById('t1'); // Select the table (object) with id "t1" and assign table data to variable "table".
 var rows=table.rows; // Assign row data to variable "rows".
 for (var zxc0=1;zxc0<rows.length;zxc0++){ // Cycle through all of the rows in the table.
  var cells=rows[zxc0].cells; // Assign cell data for the selected row to variable "cells".
   rows[zxc0].style.display='none'; // Set the selected row to not visible.
   if (cells[1].innerHTML.match('Misc') || cells[1].innerHTML.match('Special')){ // Check the Class column only.
    rows[zxc0].style.display='';  // If a cell in the selected row matches, then set to visible.
   }
 }
}
*/

function Search(ipid){
 var table=document.getElementById('detail'); // Select the table (object) with id "storage" and assign table data to variable "table".
 var search=RegExp(document.getElementById(ipid).value,"i"); // Get value entered by user and make case insensitive and assign to variable "search".
 var rows=table.rows; // Assign row data to variable "rows".
 for (var zxc0=1;zxc0<rows.length;zxc0++){ // Cycle through all of the rows in the table.
  var cells=rows[zxc0].cells; // Assign cell data for the selected row to variable "cells".
  for (var zxc0a=0;zxc0a<cells.length;zxc0a++){  // Cycle through all of the cells in the selected row.
   rows[zxc0].style.display='none'; // Set the selected row to not visible.
   if (cells[zxc0a].innerHTML.match(search)){
    rows[zxc0].style.display='';  // If a cell in the selected row matches, then set to visible.
    break; // Since we have matched a cell, there is no need to search the rest of the cells, so terminate this for/next loop.
   }
  }
 }
}

